Jean-Francois Joly wrote: > > Hello everyone! > > I have a little program here wich generates PWM but it doesn`t work. When I > run it on my PIC16C84-04, all PORTB pins are low, that`s all... no pulse! Can > someone take the time to check it out? (File attached to this message) I tried > to find the problem, but coudn`t! > > Thank you! > Jean-Francois > > --------------------------------------------------------------- > > Part 1.2 Name: PWM.ASM > Type: Plain Text (text/plain) > > --------------------------------------------------------------- > > --------------- > Jean-Francois & Alain Joly > jolyal@capitalnet.com Hi, Problems is two: 1.then interrupt occurs GIE bit resets by hardware! Set GIE bit & then do RETFIE : CONT bsf INTCON,GIE retfie & PORTOFF subroutine end with: goto CONT 2.T0IF not resets by harware ! You need reset it in interrupt subroutine : ORG 0X004 bcf INTCON,T0IF ; bsf INTCON, T0IF ;nounsence !!!!! ........... with this modifications Your program works ! Best regards, Saras.