Hi,
I'm trying to decode a PPM signal with a TMS570LC43x and the use of an HET timer. So far I've been able to trigger an edge interrupt, but something goes wrong with measuring time between two interrupts. The PPM signal has 8 channels, so there should be 9 interrupts. Below the interrupt handler and calculation of the duration between the interrupts.
void edgeNotification(hetBASE_t * hetREG,uint32 edge){ ppm_values[spike] = hetGetTimestamp(hetRAM1); ++spike; if(spike == 9){ spike = 0; hetResetTimestamp(hetRAM1); calculate_ppm(); } } void calculate_ppm(){ uint32 t0 = ppm_values[0] - ppm_values[1]; uint32 t1 = ppm_values[1] - ppm_values[2]; uint32 t2 = ppm_values[2] - ppm_values[3]; uint32 t3 = ppm_values[3] - ppm_values[4]; uint32 t4 = ppm_values[4] - ppm_values[5]; uint32 t5 = ppm_values[5] - ppm_values[6]; uint32 t6 = ppm_values[6] - ppm_values[7]; uint32 t7 = ppm_values[7] - ppm_values[8]; }
In my main I've called hetInit();. In HalcoGen the frequency of HET1 is set to 1MHz, so each tick should be 1 uS (?). The values of t1-t7 are all somewhere around 4294742144. The time between each spike should be 1500 uS... Am I missing something? What goes wrong here?
Thanks, Jesse