MPC5746C Mode Entry Help

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MPC5746C Mode Entry Help

ソリューションへジャンプ
2,841件の閲覧回数
pstammii
Contributor II

Greetings!

I am trying to follow the steps in the TRM to properly initialize my controller with the Mode Entry module. I have some Mode Entry module code written in main.c that I believe closely resembles the instructions from the manual, but when my program tries to execute the second write to the MC_ME_MCTL register, it just hangs. Also, according to the MC_ME_GS register, the controller appears to start a mode transition but it never completes. 

Can you please take a look at my project (attached) and help me identify what the problem is?

My end goal is to get the ADC1 module operational: configure the ADC registers and then read from the ADC. You will notice that I haven't enabled any clocks for other peripherals, and that is the reason.

Thank you for your time!

Paul

0 件の賞賛
返信
1 解決策
2,820件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

but when my program tries to execute the second write to the MC_ME_MCTL register, it just hangs.

not sure what prevents you from transition, there could be following reasons:

1. You have incorrectly configured clocks

2. you have peripherals which clock is still active. For example CAN module, PWM module, etc.. is still running from clock source which will be changed in target mode.

I suggest to have a look at very basic examples either community ones or S32DS ones:

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5746C

Best regards,

Peter

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,781件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

there is a clock configuration guide:

https://www.nxp.com/products/processors-and-microcontrollers/power-architecture/mpc5xxx-microcontrol...

petervlna_0-1719212957021.png

Such will ease your work with clocks and their configuration.

https://www.nxp.com/docs/en/application-note/AN5392.pdf

best regards,

Peter

 

0 件の賞賛
返信
2,777件の閲覧回数
pstammii
Contributor II

Thanks Peter.

The issue was incorrectly configured clocks, as you suggested. Once I got that right I ended up just using the clock_manager inside Processor Expert to configure everything and initialized by calling the two functions below, which I learned about through some of the examples in the S32 SDK (the functions are in clock_MPC57xx.c). Just using the CLOCK_DRV_Init processor expert function was not enough.

pstammii_0-1719253389991.png

 

0 件の賞賛
返信
2,821件の閲覧回数
petervlna
NXP TechSupport
NXP TechSupport

Hello,

but when my program tries to execute the second write to the MC_ME_MCTL register, it just hangs.

not sure what prevents you from transition, there could be following reasons:

1. You have incorrectly configured clocks

2. you have peripherals which clock is still active. For example CAN module, PWM module, etc.. is still running from clock source which will be changed in target mode.

I suggest to have a look at very basic examples either community ones or S32DS ones:

https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5-software-example-list/ta-p/1102445#MPC5746C

Best regards,

Peter

0 件の賞賛
返信
2,815件の閲覧回数
pstammii
Contributor II

@petervlna  Thanks for your reply.

I am looking at example MPC5746C PIT ISR GHS614 and trying to mimic Mode Entry steps from that. I am still having same issue but I will keep trying.

Question: Can I alternatively use the clock_manager component inside Processor Expert to do the Mode Entry work for me? Will it work standalone or do I still need supplement the clock_manager component with code to get everything working just right?

Paul

0 件の賞賛
返信
%3CLINGO-SUB%20id%3D%22lingo-sub-1891669%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMPC5746C%E3%83%A2%E3%83%BC%E3%83%89%E5%85%A5%E5%8A%9B%E3%83%98%E3%83%AB%E3%83%97%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1891669%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E3%81%82%E3%81%84%E3%81%95%E3%81%A4%EF%BC%81%3C%2FP%3E%3CP%3ETRM%E3%81%AE%E6%89%8B%E9%A0%86%E3%81%AB%E5%BE%93%E3%81%A3%E3%81%A6%E3%80%81%E3%83%A2%E3%83%BC%E3%83%89%E3%82%A8%E3%83%B3%E3%83%88%E3%83%AA%E3%83%BC%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%81%A7%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC%E3%82%92%E9%81%A9%E5%88%87%E3%81%AB%E5%88%9D%E6%9C%9F%E5%8C%96%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82main.c%E3%81%AB%E6%9B%B8%E3%81%8B%E3%82%8C%E3%81%9F%E3%83%A2%E3%83%BC%E3%83%89%E3%82%A8%E3%83%B3%E3%83%88%E3%83%AA%E3%83%BC%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%B3%E3%83%BC%E3%83%89%E3%81%8C%E3%81%84%E3%81%8F%E3%81%A4%E3%81%8B%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E3%81%93%E3%82%8C%E3%81%AF%E3%83%9E%E3%83%8B%E3%83%A5%E3%82%A2%E3%83%AB%E3%81%AE%E6%8C%87%E7%A4%BA%E3%81%AB%E3%82%88%E3%81%8F%E4%BC%BC%E3%81%A6%E3%81%84%E3%82%8B%E3%81%A8%E6%80%9D%E3%81%84%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%8CMC_ME_MCTL%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%81%B8%E3%81%AE2%E5%9B%9E%E7%9B%AE%E3%81%AE%E6%9B%B8%E3%81%8D%E8%BE%BC%E3%81%BF%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%99%E3%82%8B%E3%81%A8%E3%80%81%E3%83%8F%E3%83%B3%E3%82%B0%E3%81%99%E3%82%8B%E3%81%A0%E3%81%91%E3%81%A7%E3%81%99%E3%80%82%E3%81%BE%E3%81%9F%E3%80%81MC_ME_GS%20%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%81%AB%E3%82%88%E3%82%8B%E3%81%A8%E3%80%81%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC%E3%81%AF%E3%83%A2%E3%83%BC%E3%83%89%E9%81%B7%E7%A7%BB%E3%82%92%E9%96%8B%E5%A7%8B%E3%81%97%E3%81%9F%E3%82%88%E3%81%86%E3%81%AB%E8%A6%8B%E3%81%88%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E5%AE%8C%E4%BA%86%E3%81%99%E3%82%8B%E3%81%93%E3%81%A8%E3%81%AF%E3%81%82%E3%82%8A%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%3C%2FP%3E%3CP%3E%E7%A7%81%E3%81%AE%E3%83%97%E3%83%AD%E3%82%B8%E3%82%A7%E3%82%AF%E3%83%88(%E6%B7%BB%E4%BB%98)%E3%82%92%E8%A6%8B%E3%81%A6%E3%80%81%E5%95%8F%E9%A1%8C%E3%81%8C%E4%BD%95%E3%81%A7%E3%81%82%E3%82%8B%E3%81%8B%E3%82%92%E7%89%B9%E5%AE%9A%E3%81%99%E3%82%8B%E3%81%AE%E3%82%92%E6%89%8B%E4%BC%9D%E3%81%A3%E3%81%A6%E3%82%82%E3%82%89%E3%81%88%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FP%3E%3CP%3E%E7%A7%81%E3%81%AE%E6%9C%80%E7%B5%82%E7%9B%AE%E6%A8%99%E3%81%AF%E3%80%81ADC1%E3%83%A2%E3%82%B8%E3%83%A5%E3%83%BC%E3%83%AB%E3%82%92%E5%8B%95%E4%BD%9C%E3%81%95%E3%81%9B%E3%82%8B%E3%81%93%E3%81%A8%E3%81%A7%E3%81%99%E3%80%82ADC%E3%83%AC%E3%82%B8%E3%82%B9%E3%82%BF%E3%82%92%E6%A7%8B%E6%88%90%E3%81%97%E3%81%A6%E3%81%8B%E3%82%89%E3%80%81ADC%E3%81%8B%E3%82%89%E8%AA%AD%E3%81%BF%E5%87%BA%E3%81%97%E3%81%BE%E3%81%99%E3%80%82%E4%BB%96%E3%81%AE%E5%91%A8%E8%BE%BA%E6%A9%9F%E5%99%A8%E3%81%AE%E3%82%AF%E3%83%AD%E3%83%83%E3%82%AF%E3%82%92%E6%9C%89%E5%8A%B9%E3%81%AB%E3%81%97%E3%81%A6%E3%81%84%E3%81%AA%E3%81%84%E3%81%93%E3%81%A8%E3%81%AB%E6%B0%97%E4%BB%98%E3%81%8F%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%81%8C%E3%80%81%E3%81%9D%E3%82%8C%E3%81%8C%E7%90%86%E7%94%B1%E3%81%A7%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%81%8A%E6%99%82%E9%96%93%E3%82%92%E3%81%84%E3%81%9F%E3%81%A0%E3%81%8D%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%97%E3%81%9F!%3C%2FP%3E%3CP%3E%E3%83%9D%E3%83%BC%E3%83%AB%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1892276%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3AMPC5746C%E3%83%A2%E3%83%BC%E3%83%89%E3%82%A8%E3%83%B3%E3%83%88%E3%83%AA%E3%83%98%E3%83%AB%E3%83%97%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1892276%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F13836%22%20target%3D%22_blank%22%3E%40petervlna%3C%2FA%3E%20%E3%81%8A%E8%BF%94%E4%BA%8B%E3%81%82%E3%82%8A%E3%81%8C%E3%81%A8%E3%81%86%E3%81%94%E3%81%96%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Fdocs%2FDOC-334669%22%20target%3D%22_blank%22%3EPIT%20ISR%20GHS614%3C%2FA%3E%E3%81%AE%E4%BE%8B%E3%82%92%E8%A6%8B%E3%81%A6MPC5746C%E3%81%9D%E3%81%93%E3%81%8B%E3%82%89%E3%83%A2%E3%83%BC%E3%83%89%E3%82%A8%E3%83%B3%E3%83%88%E3%83%AA%E3%83%BC%E3%81%AE%E6%89%8B%E9%A0%86%E3%82%92%E6%A8%A1%E5%80%A3%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E7%A7%81%E3%81%AF%E3%81%BE%E3%81%A0%E5%90%8C%E3%81%98%E5%95%8F%E9%A1%8C%E3%82%92%E6%8A%B1%E3%81%88%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E7%A7%81%E3%81%AF%E8%A9%A6%E3%81%BF%E7%B6%9A%E3%81%91%E3%81%BE%E3%81%99%E3%80%82%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%E8%B3%AA%E5%95%8F%3A%20Processor%20Expert%20%E5%86%85%E3%81%AE%20clock_manager%20%E3%82%B3%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%80%81%E3%83%A2%E3%83%BC%E3%83%89%E5%85%A5%E5%8A%9B%E3%81%AE%E4%BD%9C%E6%A5%AD%E3%82%92%E8%A1%8C%E3%81%86%E3%81%93%E3%81%A8%E3%81%AF%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%81%8B%3F%E3%81%9D%E3%82%8C%E3%81%AF%E3%82%B9%E3%82%BF%E3%83%B3%E3%83%89%E3%82%A2%E3%83%AD%E3%83%B3%E3%81%A7%E5%8B%95%E4%BD%9C%E3%81%97%E3%81%BE%E3%81%99%E3%81%8B%E3%80%81%E3%81%9D%E3%82%8C%E3%81%A8%E3%82%82%E3%81%99%E3%81%B9%E3%81%A6%E3%82%92%E6%AD%A3%E3%81%97%E3%81%8F%E6%A9%9F%E8%83%BD%E3%81%95%E3%81%9B%E3%82%8B%E3%81%9F%E3%82%81%E3%81%ABclock_manager%E3%82%B3%E3%83%B3%E3%83%9D%E3%83%BC%E3%83%8D%E3%83%B3%E3%83%88%E3%81%AB%E3%82%B3%E3%83%BC%E3%83%89%E3%82%92%E8%BF%BD%E5%8A%A0%E3%81%99%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%81%8B%3F%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23000000%22%3E%E3%83%9D%E3%83%BC%E3%83%AB%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E