William wrote:
On Jan 7, 4:10�pm, "Wayne <[email protected]>" <[email protected]>
wrote:
The question is: �If enabling digital io disables the ADC and vice-versa
what is the suggested jallib way to accomplish my goal?
Apparently no experts are around just now, so I'll give you my two
cents worth. I'm sure the experts will chime in after they are rested
up.
It really depends on which picmicro chip you are using, but for my
case:
1) 16F819
2) only 1 analog pin needed
3) choose RA0 as the analog pin
4) choose other pins for LCD
5) study datasheet, register ADCON1 allows a mix of digital and analog
I/O pins
I have but well do it yet again.
The data sheet may the the libs don't seem to.
6) also study ADCON0
There is probably a better way, but I just set those registers
directly:
ADCON0 = 0b01_000_001
ADCON1 = 0b10_00_1110
Thanks for the reply William.
The LCD, in my case will only use 1 pin (k107 backpack) as well but from
my reading I found
Make sure you don't call
enable_digital_io()
after this adc_init(), since this disables the use of ADC.
From this I'm thinking that the routines might have to be separate
functions that would enable the needed function. enable_digital_io()
for the digital and adc_init() for the other.
That's no problem but I just wanted to get that question out there.
Thanks again had Happy New Year
Wayne
--
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.