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

Asynchronous Serial Routine

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



Joined: 18 Oct 2003
Posts: 145

View user's profile Send private message

Asynchronous Serial Routine
PostPosted: Sun Feb 05, 2006 9:48 am     Reply with quote

Hi,

I have some problems with the software uart and I want to use other routine that CCS, somebody write serial routine for no UART ports ?.

Is possible that post this?

Thank you very much!!
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Sun Feb 05, 2006 7:32 pm     Reply with quote

Go look at http://www.piclist.com/techref/microchip/rs232.htm. Probably all in assembly but from that you can either work backwards or re-code as in-line.

Also http://www.pic101.com/mcgahee/ is well worth a visit. Fr. Tom McGahee has a very well documented set of RS232 functions.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Freddie



Joined: 06 Sep 2003
Posts: 49

View user's profile Send private message

PostPosted: Fri Feb 10, 2006 5:10 pm     Reply with quote

In CCS you can use any pin as a serial port, regardless if that pin has a hardware UART port on it. It works great. I use it all the time..

Look in the manual, but you want to do something like this:
Code:


#define ToPC                   PIN_C6   //your pins here
#define FromPC                   PIN_C7  //your pins here

#use delay(clock=20000000)
#use rs232(BAUD=9600, XMIT=ToPC, RCV=FromPC, STREAM=serialPC)

...

printf(serialPC,"TestBoxFound\r\n");


PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 10, 2006 5:16 pm     Reply with quote

He doesn't want to use the CCS library code:
Quote:
I want to use other routine that CCS
Ttelmah
Guest







PostPosted: Sat Feb 11, 2006 10:45 am     Reply with quote

Though it would be interesting to know 'why not' The CCS code, except for a few problems on specific chips/versions, is pretty good.

Best Wishes
Freddie



Joined: 06 Sep 2003
Posts: 49

View user's profile Send private message

PostPosted: Sat Feb 11, 2006 1:46 pm     Reply with quote

Oh, I see.

If you don't want to use the built-in CCS serial routines, and have not found anything else yet, you could use Peter Anderson's serial routines.

You have to purchase his PIC Routine Library (wich is excellent BTW) at:
http://www.phanderson.com/PIC/PICC/pic_c_routines.html


Here is a sample program that uses his routines:
http://www.phanderson.com/PIC/PICC/CCS_PCM/lcd_f84.html

Hope this help. Very Happy
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