PWM stops while debug session is paused

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

PWM stops while debug session is paused

1,182 Views
williamely
Contributor IV

I would like to know if there is a way to keep timers running while I have a debug session paused. Microchip has an option in their build configuration that would let you do this so you could debug without frying components. Does CW 10.5 have a similar option?

Also is there a way to ensure the PWM pins are in a certain state when reprogramming?

Details:

K60F @ 150MHz

CW 10.5

MQX 4.0.2

PE Micro Multilink FX

Labels (1)
Tags (2)
0 Kudos
4 Replies

763 Views
chris_brown
NXP Employee
NXP Employee

William,

Mark is somewhat correct.  The PIT can continue running or stop in debug mode depending on the setting of the FRZ bit in the MCR register. 

The FTM does also have a bit field in the CONF register that controls the operation of the counter and the FTM channel outputs.  These behaviors are set by the BDM Mode bit field and are described in the BDM Mode section of the Flex Timer chapter.  In the K60P144M150SF3 reference manual, the BDM mode descriptions are in chapter 42.4.26. 

Thanks,

Chris

763 Views
mjbcswitzerland
Specialist V

Chris

Thanks for the correction concerning the FTM - I didn't know about the BDMMODE bits. It looks like the default would in fact be to stop the counter (so my memory is probably also bad). I found that by searching for "debug mode" in the user's manual most such control bits are found that affect the operation in "debug" (eg PIT, LPTMR) but in the case of the FTM it is called "BDM mode" and so there is no 'hit' searching like that.

Regards

Mark

0 Kudos

763 Views
chris_brown
NXP Employee
NXP Employee

Mark,

Any time.  Glad I could help. 

I understand your frustration on the naming in the chapter. The problem is that it's a legacy module, and in the documentation that is associated with it, the debug port was the BDM module.  We do define BDM as "debug halt mode" in chapter 3.8.2.10.  When working with any of the peripherals, it's always good to look for that peripheral in chapter 3.  Sometimes they take the same IP and adapt it to a different platform.  In doing so, they sometimes have to remove or modify features of the module, and these changes will be documented in chapter 3. 

Best regards,

Chris

0 Kudos

763 Views
mjbcswitzerland
Specialist V

Hi

Some timers have an option as to whether they continue to run in debug mode or not. For example this can be configured in the PIT_MCR register for the PITs but there is no such control for the FTM, which you are probably using in PWM mode. As far as I remember (99% sure) the PWMs do continue running with the debugger in a breakpoint with the PWM setting maintained so maybe there is a different problem if they stop.

When programming the chip with the debugger the ports are in default states and all peripherals reset. The sate can only be defined by external pull-up/down resistors unless you modify the debugger's connection script file to write some states to peripheral registers - assuming that the programming operation doesn't reset the epripherals (chip) as part of the programming.

Regards

Mark