Configure ADC Sampling from PDB

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

Configure ADC Sampling from PDB

ソリューションへジャンプ
3,165件の閲覧回数
ewilliams
Contributor I

Hello,

I'm trying to determine how to configure an ADC0 conversion trigger from the PDB peripheral in the Peripherals too. I'm attempting capture BLDC motor phase current based on PWM edges, and it's my understanding that this is possible, however I don't see this option in the ADC16 Configuration options.

ADC_Configuration.PNG

Any guidance or suggestions on reading material would be greatly appreciated.

Thanks,

Eric

ラベル(1)
1 解決策
2,903件の閲覧回数
jch
NXP Employee
NXP Employee

Hi Eric,

Routing of the ADC triggers SIM_SOPT7 can be easily setup in Pins tool (on picture are both set to the PDB0_CH0 A and B - only PDB option allows to use more than 1 HW trigger in ADC):Pins_tool_part.PNG

Peripherals tool:

   Inside the ADC component:

   You have to set Use hardware trigger and specify asignement of the channel to the Conversion group (Group 0 = SC1A, Group 1 = SC1B register) and set initialize channel to write to this register selected setting:

Peripherals_tool_part_ADC.PNG

Inside PDB component set the appropriate input trigger for the PDB in Trigger input source (here Trigger 8 - FTM0 initialization trigger and channel triggers, as programmed in the FTM external trigger register (EXTTRIG)) for other options please see 3.8.1.1.2 PDB Input Trigger Connections in KV31F Sub-Family Reference Manual , Rev. 4, 02/2016.

Then add ADC triggering configurations (+ button), select Triggered device (ADC0 by default), then add  Pre-trigger  (+ button) and set up Pre-triggers configuration (delays are available only with Output source set to Delayed trigger):

Peripherals_tool_part_PDB.PNG

Inside the FTM component (I expect that you use FTM for the PWM outputs generation) you need to setup the sources of the PDB trigger:

Peripherals_tool_part_FTM.PNG

This is the main trigger thread which satisfies all your needs.

If you have other questions do not hesitate to ask us - your Config tools team.

Have a nice day

Jiri

元の投稿で解決策を見る

4 返答(返信)
2,904件の閲覧回数
jch
NXP Employee
NXP Employee

Hi Eric,

Routing of the ADC triggers SIM_SOPT7 can be easily setup in Pins tool (on picture are both set to the PDB0_CH0 A and B - only PDB option allows to use more than 1 HW trigger in ADC):Pins_tool_part.PNG

Peripherals tool:

   Inside the ADC component:

   You have to set Use hardware trigger and specify asignement of the channel to the Conversion group (Group 0 = SC1A, Group 1 = SC1B register) and set initialize channel to write to this register selected setting:

Peripherals_tool_part_ADC.PNG

Inside PDB component set the appropriate input trigger for the PDB in Trigger input source (here Trigger 8 - FTM0 initialization trigger and channel triggers, as programmed in the FTM external trigger register (EXTTRIG)) for other options please see 3.8.1.1.2 PDB Input Trigger Connections in KV31F Sub-Family Reference Manual , Rev. 4, 02/2016.

Then add ADC triggering configurations (+ button), select Triggered device (ADC0 by default), then add  Pre-trigger  (+ button) and set up Pre-triggers configuration (delays are available only with Output source set to Delayed trigger):

Peripherals_tool_part_PDB.PNG

Inside the FTM component (I expect that you use FTM for the PWM outputs generation) you need to setup the sources of the PDB trigger:

Peripherals_tool_part_FTM.PNG

This is the main trigger thread which satisfies all your needs.

If you have other questions do not hesitate to ask us - your Config tools team.

Have a nice day

Jiri

2,903件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hello Eric,

 

Could you please let me know which device are you working on?

 

Best regards,

Felipe

2,903件の閲覧回数
ewilliams
Contributor I

Felipe,

We are currently targeting the MKV31F512VLL12.

Thanks,

Eric

0 件の賞賛
返信
2,903件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hi Eric,

 

Unfortunately, there is no way to do that using the Config Tools. However, you can do that by writing to the SIM_SOPT7 register. Please check reference manual chapter 12.2.6.

 

In addition, I recommend you to check the mc_bldc example from the SDK, I think this may be helpful as a starting point to your application.

 

I hope it helps!

 
Have a great day,
Felipe

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信