The following program works in simulation with HET IDE but does not work when using RM48 USB Stick Development Kit.
The problem is: there are no pulses on pin 1.
There are no errors when compiling, loading and executing the programs.
;---------------------------------------------------------------------------------------------------------
; METHOD WHICH INCLUDES THE INSTRUCTIONS ADD, DADM64 ET MOV64 V 2.0
;---------------------------------------------------------------------------------------------------------
;This Method produces pulses with a length from the LengthMini value to LengthMAxi value by step of LengthStep
;The values of LengthMAxi , LengthMini are fixed to 10 and 6 to run the program in step by step with HET IDE
;In production these values are more important : period = 200 LengthMAxi =180, LengthMini = 1 LengthStep = 2.
;The execution of the program take a maximum of 5 cycles.
;The signal frequency must be near of 5 Khz
;----------------------------------------------------------------------------------------------------------------------------
Sign_period .Equ 200 ; Signal Period : = 200 In Production 10 in simulation
LengthMAxi .Equ 180 ; LengthMAxi : = 180 In Production 6 in simulation
LengthMini .Equ 1 ; LengthMini : = 1 In Production 1 in simulation, minimum value = 1 ==> 2 Loop cycles
LengthStep .Equ 1 ; LengthStep : = 1 In Production 1 in simulation
noPinA .Equ 1 ; Numéro de la pin A
L01 CNT {brk=ON, reg=A, irq=OFF, max = Sign_period, data=0} ;1c
L02 ECMP {cond_addr= L04, hr_lr=HIGH,en_pin_action=ON,pin=noPinA,action=PULSEHI,reg=A,irq=OFF,data=LengthMini,hr_data = 0x0 };1C
L03 BR {next=L05, cond_addr=L01, event=NE} ;1C
L04 ADD {next=L01, src1=A, src2=ZERO, dest=B, data=0, hr_data=0} ; Reg B = Reg A 1c
L05 ECMP {cond_addr= L07,hr_lr=LOW,en_pin_action=OFF,pin=0,action=CLEAR,reg=B,irq=OFF,data=LengthMAxi,hr_data = 0x0 };1C
L06 DADM64{next=L01,remote=L02, data=LengthStep,hr_data=0, cond_addr= L04,comp_mode=ECMP, en_pin_action=ON,pin=noPinA,action=PULSEHI,reg=A,irq=OFF } ; Length=Length+LengthStep ;1C
L07 MOV64 {next=L01,remote=L02, data=LengthMini,hr_data=0, cond_addr= L04,comp_mode=ECMP, en_pin_action=ON,pin=noPinA,action=PULSEHI,reg=A,irq=OFF } ;pulse Length =LengthMini ; 1c
If I just replace the program with the following program the execution is correct.
I did not change anything else.
But i need to install the first program more sophisticated.
;------------------------------------------------------------------------------------
; METHOD WHICH INCLUDES THE INSTRUCTIONS ADD, ET MOV32
;------------------------------------------------------------------------------------
;This Method produces pulses with a length from the 1% to 100% of the signal period value
;The values of LengthMAxi , LengthMini are fixed to 10 and 6 to run the program in step by step with HET IDE
;In production this value = 200.
;The execution of the program take a maximum of 8 cycles.
;The signal frequency must be near of 5 Khz
;----------------------------------------------------------------------------------------------------------------------------
EnableLgnt .Equ 200 ; EnableLgnt : = 100 In Production 20 in simulation
noPinA .Equ 1 ; Numéro de la pin A
L01 CNT {reg=A, irq=OFF, max = EnableLgnt} ;1c
L02 ECMP {next=L01,cond_addr= L03,hr_lr=LOW,en_pin_action=ON,pin=noPinA,action=PULSELO,reg=A,irq=OFF,data=EnableLgnt,hr_data = 0x0 };1C
L03 ADD {next=L04, src1=A, src2=ONES, dest=B, data=0, hr_data=0} ; A-1 dans data de L01 1c
L04 BR {cond_addr=L06, event=C} ;1C
L05 MOV32 {type=IMTOREG, reg=B, data=EnableLgnt, hr_data=0 } ; reg B = EnableLgnt 1C l'algorithme est decroissant 2C
L06 MOV32 {next=L01, remote=L02, type=REGTOREM, reg=B, data=0, hr_data=0 } ; datafield L02 = reg B : 2C
Thanks a lot for your help
Kind Regards