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.
Any guidance or suggestions on reading material would be greatly appreciated.
Thanks,
Eric
Solved! Go to Solution.
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):
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:
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):
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:
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
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):
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:
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):
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:
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
Hello Eric,
Could you please let me know which device are you working on?
Best regards,
Felipe
Felipe,
We are currently targeting the MKV31F512VLL12.
Thanks,
Eric
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.
-------------------------------------------------------------------------------