I'm trying to use the TMS470 HET to get two specific PWM signals: a 5MHz 50% duty cycle and a 1Hz 0.01% duty cycle (100 uS high, 999900 uS low). I can get the 5MHz signal by leaving the HR clock at 80Mhz and setting the LR prescale to 3 to get a 100nS LR time but once I get a 100nS loop time it limits the maximum period I can use for the counter on the other PWM channel (since the CNT max is 20bits).
Here is my current HET code:
CNT0 CNT { next=CMP0,reg=A,max=1,data=1};
CMP0 ECMP { next=CNT0,hr_lr=LOW,en_pin_action=ON,cond_addr=CNT1,pin=0,action=PULSEHI,reg=A,data=1,hr_data=0};
CNT1 CNT { next=CMP1,reg=B,max=1000000,data=0};
CMP1 ECMP { next=CNT0,hr_lr=LOW,en_pin_action=ON,cond_addr=CNT0,pin=1,action=PULSELO,reg=B,data=500,hr_data=0};
Here is my PFR config:
hetREG->PFR = 0x0300U;
This gives me a 5MHz 50% signal and a 5Hz 0.5% signal (100uS high, 199.9mS low). The problem I keep running into is that when I get the loop resolution high enough to get the 5MHz signal it limits the loop time so much that I cannot run too many HET functions in the loop.
Advice would be appreciated in generating these two signals.