Code:
Duty1 VAR WORD
Duty2 VAR WORD
For Duty1 = 0 to 44
LookUp DUTY1, [0,18,35,53,70,87,104,120,135,150,164,177,190,201,211,221,229,236,_
243,247,251,254,255,254,251,247,243,236,229,221,211,201,189,_
177,164,150,135,120,104,87,70,53,35,18,0],DUTY2
HSEROUT [#Duty2,13]
Pause 10
NEXT
Pause 100
END
As expected this outputs the Duty2 value just fine which proves that the lookup part works. So again, the problem is either with the code that writes the value to the dutycycle register or with the simulator.
Bookmarks