Debbie Hynes wrote: > pity 'bout the ol'F84 being obsolete - my fav processor. When Olin says the 16F84 is obsolete, all he really means is that he doesn't use it. There are other PICs that may cost less and/or have more features, but the 16F84 is still in production and isn't going away any time soon. > i'll have a fiddle with programming a PWM o/p & see how i go. Here's a bit of code that may help; it assumes that your PIC is running at 4 MHz. As as often the case with code I post to the list, this has neither been tested nor even assembled... But this isn't exactly rocket science, so I'd be surprised if it didn't work: LIST R=DEC COUNT EQU [ANY REGISTER] MS EQU [ANOTHER REGISTER] TOGGLE EQU 00000001B ;ALL ZEROES, WITH A SINGLE ;"1" IN THE POSITION THAT ; CORRESPONDS TO THE LED ;(THIS EXAMPLE ASSUMES ;THAT THE LED IS ON RB0). ; SEND A MODULATED (38 KHZ) PULSE. ENTER WITH THE LED ; OFF, AND WITH W HOLDING THE DESIRED LENGTH OF THE ; PULSE IN MILLISECONDS; EXITS WITH LED OFF. ASSUMES ; THAT THE LED IS ON PORTB AND IS HIGH-TRUE. PULSE: MOVWF MS OUTER: MOVLW 76 MOVWF COUNT MOVLW TOGGLE INNER: XORWF PORTB NOP GOTO $+1 GOTO $+1 GOTO $+1 GOTO $+1 DECFSZ COUNT GOTO INNER NOP XORWF PORTB GOTO $+1 GOTO $+1 GOTO $+1 DECFSZ MS GOTO OUTER GOTO $+1 ;THESE THREE LINES AREN'T REALLY GOTO $+1 ;NECESSARY; YOU CAN SAFELY DELETE NOP ;THEM. BCF LED RETURN Good luck... -Andy === Andrew Warren -- aiw@cypress.com === Principal Design Engineer === Cypress Semiconductor Corporation === === Opinions expressed above do not === necessarily represent those of === Cypress Semiconductor Corporation -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body