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

#use rs232 receives the data but all bits are 0

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








#use rs232 receives the data but all bits are 0
PostPosted: Fri Oct 06, 2006 8:00 am     Reply with quote

Hi,
Quote:

#use rs232(baud=115200, xmit=PIN_C6, rcv=PIN_C7,STREAM=FP)

Fdummy=0;
while(TRUE){
if (kbhit(FP)){
Fresponse[Fdummy] == fgetc(FP);
if (Fresponse[Fdummy] == 0x0A){return 1;}
Fdummy++;
}
}

this is the code when i run this program Fdummy becomes 13 but the bytes of Fresponse array are 0. I use scobe and see that not all cycles are 0. My pic is 18f6722 and the clock is 3276800. is there problem at UART
drh



Joined: 12 Jul 2004
Posts: 192
Location: Hemet, California USA

View user's profile Send private message

PostPosted: Fri Oct 06, 2006 8:19 am     Reply with quote

Change this:
Fresponse[Fdummy] == fgetc(FP);

To this:
Fresponse[Fdummy] = fgetc(FP);

and try it again.
_________________
David
gnz
Guest







PostPosted: Sat Oct 07, 2006 1:16 am     Reply with quote

Thanks. I've noticed this a few minutes ago. But spent so much time on it.
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