Part Number: TM4C123GH6PM
Hello,
I am using PWM module 0, Generator 0, to generate 2 pwm signals but from the same generator.
And I am triggering ADC on the middle of the PWM high with:
MAP_PWMGenIntTrigEnable(PWM0_BASE, PWM_GEN_0, PWM_TR_CNT_LOAD);
And:
MAP_ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PWM0, 0);
MAP_ADCSequenceConfigure(ADC0_BASE, 2, ADC_TRIGGER_PWM0, 1);
Which right now works. But I also would like to trigger adc when counter hits zero, so the adc triggers on both on the middle of on time and off time.
I can MAP_PWMGenIntTrigEnable(PWM0_BASE, PWM_GEN_0, PWM_TR_CNT_LOAD | PWM_TR_CNT-ZERO) ;
to trigger events for both zero and load values, effectively triggering adc - but is there any way to know which one is which? Right now we are using a trigger, so it will go to adc tru hardware.
I understand we can create CMPA and CMPB to trigger interrupts which later will processor trigger adc. But given the high frequency of pwm, I would like to avoid this. Is there any way we can distinguish triggers, so I can attach different adc sequences to them. I have read datasheets, tiva-c software manuals, and source code. and I think the answer is no, but still decided to ask to forum.
MAP_ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PWM0, 0);
We need a way to configure sequence with triggers from pwm0 but different type of triggers.
Best Regards,
C.