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 CCS Technical Support

Example of UART needed

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



Joined: 06 Dec 2012
Posts: 47
Location: Banned - pirate

View user's profile Send private message

Example of UART needed
PostPosted: Thu Mar 21, 2013 10:14 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Mar 21, 2013 11:04 am     Reply with quote

Put in a #use rs232() statement, the use printf() and send it. Example:
http://www.ccsinfo.com/forum/viewtopic.php?t=34386&start=1

If you have any questions about #use rs232() or printf(), then download
the CCS manual and read it:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
jayanthd



Joined: 06 Dec 2012
Posts: 47
Location: Banned - pirate

View user's profile Send private message

PostPosted: Thu Mar 21, 2013 11:28 am     Reply with quote

PCM programmer wrote:
Put in a #use rs232() statement, the use printf() and send it. Example:
http://www.ccsinfo.com/forum/viewtopic.php?t=34386&start=1

If you have any questions about #use rs232() or printf(), then download
the CCS manual and read it:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf


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

View user's profile Send private message

PostPosted: Thu Mar 21, 2013 11:42 am     Reply with quote

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: 9229
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Mar 21, 2013 12:10 pm     Reply with quote

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
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