Hi all,
I'm currently implementing several NHET PWM channels using the NHET CNT & MCMP instructions on a RM48L952. NHET is running at CPU speed, 220 mhz. I use a sample rate of 2500, which results in 1375 LR and 64 HR cycles per sample.
To adjust the PWM output, I use the RTI at a 0.4 ms interval to write different value to the HET memory. The whole isr with only one channel takes only 320 cpu cycles, so isr time << sample time. However, if I send a simple block wave (one sample high, one sample low, rinse and repeat), I only get small downward spikes of approx. 580 ns instead of 400 us. The rest of the time, the signal is high.
If I lower the RTI frequency to once every 0.8 ms, I get alternating low and high periods, but in a ratio of 1 : 3 (400 us vs 1200 us). I thought this may have to do with my isr taking too long, but even with one channel (320 cycles) it happens, so this cannot be the case. I also do not use the HTU, but since the isr only takes 320 cycles, that should not be the problem I guess?
I suspect I'm missing something trivial, but this has made me question my sanity at times.
Thanks in advance!
Regards,
Tim