Hi! > i don't have the working code for the PIC but i can tell you the >basic idea of PWM. what you do is you start the counter and at the same >instant set some port bit to one (i.e. high). then you keep on comparing >the timer value with the digital value, which is supposed to modulate >the pulse width. e.g. it could be the digitised feed back voltage in a >PWM controlled poer supply. the moment the value of the timer becomes >equal to the digital value, port bit is reset to zero. now the port bit >will remain low untill the timer overflows. after which new cycle starts. > so note that the pulse width is effectively proportional to the >value of the digital word. larger the digital value more time the timer >will take to reach the value and hence the pulse width will be larger. >with the serial ports of 16cxx PICs, it should be easy to get the PWM. > i hope you got some idea about the pulse width modulation. Wow! To tell you the thruth, I didn't quite understand what your tried to explain to me about PWM! Maybe someone would have a different explanation? Or maybe just a different way to explain it to me? (Sorry for all does 'explain'!) Thank you! Jean-Francois --------------- Jean-Francois & Alain Joly jolyal@capitalnet.com