I am using the TRK-USB-MPC5643L UART (LINFlexD_0) via the USB virtual COM port.
It runs perfectly up to 500kbps[BRR=8]. However, when I speed it up past this (571429[BRR=7], 666667[BRR=6], or 800000[BRR=5]), I get garbage characters as though the bit rate is wrong.
This affects both Rx and Tx, and the bytes are wrong one-for-one and consistently (always the same wrong value), so it doesn't appear to be very far off.
I'm using putty at my host; over the years I've found putty quite reliable even when using unusual bit rates. I've certainly had no difficulties with bit rates up to 1Mbps.
Is it possible that I'm going too fast for the passthrough logic in the MC9S08? What is the maximum bit rate I can use in the VCP?
Solved! Go to Solution.
Hi,
Most probably the issue is that a baud rate is not set similarly on both the JM60 and MPC5643L.
On the JM60 the baud rate is set as SCI baud rate = BUSCLK/(16xBR)
Where BR = 1 to 8191. Assuming the bus clock is 24Mhz, then you can calculate baud rates the JM60 can be set to:
BR=1 … baudrate = 1 500 000, bit period = 0.666 us
BR=2 … baudrate = 750 000, bit period = 1.333 us
BR=3 … baudrate = 500 000, bit period = 2 us
BR=4 … baudrate = 375 000, bit period = 2.666us
etc..
If you set the LINIBRR and LINFBRR registers of the MPC5643L's LINFlex module in the way you get a baud rate as close as possible to above values, then you should be able to communicate properly.
See chapter 30.12.3 Fractional baud rate generation of the MPC5643L RM to know how LINIBRR and LINFBRR values are calculated.
BR, Petr.
Hi,
Most probably the issue is that a baud rate is not set similarly on both the JM60 and MPC5643L.
On the JM60 the baud rate is set as SCI baud rate = BUSCLK/(16xBR)
Where BR = 1 to 8191. Assuming the bus clock is 24Mhz, then you can calculate baud rates the JM60 can be set to:
BR=1 … baudrate = 1 500 000, bit period = 0.666 us
BR=2 … baudrate = 750 000, bit period = 1.333 us
BR=3 … baudrate = 500 000, bit period = 2 us
BR=4 … baudrate = 375 000, bit period = 2.666us
etc..
If you set the LINIBRR and LINFBRR registers of the MPC5643L's LINFlex module in the way you get a baud rate as close as possible to above values, then you should be able to communicate properly.
See chapter 30.12.3 Fractional baud rate generation of the MPC5643L RM to know how LINIBRR and LINFBRR values are calculated.
BR, Petr.
750kbps works great.
Thanks. (I wouldn't have guessed.)