![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| I wonder if someone can help a poor man. I want to colour cycle a RGB LED smoothly through thounds of colours, it will be used to light up a lod etched in glass, so random colours would be great. I have been told PWM is what i need, I have a PICKit1 and a PicstarPlus programmer from Microchip. I am very new to this and just dont know where to start, I have some PIC12F675 Chips. Anyone recomend anything? PLEASE.......
__________________ ------- Regards, William Cavanagh | |
| |
| | (permalink) |
| What language are you programming in and what speed are you going to run the 675 at? Resc. | |
| |
| | (permalink) |
| Going to use ASM as that seems to be all i can do with MPLAB, going to use the internal 4Meg clock
__________________ ------- Regards, William Cavanagh | |
| |
| | (permalink) |
| 4mhz will work for 3-channels ok if you use the correct methods for pwm, as for ASM I can't help you on that. Resc. | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| the best way would be to use a TMR0 interupt, then devide it down depending on what value you should have in a file register for each LED. The TMR0 registrer at 4mhz u might want to use as a global biasing, at the end of the ISR add a value to the TMR0 register. Thats a pritty rough outline, but it should work fine, you might find a lot of tweaking is needed to get nice linear values (odds are PWM won't provide a smooth change of light intensity with standard linear values) | |
| |