Using Uart with Kinetis KE02 without processor expert

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

Using Uart with Kinetis KE02 without processor expert

Jump to solution
531 Views
Ofgallo96
Contributor I

Hey guys, i'm trying to use uart peripheral with mke02z32vlc4, with processor isn't hard but for my application i need optimize the size code because i have many other modules.

The solution was try make all project with manual register write, but, when i put some value in any config register peripheral the program enter in a loop to irq default handler, in the debug is something like:

-> write register ----> defalut irq handler ---|

     ^--------------------------------------------------|

This occurs with other peripherals too, SPI, ADC, ... the line that crash the program is:

UART1_SC2 = 0x0C; //write config to enable uart

And the entire code is:

I think that is a problem with the interrupt configs in kinetis, but i don't have many experience with this, so please, if anybody can help me I will appreciate it.

 

 

 

 

 

 

0 Kudos
1 Solution
501 Views
Ofgallo96
Contributor I

Hey everyone, i'm fixed the problem, so i'm going to share the solution only if someone else need it.

Basically i forgot enable the clock source for the peripheral, so, setting the right bit in the register SIM_SCGC the peripheral works, for UART0 you can use a mask included in the header for ke02z:

SIM_SCGC |= SIM_SCGC_UART0_MASK;

View solution in original post

0 Kudos
1 Reply
502 Views
Ofgallo96
Contributor I

Hey everyone, i'm fixed the problem, so i'm going to share the solution only if someone else need it.

Basically i forgot enable the clock source for the peripheral, so, setting the right bit in the register SIM_SCGC the peripheral works, for UART0 you can use a mask included in the header for ke02z:

SIM_SCGC |= SIM_SCGC_UART0_MASK;

0 Kudos