CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Output pin interferes with other pin???????

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kgn340



Joined: 12 Jan 2004
Posts: 5

View user's profile Send private message

Output pin interferes with other pin???????
PostPosted: Thu Sep 15, 2005 4:45 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 15, 2005 5:42 pm     Reply with quote

Look at these two threads, and then post a full test program, which
shows all your i/o port setup code, and your fuses, etc.
ie., how are you setting up the analog port ?

http://www.ccsinfo.com/forum/viewtopic.php?t=22778&highlight=readmodifywrite

http://www.ccsinfo.com/forum/viewtopic.php?t=23756&highlight=readmodifywrite
croc4



Joined: 02 Sep 2005
Posts: 10

View user's profile Send private message

Check your setup_xxxx options
PostPosted: Thu Sep 15, 2005 10:51 pm     Reply with quote

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

View user's profile Send private message

Re: Check your setup_xxxx options
PostPosted: Fri Sep 16, 2005 9:13 am     Reply with quote

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







PostPosted: Fri Sep 16, 2005 9:59 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Sep 19, 2005 6:04 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group