Using Uart with Kinetis KE02 without processor expert

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using Uart with Kinetis KE02 without processor expert

跳至解决方案
481 次查看
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 项奖励
1 解答
451 次查看
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 项奖励
1 回复
452 次查看
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 项奖励