Uart1 doesn't work on Kinetis MKL25Z128VLK4

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

Uart1 doesn't work on Kinetis MKL25Z128VLK4

Jump to solution
890 Views
ingrubenvillafu
Contributor I

I have a problem with a Kinetis microcontroller KL25Z128VLK4 with mask  2N97F.

On CodeWarrior 10.3 and Processor Expert, I developed an application using USART1 on pin 58 ( PTC3/LLWU_P7/UART1_RX/TPM0_

CH2/CLKOUT ) . The microcontroller has a crystal 8MHz and the PLL as PEE ( with Processor Expert ) at 96MHz with CoreClock at 48MHz and BusClock at 24MHz

With this configuration clock, USART1 not correctly read the data sent by a device that sends characters to 9600bps 8O1 , I changed to 9600bps 8N1 but neither worked, changed to 19200 8N1 but neither worked. The ErrorCallback of  USART1 throws Framing, Noise and Parity Error.

This same configuration works properly on Freedom board FRDM-KL25Z.

Perform a test by changing the configuration of the CPU ( Processor Expert component ) to use the internal oscillator and setting the FLL as FEI at 20.97152Mhz, CoreClock at 20.97152MHz and BusClock at 20.97152MHz bus . With this configuration the USART1 successfully receives the data to any baudrate settings and any parity.

I return to the configuration of the PLL to 96MHz and changed USART (using the same component Extert Processor )
to USART0 on pin 51 ( PTB16/TSI0_CH9/SPI1_MOSI/UART0_RX/TPM_CLKIN0/SPI1_MISO ) and reading is correct for any configuration.

I want to know what the problem is , because if that is not possible a correct reading with USART1 I'll have to modify the PCB design to use the USART0 .
Labels (1)
0 Kudos
1 Solution
616 Views
BlackNight
NXP Employee
NXP Employee

I suggest you check the actual baud on the wires with a logic analyzer.

It could be that the clock distribution bits are not properly set.

See

Be Aware of the Baud Problem | MCU on Eclipse

View solution in original post

0 Kudos
4 Replies
616 Views
quevedo
Contributor V

Hello,

Sometimes there are bugs on PE components. I believe it happens because the component creators do not test all possible parameter combinations, which would be too difficult to do.

When I have doubts about a PE component, I create a function to initialize the peripheral with the parameters I want, and then basic functions for making tests. I write them in C, in a project without PE, so I have all definitions for the mnemonics of all registers.

For an UART, the functions should be easy to write. I think it is worth a try. Also, I believe that Erich's idea is worth a try.

Cheers,

Antonio

617 Views
BlackNight
NXP Employee
NXP Employee

I suggest you check the actual baud on the wires with a logic analyzer.

It could be that the clock distribution bits are not properly set.

See

Be Aware of the Baud Problem | MCU on Eclipse

0 Kudos
616 Views
ingrubenvillafu
Contributor I

Thank you Erich.

I configured the UART1 baudrate to 19200bps as you suggest and it works sucessful.

Now I'll download the CodeWarrior 10.5 as you and Robin_Shen suggest.

Thanks.

0 Kudos
616 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Ruben Dario Villafuerte Arroyo

I wonder if this is related to the a bug in CodeWarrior10.3 with PE.

The below information can be found in the Release_Notes of CodeWarrior10.4. It is in the folder like:    E:\Program Files\CW MCU v10.4\MCU\Release_Notes.pdf

ENGR00239108: Updated Processor Expert serial_LDD component for KL25Z128 to generate correct baud rate code for Uart1.

Hope that help

Best Regards

Robin