I used the ADC lib once only, for potentiometer to pwm (motor
control). so, I did not use enable_digital_io (on 16f877), so I guess
all analog pins continued to be analog pins. So what should be done if
I only need one of the pins to be analog and the rest to be digital?

Wayne, now you could make a question & answer for the website FAQ.

Thanks,
Matt.

On Jan 7, 9:06 pm, "Wayne <[email protected]>" <[email protected]>
wrote:
> William wrote:
> > On Jan 7, 7:10 pm, "Wayne <[email protected]>" <[email protected]>
> > wrote:
> >> Make sure you don't call
> >> enable_digital_io()
> >> after this adc_init(), since this disables the use of ADC.
>
> > Right, I meant to say, I'm not sure how to do it with JALLIB.
>
> > -- Eur's routine to read the A/D
> > var word analog
>
> > procedure get_analog is
> >    ADCON0_NDONE = true
> >    while ADCON0_NDONE loop end loop
> >    analog = word(ADRESH) << 8
> >    analog = analog + word(ADRESL)
> > end procedure
>
> > ADCON0 = 0b01_000_001
> > ADCON1 = 0b10_00_1110
>
> > forever loop
> >    get_analog()
> >    -- display on lcd
> > end loop
>
> > William
>
> I just finished re-reading the Joep & Toon Tutorial.  They explained the
> answer to my question.  ie to use the analog pins as digital IO
> you have to disable them using the enable_digital_io().  what I had
> read, but didn't remember, was that the non analog pins are usable any
> way 'without' using the enable_digital_io() call.
>
> So in my case I just have to use a digital pin for the LCD and an analog
> pin for the adc and never call enable_digital_io().
>
> Thank you Joep & Toon.  Your Tutorial has helped me yet again.
>
> Regards
>
> Wayne- Hide quoted text -
>
> - Show quoted text -
-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.


Reply via email to