serial port output/input of DEMO9S08DZ60

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

serial port output/input of DEMO9S08DZ60

1,217件の閲覧回数
zsdleo
Contributor I

Hi,

I'm coding with the serial port output and input of DEMO9S08DZ60. There is such problem: the output and input is messy code. For example, when in code I want to print a char of 'a', the output of serial port is 0xf8 with ASCII. And the input is with same problem.

Does anybody can tell me what's wrong it is? Is there any problem with configuration or others?

 

Thanks in advance!

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

1,020件の閲覧回数
bigmac
Specialist III

Hello, and welcome to the forum.

 

It would seem that you may not have a sufficiently accurate baud rate.  If you are using the internal reference, i.e. FEI mode, to generate the bus frequency, this will need to be trimmed to a specific frequency.

 

The required baud rate divisor setting is given by -

 

BR_divisor = fbus / 16 / baud_rate

 

Some bus frequencies will give more accuracy than others, especially for a high baud rate in conjunction with a low bus frequency.

 

Regards,

Mac

 

0 件の賞賛
返信

1,020件の閲覧回数
zsdleo
Contributor I

Hi, Mac,

 

Thank you for your reply!

 

Here is my configuration of baud rate: fbus is 8MHz, and BR_divisor is 10. Then the baud rate should be 50000. Isn't it?

So I think it is OK.

 

Do you know other possible root cause?

 

BR.

Leo

0 件の賞賛
返信

1,020件の閲覧回数
bigmac
Specialist III

Hello Leo,

 

Assuming that you are using FEI mode to generate the bus frequency, a frequency of 8.000 MHz will require that the internal reference be accurately trimmed for a frequency of 31.25 kHz.  This is achieved by a calibration process, during programming of the device, to store the appropriate trim value at a specific flash memory location.  Your initialisation code then needs to transfer this value to the trim register.

 

If you do not trim the internal reference, the bus frequency will be subject  to substantial unit-to-unit variation, much too wide for SCI operation.

 

Regards,

Mac

 

0 件の賞賛
返信