How to generate phase shift, at 1Mhz, between separate power stage controllers within a single uC? So far I've been able to synchronize startup of PSC's within an AT90PWM316 using the PARUN bits... but I need real-time, controllable phase shift between two PSC's. If there's a way to modify the 12-bit counter value within the PSC core, I haven't been able to find it.
My goal is to generate the four colored square waves seen in the above picture, for input to four Gate Drive IC's. Extremely narrow (10nS probably good enough) dead-bands between the square waves are not shown, but are required. Switching frequency is 1Mhz, so, using the fast clock (64Mhz) of the AT90PWM316. Although at shitty (30 counts) resolution, I was easily able to generate two square waves with controllable phase-shift in between:
OCR0RB=62; //Sets the freq. Main reference signal. Part B. PSCOUT01. Trigger on this. OCR0SB=(OCR0RB/2)-1; OCR0RA=0; //Part A, PSCOUT00, Phase shifted signal. OCR0SA=30; PLLCSR=(1<<PLLF)|(1<<PLLE); //Set PLL division factor (64Mhz when set, 32M when cleared) and enable PLL PCNF0|=(1<<PCLKSEL0); //use the fast CLK while ((PLLCSR&(1<<PLOCK))==0); //Wait for PLL lock PSOC0=(1<<POEN0A)|(1<<POEN0B); //Enable outputs PCTL0|=(1<<PRUN0); //Run Power Stage Controller 0
If 30 counts are added to OCR0RA and OCR0SA (making them 30 and 60, respectively) the two square waves are perfectly shifted. That was real fantastic when I was using Gate Drive Transfor mers that had two secondaries each. This is an ultra high speed application and I *cannot* use GDT's for this... had to switch to Gate Drive IC's... four square waves now required, with narrow dead bands, and controllable phase shift from one pair of square waves to the next.