MC9S08QG8 baudrate problem.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S08QG8 baudrate problem.

3,342 Views
ta121976
Contributor I
Hi,
I'm using the internal cristal of the MC9S08QG8 to send data to a GPRS module. With the baudrate 4800 i don't have any problem, but the communications is not correct between my print and the GPRS module when i change the baudrate 9600.
What's the right configuration of the internal clock and the serial port to commincate with the baudrate 9600.
Thank you for your fast reaction.  
Labels (1)
0 Kudos
6 Replies

450 Views
joerg
Contributor II
Hi ta121976
for my opinion; this sounds like a baud rate tolerance problem caused by the internal clock. IF you do not trim the internal clock, the 4800 baud my work, but with the higher speeds you can be out of the frame. Simply test the baud rate with a oscilloscope IE by creating a endless loop sending always 0x55. The ON (or OFF) time should be 1/4800= 208us or 104us for 9600 baud.

Saluti Joerg
0 Kudos

450 Views
ta121976
Contributor I
Hi,
Thank you for your last reaction.
I tryed your methode, i don't have any problem when i transmit data to the serial port (at baudrate 9600), but receiving it doesn't work. I get a wrong bytes.
In the attachment can you find my sources.
NB: I 'm using the USB multilink Interface.
0 Kudos

450 Views
bigmac
Specialist III
Hello,
 
It's a bit of a worry when the PE bean you have used specifies the baud rate as 10,667 bits per second.  If this is the actual baud rate generated, it represents an error of +11.6 percent, an unacceptable figure.  Apparently this is for a baud rate divisor of 36.  I have not done the calculation myself, but if these figures are true, the baud rate divisor should have a value more like 40 to give 9600 baud.
 
Regards,
Mac
 
0 Kudos

450 Views
ta121976
Contributor I
I've tried everything. My application works without any problem with baudrate 4800, but i have to connect an other HW (which sends data with baudrate 9600) to my application.
If you have a board with a MC9S08QG8, try (if you want) to make a simple code (9600) which can receive bytes in an array, if it works i want to see your configuration.
I can do everything with my processor except receiving (transmit is no problem) bytes with the baudrate 9600! i don't know why??
 
0 Kudos

450 Views
peg
Senior Contributor IV
Hi,
 
A search of this forum using QG8 and baud reveals many threads on this. If they speak of different standard rates its only a matter of changing the divisor by x2 or /2 etc.
 
 
0 Kudos

450 Views
yb
Contributor IV
Hi,
If you use P&E Multilink BDM, you have to add after your ICSC1 & ICSC2 init :
 
 ICSTRM = *(unsigned char*)0xFFAF ;
 ICSSC = *(unsigned char*)0xFFAE ;
 
Regards,
 
0 Kudos