Using Uart with Kinetis KE02 without processor expert

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using Uart with Kinetis KE02 without processor expert

ソリューションへジャンプ
609件の閲覧回数
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 解決策
579件の閲覧回数
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 返信
580件の閲覧回数
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 件の賞賛