CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

HELP!! how to get data from RXD of PIC16F877? (RS 232)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cxiong



Joined: 09 Sep 2003
Posts: 52

View user's profile Send private message MSN Messenger

HELP!! how to get data from RXD of PIC16F877? (RS 232)
PostPosted: Tue Jan 20, 2004 8:59 pm     Reply with quote

Question
Question
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

View user's profile Send private message

PostPosted: Tue Jan 20, 2004 11:02 pm     Reply with quote

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

View user's profile Send private message

Re: HELP!! how to get data from RXD of PIC16F877? (RS 232)
PostPosted: Wed Jan 21, 2004 9:18 am     Reply with quote

cxiong wrote:
Question
Question
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

View user's profile Send private message

RF - Rxd
PostPosted: Thu Jan 22, 2004 4:58 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group