kvrajasekar
New Member
Hi all,
I am trying to call the sine LUT values.Totally 120 values are stored in LUT. PIC16f72.
When i am trying to access the values,i can get 110 values only.I posted my code here,please tell me what is the problem...
sine_loop
movf offctr,w
call sine_LUT
movwf vref_val
movf offctr,w
sublw 0x80
btfsc STATUS,Z
goto loopcompleted ;else continue.
incf offctr,1
goto sine_loop
sine_LUT
addwf PCL,F ; Increment into table
dt .0,.7,.13,.20,.27,.33,.40,.47,.53,.60,.66,.73,.79,.85,.92,.98,.104,.110,.116,.122,.128,.134,.139,.145,.150
dt .156,.161,.166,.171,.176,.181,.186,.190,.195,.199,.203,.207,.211,.215,.218,.222,.225,.228,.231,.234,.237,.239
dt .241,.243,.245,.247,.249,.250,.252,.253,.255,.255,.255,.255,.255,.255,.255,.255,.255,.254,.253,.252,.250
dt .249,.247,.245,.243,.241,.239,.237,.234,.231,.228,.225,.222,.218,.215,.211,.207,.203,.199,.195,.190,.186,.181,.176,.171,.166,.161,.156,.150,.145,.139,.134,.128
dt .122,.116,.110,.104,.98,.92,.85,.79,.73,.66,.60,.53,.47,.40,.33,.27,.20,.13,.7,.0
end
I am trying to call the sine LUT values.Totally 120 values are stored in LUT. PIC16f72.
When i am trying to access the values,i can get 110 values only.I posted my code here,please tell me what is the problem...
sine_loop
movf offctr,w
call sine_LUT
movwf vref_val
movf offctr,w
sublw 0x80
btfsc STATUS,Z
goto loopcompleted ;else continue.
incf offctr,1
goto sine_loop
sine_LUT
addwf PCL,F ; Increment into table
dt .0,.7,.13,.20,.27,.33,.40,.47,.53,.60,.66,.73,.79,.85,.92,.98,.104,.110,.116,.122,.128,.134,.139,.145,.150
dt .156,.161,.166,.171,.176,.181,.186,.190,.195,.199,.203,.207,.211,.215,.218,.222,.225,.228,.231,.234,.237,.239
dt .241,.243,.245,.247,.249,.250,.252,.253,.255,.255,.255,.255,.255,.255,.255,.255,.255,.254,.253,.252,.250
dt .249,.247,.245,.243,.241,.239,.237,.234,.231,.228,.225,.222,.218,.215,.211,.207,.203,.199,.195,.190,.186,.181,.176,.171,.166,.161,.156,.150,.145,.139,.134,.128
dt .122,.116,.110,.104,.98,.92,.85,.79,.73,.66,.60,.53,.47,.40,.33,.27,.20,.13,.7,.0
end
Last edited: