KL25 Timer interrupt never triggers

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

KL25 Timer interrupt never triggers

1,830件の閲覧回数
robertk
Contributor I

Hi,

 

I'm trying to setup an FRDM-KL25Z development board such that every x seconds it reads 14 analog voltages, packets them up and sends them via the UART to another device. However I am having a really confusing problem.

 

I have set up a CodeWarrior project with Processor Expert with components for: Timer0, ADC0,  and UART0. It is set up so that the timer triggers an interrupt that then reads the 14 ADC channels, once it's done that it packets them up and send the data by UART. For debugging purposes I've also put little "start" and "end" UART messages at the very start and end of the interrupt response function to show it is actually entering the function. I never get "start" on my terminal display.

 

I have also put "Got Here" in my main function to show that the code does run and this does actually get printed to the terminal.

 

I'd really like to know what is going on here and why the code is not working. I've attached my code to help.

 

Thanks in advance.

 

Robert.

Original Attachment has been moved to: Interrupt-Driven-ADC.zip

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,364件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Hi Robert,

I didn't found any code about timer trigger and reads 14 ADC channels in your project.

So I've like to suggest that you'd better to check the demo code you uploaded is right one.

I'm looking forward to your reply!

Have a nice day!

Best regards,

Ping

0 件の賞賛
返信

1,364件の閲覧回数
robertk
Contributor I

Hi,

Did you check in:

“...\Interrupt Driven ADC\Sources\” ?

I’ve edited 2 files in that folder:

ProcessorExpert.c, lines 59 to 65.

Events.c, lines 103 to 137 and lines 142 to 312

I thought these were the right place to put code, however if it is not then I’m really in need of some guidance!

Regards,

Robert K.

0 件の賞賛
返信

1,364件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Robert,

I've tested your demo code since yesterday. I corrected a few mistake and the interrupt could be triggered now.

Unfortunately it's not completely right, I could receive the message "start", however I couldn't recevie the the message "end".

I'm still confused about it now. So I've like to suggest it's ok that I offer you a demo code which could implement the same function without use LDD since I'm also not familar with LLD .

If your answer is ok, then let's us get over this problem by a new demo code.

I'm looking forwarding to your reply.

Best regards,

Ping

0 件の賞賛
返信

1,364件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Robert,

I have had a brief look through your question, I didn't realize the problem before I test your code.

So be patient and I'll reply as soon as possible after I figure out the problem.

Have a nice day!

Best regards,

Ping

0 件の賞賛
返信