Hi,
I am trying to change dynamically the value of the length of a pulse.
In the following program I just want to modify the data field of L02 instruction:
EnablePer .Equ 20 ; Period of Enable
EnableLgnt .Equ 01 ; Length of Enable signal
L01 CNT {reg=A, irq=OFF, max = EnablePer};
L02 ECMP {next= L01, cond_addr= L01, hr_lr=LOW, en_pin_action=ON, pin=1, action=PULSELO, reg=A, irq=OFF, data=EnableLgnt, hr_data = 0x0 };
I just want to increase the data field value by one each loop cycle and clear the data field when it is equal to EnablePer. To do that I first imagine using the ADM32 instruction and I need to use an internal register. So, for me the first thing to do is to initialize the B register to one. I try it with the instruction L00 and I tested the following program:
EnablePer .Equ 20 ; Periode of Enable
EnableLgnt .Equ 01 ; Length of Enable signal
L00 ADD {next= L01, src1=IMM, src2=B, DEST=B, data=1, brk=ON }
L01 CNT {reg=A, irq=OFF, max = EnablePer};
L02 ECMP {next= L01, cond_addr= L01, hr_lr=LOW, en_pin_action=ON, pin=1, action=PULSELO, reg=A, irq=OFF, data=EnableLgnt, hr_data = 0x0 };
But I got the following error: EID005 : Program Overflow has occurred, Please clear the overflow flag.
The register A seems to be instantiated forever.
I need some explanation.
Thanks a lot by advance for your Help.
Jerome