|
|
View previous topic :: View next topic |
Author |
Message |
Guest
|
Wrong compiler function if not defining "xmit="? |
Posted: Sat Nov 29, 2008 3:54 am |
|
|
Wrong compiler function if not defining "xmit="?
Ex1. This will generate right code.
Code: | #use rs232(baud=9600,xmit=PIN_A5,rcv=PIN_A4) |
Ex2. This will generate _wrong_ code!
Code: | #use rs232(baud=9600,rcv=PIN_A4) |
If only using the "xmit" and _not_ the "rcw" there are no problem?
Compiler (PCH) V_4.074 |
|
|
Ttelmah Guest
|
|
Posted: Sat Nov 29, 2008 4:00 am |
|
|
This is completely normal.
_If_ you only select one pin, the compiler will assume you deliberately want to use a _software_ UART, and generate the code for this.
Do a search here. I have posted in the past, how to turn off half the UART, if you only want to use one hardware pin.
Best Wishes |
|
|
Guest
|
|
Posted: Sat Nov 29, 2008 8:21 am |
|
|
Hi
If looking at the generated code, i think it,s wrong!
Code: | #use rs232(baud=9600,rcv=PIN_A4) |
Code: | 0050: BSF STATUS.RP0
0051: BCF TRISIO.TRISIO0
0052: BCF STATUS.RP0
0053: BCF GPIO.GP0 <----This will clear GP0 and it's not defined???
0054: MOVLW 08
0055: MOVWF @21
0056: GOTO 057
........
|
But the workaround is define both pin and only use one, thanks. |
|
|
Ttelmah Guest
|
|
Posted: Sat Nov 29, 2008 8:46 am |
|
|
Problem is I see no suggestion that this is the generated code for the RS232 line...
You need to give us something to work on:
1) What processor.
2) A_minimum_ compilable program that shows the fault. Normally just the processor include, fuses, clock settings, RS232 declaration, and a couple of lines, showing some serial I/O, to show where this code is actually being generated.
You say the compiler is PCH, but the code shown, looks to be PCM code.
Best Wishes |
|
|
|
|
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
|