View previous topic :: View next topic |
Author |
Message |
kgn340
Joined: 12 Jan 2004 Posts: 5
|
Output pin interferes with other pin??????? |
Posted: Thu Sep 15, 2005 4:45 pm |
|
|
here it goes ...
PIC16F88 running from internal 8MHz
PCM v3.215
codes snippet:
output_high(PIN_A1);
delay_ms(100);
delay_ms(100);
delay_ms(100);
output_low(PIN_A0);
symptom:
pin A1 does indeed go HIGH, but after the output_low takes BOTH A0 and A1 low
also, if i try this:
output_high(PIN_A1);
output_high(PIN_A0);
pin A0 will go HIGH but A1 stays low !!!!
what the heck????
any ideas???
(i've isloated the pins and have tried different 16f88 chips). |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
croc4
Joined: 02 Sep 2005 Posts: 10
|
Check your setup_xxxx options |
Posted: Thu Sep 15, 2005 10:51 pm |
|
|
I had the same problem until I turned off the analog ports
// Turn off the ADC
setup_adc_ports(NO_ANALOGS);
try this and see if things get better |
|
|
kgn340
Joined: 12 Jan 2004 Posts: 5
|
Re: Check your setup_xxxx options |
Posted: Fri Sep 16, 2005 9:13 am |
|
|
croc4 wrote: | I had the same problem until I turned off the analog ports
|
WOW. This did it! THANKS!!!!
i guess my 'setup_adc(ADC_OFF)' just wasn't cutting it.
Thanks again!
-kev |
|
|
Ttelmah Guest
|
|
Posted: Fri Sep 16, 2005 9:59 am |
|
|
Yes.
There is a critical difference in these two commands. setup_adc(ADC_OFF), just turns off the ADC, but still leaves the input multiplexer all setup to route the signals to the sampler. Use this, to save power, while the input capacitors are charging, or when the chip is to sleep. Setup_adc_ports, actually configures the inputs.
Best Wishes |
|
|
adrian
Joined: 08 Sep 2003 Posts: 92 Location: Glasgow, UK
|
|
Posted: Mon Sep 19, 2005 6:04 am |
|
|
Ttelmah wrote: |
setup_adc(ADC_OFF), just turns off the ADC, but still leaves the input multiplexer all setup to route the signals to the sampler. |
Ah! this might answer the problem I am having with the 16F913. I was trying to use setup_adc(ADC_OFF) to turn off the ADC, followed by setup_comparator(nc_nc) to turn off the comparator. This had the effect of turning AN5 into an input from the digital output originally declared.
Thanks for the posting. |
|
|
|