Using S08QD4 BDM Pin as TPM2 Output Compare Function

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Using S08QD4 BDM Pin as TPM2 Output Compare Function

跳至解决方案
804 次查看
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

标签 (1)
0 项奖励
回复
1 解答
571 次查看
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 项奖励
回复
2 回复数
572 次查看
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 项奖励
回复
571 次查看
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 项奖励
回复