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

ADC setup

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







ADC setup
PostPosted: Sun Feb 09, 2003 9:38 am     Reply with quote

I'm using a pic16f877 and the board has pins A0 and A1 hardwired as led indicators, so they are outputs. I need to set up A2,A3,A5, and E0 as ADC's but there is not a predifined value for htis. Can someone tell me how to figue this out?
Thanks
Ringo
___________________________
This message was ported from CCS's old forum
Original Post ID: 11447
Bruce R. Knox
Guest







Re: ADC setup
PostPosted: Sun Feb 09, 2003 11:19 am     Reply with quote

:=I'm using a pic16f877 and the board has pins A0 and A1 hardwired as led indicators, so they are outputs. I need to set up A2,A3,A5, and E0 as ADC's but there is not a predifined value for htis. Can someone tell me how to figue this out?
:=Thanks
:=Ringo

Ringo:

You can't set it up that way. Here's a great example of the value of looking at the datasheet before designing the circuit! You're going to have to move the LEDs to move forward, and from the looks of the datasheet, you may need to find an additonal pin (based on your list above) to get four analogs and two digitals....

Bruce
___________________________
This message was ported from CCS's old forum
Original Post ID: 11448
ringo42
Guest







Re: ADC setup
PostPosted: Sun Feb 09, 2003 12:12 pm     Reply with quote

:=:=I'm using a pic16f877 and the board has pins A0 and A1 hardwired as led indicators, so they are outputs. I need to set up A2,A3,A5, and E0 as ADC's but there is not a predifined value for htis. Can someone tell me how to figue this out?
:=:=Thanks
:=:=Ringo
:=
:=Ringo:
:=
:=You can't set it up that way. Here's a great example of the value of looking at the datasheet before designing the circuit! You're going to have to move the LEDs to move forward, and from the looks of the datasheet, you may need to find an additonal pin (based on your list above) to get four analogs and two digitals....
:=
:=Bruce

Actually when the circuit was designed I was not planning on using any A/D at all. But now I'm adding extra stuff and need 4 analog inputs. Any idea what would hapen if you use setup_adc_ports(ALL_ANALOG);, then turn A0 and A1 into outputs? Thats what I'm trying right now and A3 and A5 appear to be working, but A2 and E0 are not, but I need to doublecheck my hardware also.
Thanks
Ringo
___________________________
This message was ported from CCS's old forum
Original Post ID: 11449
Bruce R. Knox
Guest







Re: ADC setup
PostPosted: Sun Feb 09, 2003 12:37 pm     Reply with quote

:=:=:=I'm using a pic16f877 and the board has pins A0 and A1 hardwired as led indicators, so they are outputs. I need to set up A2,A3,A5, and E0 as ADC's but there is not a predifined value for htis. Can someone tell me how to figue this out?
:=:=:=Thanks
:=:=:=Ringo
:=:=
:=:=Ringo:
:=:=
:=:=You can't set it up that way. Here's a great example of the value of looking at the datasheet before designing the circuit! You're going to have to move the LEDs to move forward, and from the looks of the datasheet, you may need to find an additonal pin (based on your list above) to get four analogs and two digitals....
:=:=
:=:=Bruce
:=
:=Actually when the circuit was designed I was not planning on using any A/D at all. But now I'm adding extra stuff and need 4 analog inputs. Any idea what would hapen if you use setup_adc_ports(ALL_ANALOG);, then turn A0 and A1 into outputs? Thats what I'm trying right now and A3 and A5 appear to be working, but A2 and E0 are not, but I need to doublecheck my hardware also.
:=Thanks
:=Ringo

Ah - requirements changes. I don't hold much hope for trying to operate the ports out of spec. Look at the list of combinations available on the datasheet (pp. 112 of DS30292B for example), pick one of those and rewire to it. If you're only making one of these, that's the quickest answer. And if you're making a lot of them (hopefully not already built!), then you won't have to worry about some chips working off spec and others not.

By the way, there are warnings in the datasheet regarding analog voltages on digitally configured pins, etc. I'd get real familiar with those rules too.

Good luck!

Bruce
___________________________
This message was ported from CCS's old forum
Original Post ID: 11451
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