Searching \ for '[PIC]:PIC16F877 - PWM&JAL five second beep.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=pwm
Search entire site for: 'PIC16F877 - PWM&JAL five second beep.'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:PIC16F877 - PWM&JAL five second beep.'
2001\01\19@043611 by Vasile Surducan

flavicon
face
Five seconds beep, one second pause...


var bit pwm1 is pin_c2
-- pin_c2_direction = output

var byte lenght = 5
var byte pause  = 1

procedure frequency ( byte in period, byte in prescale ) is
asm movf  period, w
bank_1
asm movwf f877_pr2
bank_0
 f877_ccpr1l = period / 2       -- set duty cycle at approx 0.5
 pin_c2_direction = output

  if prescale == 16 then
    f877_t2con = 0b_0000_0110   -- tmr2 on, prescale=16
  elsif prescale == 4 then
    f877_t2con = 0b_0000_0101   -- tmr2 on, prescale=4
  elsif prescale == 1 then
    f877_t2con = 0b_0000_0100   -- tmr2 on, prescale=1
  end if
 f877_ccp1con = 0b_0000_1100    -- pwm mode on
end procedure


procedure stop is
delay_1S ( lenght )
f877_ccp1con = 0             -- PWM off
delay_1S ( pause )
end procedure

procedure DO1  is frequency ( 238, 16 ) stop end procedure
procedure MI1  is frequency ( 189, 16 ) stop end procedure
procedure SOL1 is frequency ( 158, 16 ) stop end procedure
procedure DO2  is frequency ( 118, 16 ) stop end procedure


-- main program

forever loop

DO1  MI1 SOL1  DO2

end loop




On Thu, 18 Jan 2001, Tom Mariner wrote:

{Quote hidden}

> {Original Message removed}

More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...