Hi makson,

Not the easiest way to drive 3 LED's is it?

Well, I'm going to make it sound even harder.

The 6280 has 10-bit PWM counters. So, to get around 100hz PWM to the LED's, you'll need about 100 Khz going to the clock input continuously.

This can be easily acheived with the CCP module of the 16F628, but you can't use the HPWM command because the frequency is too high, so the registers will have to be set manually.

Now for the hard part.

Using SHIFTOUT to send the data may cause blinking when you update the PWM values. You would need to turn off the CCP module to allow SHIFTOUT to control the clock pin, shift the data out, then turn on the CCP module again to keep the clock going.

It's possible that you may not even be able to see it because it will be more of an elongation of 1 PWM cycle, so you should try that way first.

If it is noticable, you'll need to manually shiftout the data "In Sync" with the CCP clock cycles, which can be done with the TMR2IF flag. But try it with SHIFTOUT first to see if there's a problem or not. If there is, I can show you how to "sync" the data.

HTH,