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 CCS Technical Support

pic16c8452 and port a

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







pic16c8452 and port a
PostPosted: Sun Nov 18, 2001 4:16 am     Reply with quote

Please can someone help me I'm more than pulling my hair out.
I like just about everyone else, was using the f877 and have changed to the 18c452.
I use porta - a3 to calculate a value. If the line is high I add a value. This works fine on my f877 but i can't get the 452 to recognise the changes on the ports.

My code is
if (bit_tes(porta, 0))
total = total + 1;

I have also tried
if (input(pin_a0))
total = total + 1;

without any joy.

What am I missing???
___________________________
This message was ported from CCS's old forum
Original Post ID: 1191
Eric Belanger
Guest







Re: pic16c8452 and port a
PostPosted: Sun Nov 18, 2001 12:13 pm     Reply with quote

Hi,

I'm not sure if this may help, but did you disable the A/D converter? If not the default uses is analog input and not Digital IO.

// A/D Disable, PORT A I/Os Numeriques seulement
SETUP_ADC( ADC_OFF );
SETUP_ADC_PORTS( NO_ANALOGS );

Eric

:=Please can someone help me I'm more than pulling my hair out.
:=I like just about everyone else, was using the f877 and have changed to the 18c452.
:=I use porta - a3 to calculate a value. If the line is high I add a value. This works fine on my f877 but i can't get the 452 to recognise the changes on the ports.
:=
:=My code is
:=if (bit_tes(porta, 0))
:= total = total + 1;
:=
:=I have also tried
:=if (input(pin_a0))
:= total = total + 1;
:=
:=without any joy.
:=
:=What am I missing???
___________________________
This message was ported from CCS's old forum
Original Post ID: 1200
Delene Mulley
Guest







Re: pic16c8452 and port a
PostPosted: Mon Nov 19, 2001 1:24 am     Reply with quote

Eric you are a genuis

THANK YOU

:=Hi,
:=
:=I'm not sure if this may help, but did you disable the A/D converter? If not the default uses is analog input and not Digital IO.
:=
:= // A/D Disable, PORT A I/Os Numeriques seulement
:= SETUP_ADC( ADC_OFF );
:= SETUP_ADC_PORTS( NO_ANALOGS );
:=
:= Eric
:=
:=:=Please can someone help me I'm more than pulling my hair out.
:=:=I like just about everyone else, was using the f877 and have changed to the 18c452.
:=:=I use porta - a3 to calculate a value. If the line is high I add a value. This works fine on my f877 but i can't get the 452 to recognise the changes on the ports.
:=:=
:=:=My code is
:=:=if (bit_tes(porta, 0))
:=:= total = total + 1;
:=:=
:=:=I have also tried
:=:=if (input(pin_a0))
:=:= total = total + 1;
:=:=
:=:=without any joy.
:=:=
:=:=What am I missing???
___________________________
This message was ported from CCS's old forum
Original Post ID: 1220
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