piclist 2000\12\15\232940a >
Thread: 0831 routine
www.piclist.com/techref/ubicom/devices.htm?key=sx
picon face BY : jayian@RemoveMEameritech.net



hi,
whenever the main program call the subroutine below I get garbages
I hope somebody can point out my mistake cause I don't see what is
wrong with it.

thanks

;this routine read the ADC0831
adc     setb    cs                      ;cs high (ra.1)
       setb    clk                     ;clk high (ra.0)
       mov     trk,#8                  ;number of time to loop
       clrb    cs                      ;enable the 0831
       clrb    clk                     ;start convertion
       nop
       setb    clk
       nop
loop    clrb    clk
       mov     data,rb                 ;read the 0831
       setb    clk
       rr      rb                      ;shift data to the right (rb.7 is the input)
       djnz    trk,loop                ;is loop over if not loop again
       mov     flash,rb                ;save data
       ret                             ;return to the main program

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


<3A3A0EAB.33BF4247@mailhost.day.ameritech.net> 7bit

See also: www.piclist.com/techref/ubicom/devices.htm?key=sx
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) 0831 routine

month overview.

new search...