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 CCS Technical Support

baudrate of PIC12F675 RS232 generated routines

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







baudrate of PIC12F675 RS232 generated routines
PostPosted: Tue Mar 25, 2008 7:15 am     Reply with quote

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







PostPosted: Tue Mar 25, 2008 7:32 am     Reply with quote

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







PostPosted: Tue Mar 25, 2008 7:37 am     Reply with quote

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
PostPosted: Tue Mar 25, 2008 7:57 am     Reply with quote

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
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