Other Parts Discussed in Thread: HALCOGEN
Hello everybody,
I'm running a 3 phase symmetrical PWM with 16kHz on a TMS570LS3137.
The HET code is based on TI's example which was posted in several revisions in this forum.
My main additions were another few timers to generated ISR and ADC triggering (at 32kHz) as well a resolver excitation (at 8kHz).
Here is a code snip:
;----- program entry point
; Sit in loop initializing all pins to output low, and clearing counter & state (NXTxLOON)
; until software enables the PWM program by writing non-zero data to START
START SUB {src1 = IMM, src2 = ZERO, dest=NONE, data=0, hr_data=0}
BR {event=NZ, cond_addr= TBASEINT}
ADD {src1 = IMM, src2=ZERO, dest=T, rdest=REM, remote=TBASE1, data=1FFFFFFh, hr_data=0}
MOV64 {en_pin_action=ON, reg=T, pin=PEROUT, action=CLEAR, data=0, hr_data=0, cond_addr=PERSET, remote=PERPIN, comp_mode=ECMP}
ADD {src1 = ZERO, src2=ZERO, dest=NONE, rdest=REM, data=0, hr_data=0, remote=PERCLR}
ADD {src1 = ZERO, src2=ZERO, dest=NONE, rdest=REM, data=0, hr_data=0, remote=NXTALOON}
ADD {src1 = ZERO, src2=ZERO, dest=NONE, rdest=REM, data=0, hr_data=0, remote=NXTBLOON}
ADD {src1 = ZERO, src2=ZERO, dest=NONE, rdest=REM, data=0, hr_data=0, remote=NXTCLOON, next=AHIONINIT}
;interrupt: main counter for application timing
TBASEINT CNT {reg = A, max = defperint, data = defdladc}
;ADC: falling edge will trigger ADC sampling (see HALCoGen ADC event group settings) and important: enable this line to generate interrupts in HALCoGen HET settings!!!
ADCCTRL ECMP {reg = A, irq = ON, en_pin_action = ON, hr_lr = HIGH, pin = defpinadc, action = PULSELO, data = defdcadclr, hr_data = defdcadchr}
;ADC: same compare as ADC trigger but without IRQ and on different pin falling to support commissioning
ADCTEST ECMP {reg = A, en_pin_action = ON, hr_lr = HIGH, pin = defpintest, action = PULSELO, data = defdcadclr, hr_data = defdcadchr}
;resolver: important: we use a different timer!!!
TBASERES CNT {reg = B, max = defperres, data = defdlres}
RESCTRL ECMP {reg = B, en_pin_action = ON, hr_lr=HIGH, pin = defpinres, action = PULSELO, data = defdcreslr, hr_data = defdcreshr}
TBASE1 CNT { comp=GE, reg=T, max=cntmax_lr, data=1FFFFFFh};
...
New project requirement is to synchronize the PWMs of two identical inverters (each using its own TMS570).
The overall algorithm to do this is still in development, but what I need to do in the end is to change all period and phase shift registers of my timers online!
HETGCR.CMS[16] looked promising but seems to help onchip only...
Any ideas or hints on getting the HET program tuned?
Regards,
Ralph