Using S08QD4 BDM Pin as TPM2 Output Compare Function

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

Using S08QD4 BDM Pin as TPM2 Output Compare Function

Jump to solution
805 Views
GaugeGuy
Contributor I

Hi all,

 

I have never done this, and do not see much information about using the BDM pin as a TPM2 Output Capture Function.

I see that the SOPT1 is a write once register. I am using the P&E BDM Interface to program the MCU. So my question is:

What is the proper sequence to disable the BDM pin and enable the TPM2 Ouput Compare?

 

My thought is that one running in code, I would disable the BDM Pin, but the SOPT1 Register has already been written to in the MCU_Init function. (Using CW Device Intializer)

 

If I disable the BDM pin initially, will I then not be able to reprogram the device?

 

Any assistance is appreciated!

 

Thanks,

David

Labels (1)
0 Kudos
Reply
1 Solution
572 Views
pgo
Senior Contributor V

David,

 

First question - I would suggest modifying the SOPT register value first in the startup code.  You may be able to delay this but the COP may also be an issue (I haven't checked the chip details).

 

Second question -

Disabling the the BDM pin will cause the debugger to lose connection to the target so debugging will obviously be unusable.

 

However,  this will happen after the programming stage so shouldn't be a problem if you are happy for a load&run style debugging.

 

The BDM interface can always regain a connection by resetting the target directly into Debug mode (holding BKGD low while doing a reset or if necessary a power-on-reset).

 

You may find that you are prompted to cycle the target power when initially connecting as some targets can only be forced into debug mode in this fashion if the BKGD pin is disabled.

 

bye

View solution in original post

0 Kudos
Reply
2 Replies
573 Views
pgo
Senior Contributor V

David,

 

First question - I would suggest modifying the SOPT register value first in the startup code.  You may be able to delay this but the COP may also be an issue (I haven't checked the chip details).

 

Second question -

Disabling the the BDM pin will cause the debugger to lose connection to the target so debugging will obviously be unusable.

 

However,  this will happen after the programming stage so shouldn't be a problem if you are happy for a load&run style debugging.

 

The BDM interface can always regain a connection by resetting the target directly into Debug mode (holding BKGD low while doing a reset or if necessary a power-on-reset).

 

You may find that you are prompted to cycle the target power when initially connecting as some targets can only be forced into debug mode in this fashion if the BKGD pin is disabled.

 

bye

0 Kudos
Reply
572 Views
GaugeGuy
Contributor I

Thanks pgo!

 

I have my new PCB with the S08QD4 and it works as you posted.

 

Now I am off to working with some PDP code using the TPM2 in OC mode.

I have some questions that I will post in a new thread.

 

Thanks,

David

0 Kudos
Reply