> > Can anyone help me with a vaguely PIC related problem...? > > I have a project in which I need to control the brightness of a 12V lamp > from a PIC. The lamp has to go from maximum brightness to the off state. I > am planning on implementing this using varying mark-space ratios so to > minimise power loss. > I once made a similar system with a free running 8 bit (ab 100kHz) binary counter, a binary magnitude comparator and a power transistor. When the value that was set on a PC's parallel port was exceeded, the transistor turned off. I used a 24V halogen lamp, which needed about 128/255 (1/2 duty cycle) to light - so the adjustment was made about 128-255 and 0 to turn it completely off. This PWM solution can easily be implemented on a pic - if you just know how... Best regards, Vesa -- ---Tampere---a-place-in-Finland-where-everything-gets-tampered-with--- mailto://oh3nwq@nic.funet.fi http://www.funet.fi/~oh3nwq/ ---------------------------Assimilate-this----------------------------