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

uart code

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



Joined: 20 Mar 2014
Posts: 4

View user's profile Send private message

uart code
PostPosted: Thu Mar 20, 2014 6:42 pm     Reply with quote

Hi all

please how can I write a code like that by the CCS compiler , I can't find an instruction equivalent to it

if (uart_available())
{
c1 = getchar();
}
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Thu Mar 20, 2014 6:52 pm     Reply with quote

Hi,

The kbhit() function will tell you if a character is available. If you are using the hardware UART it's probably better to just use the int_rda interrupt rather than polling to see if a character is available.

John
Green20



Joined: 20 Mar 2014
Posts: 4

View user's profile Send private message

PostPosted: Thu Mar 20, 2014 7:03 pm     Reply with quote

Thank you sooo much
Green20



Joined: 20 Mar 2014
Posts: 4

View user's profile Send private message

PostPosted: Thu Mar 20, 2014 7:25 pm     Reply with quote

I'm sorry but please I need to clear a register but when I'm searching in the content of the CCS compiler I just found :
bit_clear(x,2);
so this clear only one bit of a register not all the content of it !!!
newguy



Joined: 24 Jun 2004
Posts: 1907

View user's profile Send private message

PostPosted: Thu Mar 20, 2014 7:31 pm     Reply with quote

x = 0;
Green20



Joined: 20 Mar 2014
Posts: 4

View user's profile Send private message

PostPosted: Thu Mar 20, 2014 7:41 pm     Reply with quote

thank you again Smile
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