How to Configure 57600Baud Uart with Processor Expert

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

How to Configure 57600Baud Uart with Processor Expert

7,419 次查看
ranemyr
Contributor I
Hi
 
I need to set Uart speed to 57000 in a HCS08 project based on Processor Expert.
When i try i get the error message
 
"Timing settings failed in high speed mode - it is impossible to set the following items: initialization value"
 
I tried with internal osc, ext osc with varius bus freq but with same luck.
 
Is it possible at all?
/Peter
标签 (1)
0 项奖励
回复
5 回复数

1,597 次查看
ProcessorExpert
Senior Contributor III

Hi,

It isn't a bug in Processor Expert. It isn't available to set requested baud
rate directly from selected internal oscillator frequency in Bean Inspector. The nearest value for 31.25kHz is 55555 baud. Using Timing dialog it is possible to set 57600 baud only if allowed error increased (e.g. set Error allowed to value 5%).

Two solutions how to configure it better exist:
1. External crystal 32kHz can be used. The result is 58524 baud.
2. By trimming (see application note AN2496) to modify internal oscillator value to 32.4kHz that is more suitable for generating baud rate 57600. The result is 57600 baud directly

Best Regards,
Processor Expert Support

0 项奖励
回复

1,597 次查看
ranemyr
Contributor I

The plan is to use the MC9S08QG8 with preferable the internal osc.
Reason for 57600Baud is that i shall interface an Bluetooth module
from ConnectBlue and this i the default speed for this device.

I might use the 9S08GT32 since i used this previously but i would like
to use the new QG device since its low pincount.

/Peter

0 项奖励
回复

1,597 次查看
Wings
Contributor I
Peter,

I plan to use a QG8 at 57.6Kb myself, and although I'm not using Processor Expert, this is what I plan to do. Run the internal clock at 36.00KHz, giving an FLL of 18.432MHz and a BusClk of 9.216MHz. The SCI will use the BusClk /10 (or, /160 after the fixed /16). This hits 57.6Kbaud right on the money, plus/minus the oscillator stability.

If you have an accurate low frequency clock source in your system you can use that to trim the internal oscillator continuously. I happen to have a highly accurate source of 135.41667KHz in my application, and although this frequency is totally unrelated to my desired baud rate, I can still use it to trim the internal oscillator so that my baud rate stays on dead center.

The 135KHz is used as an RTI clock (divided by 2048) to provide an RTI every 15.123692mS. At every RTI the timer value is saved. (timer clk is BUSCLK /4 = 2.304MHz = 434nS period) The following RTI the timer is read again, and the elapsed count should be 35009 counts. Deviation above or below this value indicates the TRIM bits of the Internal Osc need adjusting. This trimming can be done continuously, every RTI. You can use a 32KHz crystal for the external reference source if you can spare another pin. (I've yet to find a readily available low frequency crystal that, when multiplied & divided on its way to the SCI clock, will yield 57.6Kb directly.)

This probably doesn't help you with Processor Expect troubles, but maybe it helps in some other way.

-Richard
0 项奖励
回复

1,597 次查看
peg
Senior Contributor IV

Hi Peter,

My original comments still apply for the QG.

The ICG is different though.

What Buss clock rate are you using?

You may have selected a rate which divides poorly to 57600 baud.

BR Peg

0 项奖励
回复

1,597 次查看
peg
Senior Contributor IV

Hi Peter,

At a hardware level it is possible.

e.g. at highest ICG clock of 19.9954MHz on a GB/GT you can divide it by 21 and get 59510 baud (1% high) or 22 and get 56805 (1% low).

If you use the ICG you may be able to fiddle the busclk to provide greater accuracy.

Perhaps Processor Expert is baulking at the errors

At these higher baudrates you run out of resolution with the divider.

1% error should not cause any problems

What device are you using?

Regards Peg

 

0 项奖励
回复