M9S08QG8  SCI problems

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

M9S08QG8  SCI problems

2,370 次查看
Brodek
Contributor II
Good day to everybody,
I'm new in this forum and I'm here because I've some problem with the SCI of an HC(S)08 microcontroller: the M9S08QG8 mounted on the demo board DEMO9S08QG8.

I'm using the codewarrior 5.9.0.

My problems, for the time being, are these:

1) When i set the baud rate at 19200, obtained with an internal frequency of 32,4 KHz, a BUS freq. of 8,2944
and a value of 27 for SCIBDR the SCI work properly ( I'm using the printf function of stdio.h with my own TERMIO_PutChar ), but when I enable ODD parity ( on the terminal's screen) i don't recieve the correct message.

2) If I leave parity NONE and I try to set the baud rate to 115200 obtained with an internal frequency of 36 KHz, a BUS freq. of 9,216 and a value of 5 for SCIBDR the SCI doesn't work at all independently of the parity that I set.

You have any idea to solve these 2 problem with the SCI??

Thanks to all and I'm very sorry for my English. Forgive me please!! :smileywink:




Message Edited by Brodek on 2008-02-27 02:08 PM
标签 (1)
0 项奖励
回复
3 回复数

615 次查看
Brodek
Contributor II
Hi,
first of all thank you for the reply.

Now, at 19200 baud  the SCI work fine. Also the printf function work properly and I'm able to write all that I want. Up to 57600 baud the SCI work and I can receive the messages with terminal software on my PC.

But when i set the baud at 115200, I mus to go at this speed, I receive a sequence of nonsensical characters. To reach the 115200 baud I've set reference closk at 36.0KHz and bus at 9.216 Mhz and these are the only modification that I had made to the micro's firmware.

Below I enclose my firmware. 

Regards,
         Walter





Message Edited by Brodek on 2008-02-28 01:31 PM

 

Project_25.zip

Message Edited by t.dowe on 2009-10-27 12:25 PM
0 项奖励
回复

615 次查看
Ake
Contributor II
Hi,
In my message yesterday, I forgot to say that if you change the fOP from 4 MHz to 8.2944 MHz, you should change the 27 for SCIBDR to 8.2944/4 * 27 = 55.98 => 56 to adjust for the increase in bus frequency.
 
Regards,
Ake
0 项奖励
回复

615 次查看
Ake
Contributor II
Hi,
Here is the code that you can use to get the baudrate correct.
The source directory includes an oscilloscope picture where the top trace is the TxD output on the 9S08QG8 and the bottom trace is an wobbling of an I/O which gives an indication on how fast the CPU is running.
 
I did not have the speed calibrated, so I guess that is why the baudrate was not too exact.
 
Regards,
Ake
 
 
Message Edited by t.dowe on 2009-10-27 12:45 PM
0 项奖励
回复