Searching \ for '[SX]: 0831 routine' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/ubicom/devices.htm?key=sx
Search entire site for: '0831 routine'.

Exact match. Not showing close matches.
PICList Thread
'[SX]: 0831 routine'
2000\12\16@003804 by Dan Michaels

flavicon
face
At 09:59 PM 12/15/00 +0930, you wrote:
>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
>

Maybe:

loop    clrb    clk
       mov     temp,rb                 ;read the 0831
       setb    clk
       rl      temp
       rr      data                      ;shift data to the right (rb.7 is
the input)
       djnz    trk,loop                ;is loop over if not loop again
       mov     flash,data                ;save data
       ret                             ;return to the main program

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2000\12\16@004943 by jayian

picon face
thanks for the input  I'll try it

Dan Michaels wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2000\12\16@111243 by Dan Michaels

flavicon
face
At 12:46 AM 12/16/00 +0930, you wrote:
>thanks for the input  I'll try it
>

Also occurred to me you might need delays in the loop,
the SX is very fast.


>> Maybe:

loop    clrb    clk
           call    delay
       mov     temp,rb                 ;read the 0831
       setb    clk
           call    delay
       rl      temp
       rr      data                      ;shift data to the right (rb.7 is
       djnz    trk,loop                ;is loop over if not loop again
       mov     flash,data                ;save data
       ret                             ;return to the main program

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2000\12\16@112943 by jayian

picon face
it's run at 4mh in turbo mode but the main program
has a delay before calling the routine should I move
the delay from the main program to the routine

Dan Michaels wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...