Analog woes. Led's aren't behaving as I expected?

Status
Not open for further replies.

ravix

New Member
Hi. I am trying to build a very simple device that can turn on six different LED's, one at a time. I have some experience with pics, and the circuit is working well digitally.

Attached is a simplified circuit diagram to help me explain. The only things not included in this diagram are the programming pins and resistors, a couple of switches attached to int0 and int1 (with pulldown resistors) and a couple decoupling caps.



I set PORTA to digital outputs, then set each pin to 0 to turn on the LED. Simple, right?

Unfortunately, one LED (the blue one) almost always stays on. ARGH! Its stays on UNLESS I have its pin enabled. In which case no LED is illuminated.

Does anyone know how this could happen? Is there something wrong with my circuit setup?
 

Attachments

  • led_ques.png
    7 KB · Views: 139
Last edited:
It's either a fuse.....or something else.

The blue LED may require more current. Is the resistor speced right?
 
Just to make sure, you're setting TRISA to set the pin as a digital out, correct? TRISx is to determine if a pin is an input or an output, PORTx is intended to read the input value (though writing to it will write to LATx) and LATx is for writing an output. At least with the Hitech compiler I use, I suppose another compiler may define those differently, but it would go against the datasheet.
 
research causes cancer in rats.

Yes, and increased ice cream sales causes the asphalt in the street to soften.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…