View previous topic :: View next topic |
Author |
Message |
cfernandez
Joined: 18 Oct 2003 Posts: 145
|
Asynchronous Serial Routine |
Posted: Sun Feb 05, 2006 9:48 am |
|
|
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
|
|
Posted: Sun Feb 05, 2006 7:32 pm |
|
|
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
|
|
Posted: Fri Feb 10, 2006 5:10 pm |
|
|
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
|
|
Posted: Fri Feb 10, 2006 5:16 pm |
|
|
He doesn't want to use the CCS library code:
Quote: | I want to use other routine that CCS |
|
|
|
Ttelmah Guest
|
|
Posted: Sat Feb 11, 2006 10:45 am |
|
|
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
|
|
|
|