Searching \ for 'ADC using 71' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'ADC using 71'.

Truncated match.
PICList Thread
'ADC using 71'
1998\03\13@142718 by andre

Hi to all.

I was experimenting with 16c71 and I ended with problem that
I could not solve.
I am using picmaster emulator with 16k probe (16c71)
all I was doing is to check A/D and output it to 8 bit  LED's.
I am using demo board 1 .
I am outputting it to portb
The problem I have is when input voltage is 0  on output led0 and led1
are still on but they are not bright. when I play with POT I see led
are running .
My question is why led0 and led1 are not working. hardware connection is
is there any error in my code?
                                               thank you

init     clrf    portb
        bsf             status,5          ; set up page 1
       movlw       B'00000011'
       movwf       trisb               ; B0 and B1 inputs the rest
       movlw       B'00001111'
       movwf       trisa               ;
        movlw     B'00000010'
       movwf       adcon1              ; set a/d inputs on a0/1 rest
        movlw     b'00000001'     ; set timer internal div 1/4 and
pullup enabled
        movwf     optreg  ; do it
       bcf             status,5              ; return to page 0
       movlw       b'11000001'     ; set a/d internal rc clock and 11
for 256
       movwf       adcon0              ; do it

; ****************** the start ************************

                bsf             adcon0,2      ; start conversion
                movlw       20                  ; this line is 20
               movwf   temp
lp1         decfsz      temp,f              ; wait a while
               goto    lp1

conv    btfsc   adcon0,2                  ; test for end of conversion
           goto    conv
           movf    adres,w             ; load a/d result into w
           movwf   on_time            ; store it
            comf on_time,f             ; compliment to mach demo1 pot
            movf on_time,w
            movwf portb                ; disply it
            goto main

Andre Abelian

1998\03\13@173333 by Brian Schousek

picon face
Andre: First off- you have port B0 and B1 set to inputs rather than outputs
so you should never expect them to output. Secondly, you probably have
internal pullups enabled (bit 7 RBPU* in the OPTION register) which would
explain the dimly glowing LEDs. (Note the * on RBPU*. This means the signal
is active low- so a 0 in bit 7 will *enable* pullups.)

-----Original Message-----
From: Andre Abelian <>
Date: Friday, March 13, 1998 2:26 PM
Subject: ADC using 71

>        movlw       B'00000011'
>        movwf       trisb               ; B0 and B1 inputs the rest

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