View previous topic :: View next topic |
Author |
Message |
jayanthd
Joined: 06 Dec 2012 Posts: 47 Location: Banned - pirate
|
Example of UART needed |
Posted: Thu Mar 21, 2013 10:14 am |
|
|
Hello!
I have written a adc code shown here http://www.ccsinfo.com/forum/viewtopic.php?p=173480#173480
I want to sent the data serially through UART. I have done a lot of PIC projects using Hi Tech C, Cxx, XC, mikroE, and many other Compilers but I am new to CCS C Compiler.
Can somebody provide an example CCS C code for UART communication?
I just need to send my adc value through UART. I am using PIC16F877 at 20 MHz. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
jayanthd
Joined: 06 Dec 2012 Posts: 47 Location: Banned - pirate
|
|
Posted: Thu Mar 21, 2013 11:28 am |
|
|
Where is the UART code? It shows only #use line which is for UART config.
How to use printf for UART. I use both LCD and UART. does using printf("UART"); prints data on UART terminal?
Edit: I got it working on Proteus and real hardware.
http://www.pixhost.org/show/3158/16383436_uart1.jpg |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Mar 21, 2013 11:42 am |
|
|
I'm glad you got it working, but you ignored my last statement, which
gave you a resource to read (the link to CCS manual) which would
answer all your questions. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Mar 21, 2013 12:10 pm |
|
|
1) get RID of Proteus. At the very least NEVER,EVER think that Proteus is working 'right'...it is full of bigs, errors, faulty DRCs.if I had a 41 for every 'P' question...I'd be a millionaire, honestly.
2) read some of the hundred+ sample 'examples' that CCS supplies in the 'EXAMPLES' folder.99.9% of what 99.9% of the questions asked here can be answered by reading those examples.
3) 'odd' stuff....read the CCS compiler help files(pressing F11 opens it).
4) start with known code, edit,test,try again.build upon what you know works!
everyone here is willing to help,but not do your homework.
hth
jay |
|
|
|