Hi,
I am getting started with writing my own HET Programs in the HET IDE and using HTU for data transfer. (Double buffer mode, but should not matter here).
Here's the program, captures duty-cycle and period on HET1_PIN12
L00 PCNT { hr_lr=LOW,next=L01,type=RISE2FALL,pin=12};
L01 PCNT { hr_lr=LOW,next=L02,reqnum=0,request=GENREQ,type=RISE2RISE,pin=12};
L02 CNT { next=L03,reg=B,max=1171,data=0};
L03 ECMP { next=L04,hr_lr=LOW,en_pin_action=ON,pin=7,action=PULSELO,reg=B,data=527};
L04 ECNT { pin=12,event=RISE,reg=A,data=0};
L05 BR { next=L00,cond_addr=L00,event=NOCOND};
L00 and L01 are of interest, L02 and L03 are just generating a signal, L04 is irrelevant.
The HUT is set up to transfer DF of L00 (on-time) and DF of L01 (period) to buffers bufferA and bufferB, which works well.
I am setting a breakpoint in the HTU interrupt 'bufferA finished'. I am wondering why for slow signals (~ 10Hz), the first on-time value is always zero. For faster signals it's not the case, the on-time is correct then.
Can anyone explain that behavior?
Regards,
Juergen