View previous topic :: View next topic |
Author |
Message |
fuzzy
Joined: 26 Feb 2005 Posts: 64
|
Led on PORT A |
Posted: Tue Mar 08, 2005 4:21 pm |
|
|
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
|
|
Posted: Tue Mar 08, 2005 4:42 pm |
|
|
Post your code. DOn't forget to use the 'Code' button. |
|
|
fuzzy
Joined: 26 Feb 2005 Posts: 64
|
|
Posted: Wed Mar 09, 2005 7:45 am |
|
|
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
|
|
Posted: Thu Mar 10, 2005 9:55 am |
|
|
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
|
|
Posted: Thu Mar 10, 2005 2:58 pm |
|
|
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!! |
|
|
|