Question on UART of SK18B sample source code

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Question on UART of SK18B sample source code

Postby gorgom » Fri Nov 25, 2011 1:09 am

Hi,

uart_send(10);

May I know what is the meaning of the number (10) in the above code. Where I can find the detail about the number in the bracket because I think there are other numbers beside 10.
gorgom
Newbie
 
Posts: 13
Joined: Sat Oct 15, 2011 11:11 pm

Re: Question on UART of SK18B sample source code

Postby ABSF » Fri Nov 25, 2011 6:12 am

I'd guess 10 is the ASCII code for Line Feed, ie carriage return. You can try 0x41 to 0x5A to see if it displays A-Z in capital...

Allen
The next war will determine NOT who is right BUT what is left.
User avatar
ABSF
Professional
 
Posts: 810
Joined: Wed Nov 10, 2010 9:32 am
Location: E Malaysia

Re: Question on UART of SK18B sample source code

Postby robosang » Fri Nov 25, 2011 9:31 am

I think uart_send (10) is sending decimal value of 10 to uart as explained by allen. If the uart is connected to HyperTerminal or similar program, it will produce New Line, or sometime called Line Feed. The cursor will jump to following line. So if you send any ASCII code after that command, it will appear on new line.

As Allen suggested, try it with different value, it will not explode or damage your system.
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 0 guests

cron