View previous topic :: View next topic |
Author |
Message |
Green20
Joined: 20 Mar 2014 Posts: 4
|
uart code |
Posted: Thu Mar 20, 2014 6:42 pm |
|
|
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
|
|
Posted: Thu Mar 20, 2014 6:52 pm |
|
|
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
|
|
Posted: Thu Mar 20, 2014 7:03 pm |
|
|
Thank you sooo much |
|
|
Green20
Joined: 20 Mar 2014 Posts: 4
|
|
Posted: Thu Mar 20, 2014 7:25 pm |
|
|
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
|
|
Posted: Thu Mar 20, 2014 7:31 pm |
|
|
x = 0; |
|
|
Green20
Joined: 20 Mar 2014 Posts: 4
|
|
Posted: Thu Mar 20, 2014 7:41 pm |
|
|
thank you again |
|
|
|