View previous topic :: View next topic |
Author |
Message |
cxiong
Joined: 09 Sep 2003 Posts: 52
|
HELP!! how to get data from RXD of PIC16F877? (RS 232) |
Posted: Fri Oct 31, 2003 2:43 pm |
|
|
I try to experiment on the wireless Technology and use the XMIT & RCV channel of the PIC above.
I know that when you printf(" .......",x) is to send the serial data to the TX line or to the PC, but I want to read the data of the RVC line of my wireless receiver module and display the data in portc.
The data from the transmitter was a temperatue sensor attached to ADC (10-bits)channel0 of a PIC16F877. The transmitter get the sensor data and transmit it to the TX line. The TX line was connected to a wireless transmitter module.
What code should I use to get the sensor data?
Any body got an example code in PIC C?
Please help. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Oct 31, 2003 3:36 pm |
|
|
Are you asking how to get a byte that has been received by the USART ?
The answer is, use the getc() function. Example:
main()
{
char c;
c = getc();
while(1);
} |
|
|
Guest
|
|
Posted: Mon Mar 15, 2004 6:49 pm |
|
|
i was going through the search looking for help on cummunicating wireless between to pics,
from the above it lloks like all i need to do is connect the transmitter to c6 the tx pin, and printf(",,,,",x) whatever i need.
then to recieve i just connect the rx to c7 the recieve pin and use a getc command,
is it this easy, i doubt it. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Mar 15, 2004 6:58 pm |
|
|
I wouldn't draw a lot of conclusions from my answer to him.
He didn't give all the details necessary for a complete
answer, to I just gave him the most simple answer possible. |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Tue Mar 16, 2004 12:37 pm |
|
|
remember also that if you don't use a RS232 level converter,..ie max232 then you need to INVERT the signal.
Code: |
#use rs232(baud=19200, xmit=PIN_E0, INVERT, stream=debug)
| [/code] |
|
|
|