KL05 and TimerInt: OnInterrupt not called.

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

KL05 and TimerInt: OnInterrupt not called.

Jump to solution
2,337 Views
Alberto_g
Contributor III

I'm not able to make a simple periodic interrupt work, using a custom board with a MKL05Z32VFM4 CPU . This is the 32 pin package, but in PEX I'm selecting the VLF4 48 pin version, the only option present. Is this allowed?

I start a new project then add an auto initialized and enabled TimerInt. I never get a call to the OnInterrupt function.

The main loop in ProcessorExpert.c is executed correctly.

Doing the same thing on a KL 25 Freedom Board works perfectly.

 

I attach a test program.

 

Regards.

 

Alberto

Original Attachment has been moved to: test05.zip

Labels (1)
1 Solution
1,730 Views
Alberto_g
Contributor III

After comparing the codes, it turns out that the problem is in the setting

Internal periferals -> Flash configuration field -> Peripheral settings -> NMI function.

When this bit is enabled, no interrupts are served.

This is the default settings provided by the project wizard and by the CPU bean. Not so friendly, I would say.

I have Internal peripheral -> NMI pin disabled.

View solution in original post

6 Replies
1,730 Views
Petr_H
NXP Employee
NXP Employee

Hi,

Regarding CPU selection - in CW 10.3 if you'd like to select another package, you need to add a new CPU component (as you can see on attached screenshot):

1) In component selector open the tab Processors

2) Select you CPU:  Kinetis L / MKL0x / KL05Z / MKL05Z32xxx4

3) In the dialog shown, select the package you need (e.g. 32-Pin QFN)

I have tried your project on TWR-K05Z48 with 48 pin version and it seems to work properly.

best regards

Petr Hradsky

Processor Expert Support Team

1,730 Views
Alberto_g
Contributor III

Thanks. I would make the package one of the properties of the CPU bean, and of course fix the project wizard which does not let the user choose the package.

0 Kudos
Reply
1,730 Views
Alberto_g
Contributor III

Same thing with a PWM component. No events are called. But the correct signal is generated on the output pin, so I guess the clock reaches the periferal.

Any idea?

An update: everything seems to be OK when the CPU component is copied from the ADC_TempSensor KL05  pex example. I will investigate.

0 Kudos
Reply
1,730 Views
Alberto_g
Contributor III

ConsoleIO transmits at half the specified baud rate. Maybe because the clock path shows the clock is sourced from the IRC at 4 MHz, but the core clock in the CPU component is set at 2 MHz. I'm using VLPM and BLPI.

0 Kudos
Reply
1,730 Views
Petr_H
NXP Employee
NXP Employee

Hi,

I recommend to check the clock settings in the CPU. Do you use external crystal/oscillator or just internal one?

Check the CPU peroperties Clock settings / System oscillator 0 and then Clock source settings / Clock source setting 0 / MCG settings/ MCG mode etc..

If the problem persists, please post a sample project with the problem.

best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos
Reply
1,731 Views
Alberto_g
Contributor III

After comparing the codes, it turns out that the problem is in the setting

Internal periferals -> Flash configuration field -> Peripheral settings -> NMI function.

When this bit is enabled, no interrupts are served.

This is the default settings provided by the project wizard and by the CPU bean. Not so friendly, I would say.

I have Internal peripheral -> NMI pin disabled.