PWM Code Help

Status
Not open for further replies.

Suraj143

Active Member
I have a strange problem.If I comment the delay line the code works fine.With that delay line I cannot hear any sound.

Code:
Init_PWM	movlw	b'00001100'	; PWM Mode
		movwf	CCP1CON
		movlw	b'00000010'	; PS=1:16,T2=ON,Post=1:1
		movwf	T2CON
		bsf	STATUS,RP0	; b0
		movlw	.15
		movwf	PR2
		bcf	STATUS,RP0	; b0
		movlw	.8		; 125 = 50% duty cycle
		movwf	CCPR1L
		bsf	T2CON,2		; enable TMR2
			;			
		[COLOR="Red"]call	Del_1S[/COLOR]
		clrf	CCPR1L
;			;
Wait_Here	goto	Wait_Here
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…