PIC12f675 RGB LED

Find out how to setup your programmer's software and how to solve many common problems.

Moderator: phalanx

Post Reply
electronics4fun
Posts: 1
Joined: Wed Sep 21, 2016 6:25 am

PIC12f675 RGB LED

Post by electronics4fun » Fri Sep 23, 2016 12:13 am

Hi,

I am a noob to the microcontroller world. But I found the basic stuff interesting so I bought a PIC12f675 and a few leds including RGB common anode leds. I wired the common anode rgb led and the PIC12f675 after searching on the internet. The circuit goes like this, the common anode is connected to the positive rail (+5v) of the breadboard and the other cathode pins are connected to the GPIO pins 5,6 & 7 respectively of PIC12f675 through a 150 ohm resistor each. I understand that a digital low lights up the led and a digital high turns off the led, but there is something weird happening. I wrote a program to switch on and off the colors one after the other with a 1 sec delay in between them, but what happens is after turning off the first color, even after applying a HIGH to the first pin, the first pin goes low and the first color turns and remains on and the same happens with the second color and so on. Do I need to use a transistor if its a common anode rgb? I have seen common anode rgb led circuits which do not use transistors. Can anyone please help me on this or am I doing something wrong??

Thank you!

User avatar
phalanx
Non-SFE Guru
Posts: 1962
Joined: Sun Nov 30, 2003 8:57 am
Location: Candia, NH

Re: PIC12f675 RGB LED

Post by phalanx » Fri Sep 23, 2016 5:57 am

There's nothing inherently wrong with how you have the LED connected so barring some sort of hardware failure in the PIC, there's a good chance something in your code isn't responding the way you intend it to. Post your source here and we can take a look at it.

-Bill

Post Reply