S12XF maximum SCI baudrate?

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

S12XF maximum SCI baudrate?

944 Views
julianrenz
Contributor I

Hi there,

 

I'm currently developing a module with your S12XF MCU and am wondering what the maximum SCI Baudrate is.

The MC9S12XF512 Reference Manual states, that "SCI baud rate = SCI bus clock / (16 x SBR[12:0])" (page 1038). Assuming a 50MHz bus clock and a SBR value of 0x01, doest that mean, that I get, in fact 50MHz/16 = 3.125 Mbaud datarate?

 

I'm wondering beacause the maximum I saw in a S12XF sample code is 115200kbaud (Serial bootloader example).

 

 

I'm llking forward to hearing from you!

Many thanks in advance!

 

Best regards

Julian

Labels (1)
0 Kudos
7 Replies

692 Views
lama
NXP TechSupport
NXP TechSupport

Yes, you are right. The limitation is given by BUSCLK, required baudrate precision and R,L,C of the physical line to get correct communication.

115200kbaud in the bootloader was probably maximum tested baudrate for given board and UART interface.

Best regards,

Ladislav

692 Views
julianrenz
Contributor I

Thank you very much for the swift reply,

I will try to get between 500kbaud and 1Mbaud and will let you know my results (though it may take a week due to other projects)

Many Thanks!

Best regards

Julian

0 Kudos

692 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I am curious about the results because the serial cable has limitation given by electrical parameter and used RS232 or RS485. I think, for higher frequencies you will have to use short cable. Moreover, I am not sure how the R/L/C will affect rising falling edges to be data correctly read.

Could you please share your test if they are some. For example just limitation parameters.

Best regards,

Ladislav

0 Kudos

692 Views
julianrenz
Contributor I

I performed several tests and am very happy with the results.

First of all: The Setup

I use the S12XF Starterkit, which is powered by 5V internally and running from a 4MHz Crystal. The Bus Clock is set up to have 40MHz. The devboard exposes TXD, RXD and GND Pins to which I attached a 5V UART->USB adapter and connected it to a PC running Windows 8.1. There, a small C# application listens to any incoming bytes on the (virtual) COM port. The MCU Software generates a 75ms Real Time interrupt during which the data 0x68 0x65 0x6C 0x6C 0x6F (or "hello") is transmitted.

The tested datarates:

I successfully tested the follwing values for the SCI0BD register and received the desired string:

   SCI0BD = 0x0041;  // 65 -> 38.462 baud

   SCI0BD = 0x002B;  // 43 -> 58.140 baud

   SCI0BD = 0x0016;  // 22 -> 113.636 baud

   SCI0BD = 0x000B;  // 11 -> 227.273 baud

   SCI0BD = 0x0007;  // 7 -> 357.143 baud

   SCI0BD = 0x0005;  // 5 -> 500.000 baud

   SCI0BD = 0x0002;  // 2 -> 1.250.000 baud

Of course it is likely that any combinations in between will function too. A prescaler of 0x0001, which should result in a 2.5Mbps datarate (if I'm informed correctly) was NOT successfull. This setting didn't cause any "DataReceived" Interrupt of the used "SerialPort" class. Nevertheless, on an oscilloscope, the waveform doesn't look so bad (well, you decide, see attached screenshot), so it might as well be a flaw of .NET. EDIT: As of now, I suspect the UART-USB Adapter to be the limiting factor and not .NET.

scope_0.png

scope_1.png

Nevertheless I want to note the following: for the usual Terminal-Tools (like putty or hterm), the baudrate can not be set up to these exact values. While 38462, 58140 and 113636 are very close to the commonly used baudrates of 38400, 57600 and 115200, these tools may not be capable of receiving data with any of the higher, odd datarates. Thats the reason, I quickly put together a small windows application: I can choose whichever baudrate I prefer.

Best regards

Julian

0 Kudos

692 Views
lama
NXP TechSupport
NXP TechSupport

Hi, there is no problem with different baud rates if both devices have correct timing (error in specified reange) . However, I would like also to perform some tests. My question is whether you connect directly Rx/Tx pins or you use some RS232/RS485 interface to connect devices.

http://www.maximintegrated.com/en/app-notes/index.mvp/id/2141

Best regards, Ladislav.

0 Kudos

692 Views
julianrenz
Contributor I

Hi Ladislav,

I directly hooked up the TX/RX Pisn of the S12XF-Devboard to my UART <-> USB Adapter. So no external RS-232 transceiver was used.

Best regards,

Julian

0 Kudos

692 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I think the first test should be doe between two SCI peripherals at the same MCU to be sure it is working and to be able to find spot of the issue.

I have attached project I tested behavior and there is no issue between two nodes.

Connected PS2-PS1 and PS3-PS0.

The issue must be on external line.

Best regards,

Ladislav

0 Kudos