View previous topic :: View next topic |
Author |
Message |
golf Guest
|
baudrate of PIC12F675 RS232 generated routines |
Posted: Tue Mar 25, 2008 7:15 am |
|
|
I have been looking the .LST generated code of the following test program:
#include <12f675.h>
#use delay(clock=4MHz)
#fuses INTRC_IO, NOWDT, NOMCLR, PUT, BROWNOUT
#use rs232(baud=4800, xmit=PIN_A0, rcv=PIN_A1, force_sw)
void main() {
printf("Hello World \n\r");
while(1);
}
It doesn't matter if i change the baud to 9600 or to any other value,
the generated code is the same.
Is maybe a bug (my compiler version is PCWHD 4,057)
I'm wondering about... where are the delays done?
I don't even tried to program it in the pic |
|
|
Matro Guest
|
|
Posted: Tue Mar 25, 2008 7:32 am |
|
|
The ASM lines under the #use rs232 will be the same ones because they correspond to the "printf()" function.
The initialization of baudrate is done at the beginning of the "main()" function.
And there you should be able to see a change. ;-)
Matro. |
|
|
Matro Guest
|
|
Posted: Tue Mar 25, 2008 7:37 am |
|
|
If I compile your posted code once with 9600 baudrate and once with 4800 baudrate, ASM lines 0035 and 0039 are different in both versions.
Matro. |
|
|
golf Guest
|
clearly seen |
Posted: Tue Mar 25, 2008 7:57 am |
|
|
thanks, i didn't noticed this change...
maybe i forgot to save?
I see clearly that line 34 is the initialization of a countdown
there they change the baudrate
line 39 is only a one cycle more lost (difference between 'JMP next' and NOP)
subject closed...
i resemble a newbie...
well thanks anyhow |
|
|
|