picBasic_Freak said:
Hi there,i am currently doing my Final Year Project on how to control the color of Full Color L.E.D which has 6 legs in total ,i would like to know which model of PIC is the most suitable for me,currently i am using the PIC16F628A.For your knowledge i try to make use of the integrated PWM inside the PIC to control the duty cycle inorder for me to change the color of my L.E.D.Do you have a batter suggessions on how to control the color?
The interfacing circuit i used is via the Max232 which can communicate my programmed IC with my Computer.Can someone please help out on this,thanks.
Presumably it simply consists of three LED's (Red, Blue and green) in one encapsulation?.
To provide a simple 8 colours (including black and white), you only need to switch them on in the correct combination.
To do more you have to vary the brightness of the individual LED's, depending on how many colours you need you could simply have extra PIC pins switching different resistors in series with the LED's (using two PIC pins, and two resistors for each LED would give four different levels - including off).
Another option, as you've already mentioned, is using PWM to control the brightness - unfortunately you will need three PWM outputs (one for each LED), and the 16F628 only has one. Some of the larger PIC's, 16F877 etc. have two PWM channels, but I've never noticed (or looked for!) a PIC with three.
So you probably need to do software PWM, as the 16F628 has a hardware serial port you could use that to communicate with the PC (getting rid of one processor time waster!), and generate the PWM either in straight code, or as an interrupt routine.
Does your project have a requirement for a specific number of colours?.