Help understanding how C2000 Cmpa values updates during EPWM Trigger Events
Show older comments
Hello everyone, i am actually using the C2000 microcontroller TMSF28388D of Texas Instrument and i am actually struggling to understand how the EPWM module and SOC trigger work. My aim is to realize a PI Controllerfor a H bridge Converter and i want to read voltage value from the ADC module when the TBCTL is equal to 0 so essentially at the start of my carrier signal then i want,based on this value,evaluate the new cmpa value in order to reach my desider reference. What i don't understand is how this temporally work. When the event TBCTL = 0 happens, I read the value and in the same moment i evaluate this in order to find my desider new cmpa value, but later when this value will be updated in my EPWM registers? if i use the shadow mode i can update the register, if i understood good, the zero event after, so essentially one period later, is it right? But this means that i can acquire just one ADC value and to update the cmpa just one time for switching period? if i want for example,using Up/down mode, to acquire ADC values two times in a period so in TBCTL = 0 and TBCTL = PRD by creating two differents interrupt and ISR, how this will temporally work? I mean i start from 0 so the first event soon occured, i evaluate the cmpa and when this value will be updated? if i updated it immediately, i will have the desidered duty just for 1/4 of the period cause the TBPRD happens at Tpwm/2 in up/down mode and later when TBCTL = TBPRD i should read the adc value again and evaluate a new duty cycle? what should i expect from the ADC voltage acquirements,after applying the first cmpa value but only between 0 and TBPRD? For example settling a 50% desired duty, since my duty is applied only for half a period i should expect a 25% of the duty? Can you please solve my doubts if possible making an example of how all this should temporally work and happen? I should use the first event to read the value and the second one to update, or just reading and evaluating the control value for each TBCTL event? Thanks in advice for the support!
Accepted Answer
More Answers (0)
Categories
Find more on Multiprocessor Architecture Modeling in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!