Quote Originally Posted by ERIK
Hey Peu, I'm working on pretty much the same thing with a 12F675 PWMing to 3 Mosfets. Everything is working well except I'm finding when I PWM from GP2 and GP4 the MOSFETs don't really pulse they pretty much just stay on, or switch off when the cycle gets low enough. I'm not sure why, I've poked the ANSEL and CMCON, but it seems maybe the output voltage on those pins is a little different or something. Anyone have any ideas what might be going on? I see you are driving your green channel with GP2, does that work fine for you?
I used this header in a previous version that used gpio.0 as an adc input and 1,2 and 4 as the pwm channels

@ device pic12F683, intrc_osc_noclkout, wdt_on, mclr_off, protect_off
@ device INTRC_OSC_NOCLKOUT
DEFINE OSC 4

trisio =%00000001
ansel =%00000001 'analog off except gpio.0
cmcon0 =%00000111 'Comparators Off
pasos con 16
ciclos con 10
conta var byte
puerto var byte


and this is the routine I use for the led brightness increase:

for conta=0 to 255 step pasos 'Rise routine
pwm puerto, conta, ciclos ; puerto is the port to be used
next conta
high puerto ; after it reached the top brightness, set port high
return


you can use the same routine for decreasing, just change the for next and put a LOW after the loop instead of the high.

hope it helps


Pablo