MKE02 Master SPI TX Interrupt Error

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

MKE02 Master SPI TX Interrupt Error

1,637 次查看
PabloA
Contributor II

Hi there, please I need some help with this issue, I have trying to develop a simple control of several seven segments led displays using a shift register and the SPI module of a MKE02Z64 microcontroller.

As I thought it, I use the Process Expert functions of Syncro Master like this:

1.     With a fixed timer I call the function SendChar() to send one character when the display is off.

2.     To power on the display with the right data I use the interrupt OnTXChar() in order to set on the display leds when the data have been shifted.

Simple, but my problem is in the OnTXChar() interrupt, it is triggered when the second bit is sended. ¿Why?

I have been trying also with the function OnFreeTxBuf() and sending data as a block of 1 byte using SenBlock() with the same result, both interrupts are triggered before complete the 8 bit word.

¿What i'm doing wrong?

Regards, and sorry about my english...

标签 (1)
0 项奖励
回复
3 回复数

1,319 次查看
michaeltoaldo
Contributor I

Hi Guys, i am found the same issue in my project using FRDM MKE02Z. I am using a step motor control module that communicates with SPI bus. Between the commands i need to toggle the CS and this is performed manually. But after some problems i plugged a logic analyzer to verify and saw that interrupt "OnTxChar" is triggered before the char is totally finalized.  

Image attached shows 2 commands, i toggle one auxiliar pin at "OnTxChar" to verify what time this occurs (channel 6). 

void SPI_SM_OnTxChar(void)
{
/* Write your code here ... */
CS_SPI_SetVal();
CS_SPI_ClrVal();
}

Is there a way, with interrupts or pooling mode, to trigger the final of char transmit? 

Thank in advance guys

0 项奖励
回复

1,446 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello ,

How do you know SPI send one bit then run to interrupt function ?

Through oscilloscope or logic analyzer  ? If yes,  could you please show the result ?

BR

Alice

0 项奖励
回复

1,446 次查看
PabloA
Contributor II

Hi, Alice, thank you for your reply, I know it because I'm using breakpoints in the debugger and my function in there doesn't work.

Right now I will try using the Logical Device Driver directly.

Regards.

0 项奖励
回复