>Does anyone have any code >they would be willing to post that will create a chirp sound? Here's code I use to make noises on a piezo element for debugging purposes. I never attempted to make it any good, so be warned. The chirp routine makes a nice pleasant sound... Dave Johnson --------------------- cblock freq, freqcount, chirpdown, endc ; ------------------------------ ; chirp subroutine - chirps up if w is zero, down if w is 1 ; ------------------------------ chirp clrf freq clrf chirpdown addlw 0x00 ; set zero flag if w is zero movlw 0x01 ; no flags change here btfss status, z ; if w not zero, make chirpdown 1 addwf chirpdown chirploop btfss chirpdown, 0 ; if chirpdown, decrement incf freq btfsc chirpdown, 0 decf freq btfss status, z ; if not zero yet, do it again goto chirpcycle return ; chirpcycle movf freq, w movwf freqcount bsf beep_pin chirploop1 incfsz freqcount goto chirploop1 ; movf freq, w movwf freqcount bcf beep_pin chirploop2 incfsz freqcount goto chirploop2 ; goto chirploop ; ------ end chirp ------ ; ------------------------------ ; beep subroutine - beeps a tone determined by w ; ------------------------------ beep movwf freq ; get frequency clrf count1 clrf count2 beeploop incfsz count1 ; increment count1, skip next instruction if it' s zero goto beepcycle return ; beepcycle movf freq, w movwf freqcount bsf beep_pin beeploop1 incfsz freqcount goto beeploop1 ; movf freq, w movwf freqcount bcf beep_pin beeploop2 incfsz freqcount goto beeploop2 ; goto beeploop ; ------ end beep ------