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

Led on PORT A

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



Joined: 26 Feb 2005
Posts: 64

View user's profile Send private message

Led on PORT A
PostPosted: Tue Mar 08, 2005 4:21 pm     Reply with quote

Hi
I've got a little problem.

I have 3 led and a buzzer on ports A0, A1, A2, A3.
i'm using a 16f876

I can't understand why if I set A0,A2 and A3 they make less light than A1.

it seems like tese ports flashes at very high frequncy while A1 is always high.

whn my code find a delay, leds remain down for the delay.

there is no pullup on these ports. I set correctly TRIS to 0.

it seems like ports goes in input during the code and then when I order to set high they go high for awhile and then they go down.

Could you help me??
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Tue Mar 08, 2005 4:42 pm     Reply with quote

Post your code. DOn't forget to use the 'Code' button.
fuzzy



Joined: 26 Feb 2005
Posts: 64

View user's profile Send private message

PostPosted: Wed Mar 09, 2005 7:45 am     Reply with quote

It seems the problem is caused by a default analog A port. i solved it using the instruction: setup_adc_ports( NO_ANALOGS );

all ports are digital now.

i haven't this kind of problem anymore.
valemike
Guest







PostPosted: Thu Mar 10, 2005 9:55 am     Reply with quote

From my past experience with the 16F876 (and other PIC parts), if i didn't want to use analog, i'd simply not even write a setup_adc_ports() statement and everything came up always as inputs.

Did you have a stray instruction somewhere in the beginning that did set up your ADC ports?
fuzzy



Joined: 26 Feb 2005
Posts: 64

View user's profile Send private message

PostPosted: Thu Mar 10, 2005 2:58 pm     Reply with quote

No i haven't any instruction setting up ADC. because of it i didn't know what to do!! i assumed all port initially digital!!
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