View previous topic :: View next topic |
Author |
Message |
Sigma Guest
|
microchip C18 c compiler software RS232 |
Posted: Fri Apr 30, 2004 2:45 am |
|
|
Hi, Friends,
I am now using microchip C18 controller and pic18f452.
This compiler does not have the #use rs232 directives, therefore i may need to write the software RS-232 communication protocol myself.
And my hardware uart is already in use by another communication channel.
Did any of you implement this before? Or do you have any sample codes?
Thanks.
Sigma |
|
|
Sigma Guest
|
|
Posted: Fri Apr 30, 2004 3:04 am |
|
|
By the way, i did see some posts using interrupt to achieve this. But could not see anyone using polling. Why? I like polling.
Sigma |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
C18 Resource |
Posted: Fri Apr 30, 2004 6:25 am |
|
|
This site is a very good resource for code that should work for the C18 compiler (including the software RS232) and you would likely get more info there. C18 folks dont hang around here much...
http://www.microchipc.com/
You shoudl also try the microchip C18 programmers forum here:
http://forum.microchip.com/tt.asp?forumid=-2 |
|
|
Sigma Guest
|
|
Posted: Mon May 03, 2004 7:30 pm |
|
|
Thx, all. |
|
|
Sigma
Joined: 03 May 2004 Posts: 48 Location: Sg
|
|
Posted: Sun May 09, 2004 9:33 pm |
|
|
Hi, all,
I am now trying to convert the assembly code of AN555 to PIC C code, where i encountered a problem.
There is one section in the rs232.h i don't quite understand,
Code: | LOAD_RTCC MACRO Mode, K, Prescale
if(UsePrescale == 0 && Mode == 0)
movlw -K + _Cycle_Offset1
else
movlw -K + (_Cycle_Offset1 >> (Prescale+1)) ; Re Load RTCC init value + INT Latency Offset
endif
movwf TMR0 ; Note that Prescaler is cleared when RTCC is written
ENDM
|
The assembler does not understand LOAD_RTCC MACRO Mode, K,Prescale, and so do i. What does it mean? How could i use it under CCS compiler?
Thanks.
Sigma |
|
|
|