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 support@ccsinfo.com

Only first 3 bytes received from serial com1

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



Joined: 28 Sep 2009
Posts: 5

View user's profile Send private message

Only first 3 bytes received from serial com1
PostPosted: Thu Nov 19, 2009 7:33 am     Reply with quote

I don't understand why I always get only the first 3 bytes at a time from my serial Com. I tried to use interrupt #int_RDA to see whether does it help, but to no avail. Some people met this problem too I guess. They were saying about clearing the buffer? I want to store the data received from the RS232 in an array named B2data. Below is part of my code..
Code:

#use rs232 (baud=115200, xmit=PIN_C6, rcv=PIN_C7,ERRORS,STREAM=COM1)
#use rs232 (baud=115200, xmit=PIN_G1, rcv=PIN_G2,ERRORS,STREAM=COM2)
#use rs232 (baud=57600, xmit=PIN_E3, rcv=PIN_E4,ERRORS,STREAM=COM3) //for clk=20M max = 57600
#priority RDA,TIMER1

char B2data[8];

   while(1)
   {
      B2data=fgetc(COM1);
      if(B2data[i]=='w' || B2data[i]=='W')
         {
           ........................
         }
      if(B2data[i]=='Q' || B2data[i]=='Q')
         {
           ........................
         }
   }

Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Thu Nov 19, 2009 8:38 am     Reply with quote

There is no where enough code here to work with.
Preferably a compilable program would be nice.
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