MQX3.8 with K53n512, Reading Low Power Timer causes unhandled interrupt?

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

MQX3.8 with K53n512, Reading Low Power Timer causes unhandled interrupt?

531 Views
Jeronimo479
Contributor II

I'm trying to do some very simple timing and wanted to use the low power timer as my source instead of the clunky MQX seconds & milliseconds timer.

 

I wanted to read the low power timer register and save that in uint16_t start. Then later read it again and store that in uint16_t stop.The following snippet shows how I get an unhandled interrupt when I step to "tmp=p->CNR;"

 

    LPTMR_MemMapPtr    p = LPTMR0_BASE_PTR;
    uint16_t        tmr = p->CNR;

 

It did not behave this way in MQX 3.7. Does this have anything to do with protected mode vs. User mode.

In "mqx_cnfg.h" I found "#define MQX_ENABLE_USER_MODE 0" (that is the default), so I didn't think this was the problem. 

0 Kudos
1 Reply

283 Views
c0170
Senior Contributor III

Hello Jeronimo479,

 

I would firstly check if you have enabled clock for that peripheral : SIM_SCGC5 for LPTIMER . That could cause unhandled interrupt.

 

Regards,

MartinK