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: Tue Jan 20, 2004 8:59 pm |
|
|
HELP!!!
I try to read a data package (serial data) on my wireless receiver module. I use PIC16F877 pin RC7 (RXD) connect to the the data out of the wireless module. I try to read the data on RXD pin of the PIC. My previous response was to use getc(). But base on my understanding, getc() is use only on reading character. Can I use it to read a real data?
My application is to read a real number from 0-255.
Please help......
Anyone have an example?
Thanks... |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue Jan 20, 2004 11:02 pm |
|
|
What do you mean by 'real data'? In C char data type is 8 bits wide and has a value between 0 and 255, and that's what getc() returns. In other words, you can use getc() to read one byte of data from the serial port. So you can use it in your application. |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
Re: HELP!! how to get data from RXD of PIC16F877? (RS 232) |
Posted: Wed Jan 21, 2004 9:18 am |
|
|
cxiong wrote: |
HELP!!!
I try to read a data package (serial data) on my wireless receiver module. I use PIC16F877 pin RC7 (RXD) connect to the the data out of the wireless module. I try to read the data on RXD pin of the PIC. My previous response was to use getc(). But base on my understanding, getc() is use only on reading character. Can I use it to read a real data?
My application is to read a real number from 0-255.
Please help......
Anyone have an example?
Thanks... |
You may use getc() to get a byte of data that came into the serial port. It has nothing to do with character type data but ASCI character codes exist for every byte. |
|
|
Electron
Joined: 22 Jan 2004 Posts: 1
|
RF - Rxd |
Posted: Thu Jan 22, 2004 4:58 am |
|
|
Hi
I have tried rf data reception. My RF-Rx module generated garbage data when the RF-Tx was off or out of range causing the RxD to be corrupted.
Could this be your problem ?? or are you using a better RF-Rx module.
Try disconnecting the RF-Rx and piping some data from a PC serial port, just to see if the PIC firmware is operating ??
or use a max232 or other chip to send the RF-Rx data to a terminal program via a PC serial port. (Protocol dependant)
Regards
Eric |
|
|
|