here is my code for pic16f72 ,i want to generate a beep for 2 sec without pause inside the inverter loop when program shift from acmode: to inverter: mode or inverter to acmode ,i used sound command but it gives pause of 2 sec,i m using piezo buzzer driven by bc 547 ,hpwm pin is also free any sugestion?
INVERTER:
;---------------------
b1=1
pauseus x
b1=0
pauseus y
;------------------------
adcin 1,ct
adcin 2,batt
if ct > 127 then loadtrip
if batt < 50 then lowbatttrip
if batt >127 then
LED20=1:led40 =1:led60=1:led80=1:led100=1
endif
if batt < 127 and batt>120 then
led20=1:led40 =1:led60=1:led80=1:led100=0
endif
if batt < 120 and batt>110 then
led20=1:led40 =1:led60=1:led80=0:led100=0
endif
if batt < 50 then
led20=1:led40 =1:led60=0:led80=0:led100=0
endif
'------------------------
b2=1
pauseus x
b2=0
pauseus y
;---------------------------
adcin 0,ac
adcin 3,fixvolt
if fixvolt > 127 then
z=z+10
endif
if fixvolt < 127 then
z=z-10
endif
while z>9000
z=9000
wend
while z<1000
z=1000
wend
x=9000-z
y=1000+z
if ac > 127 then acmode
If SW = 0 Then SWITCH
'----------------
goto inverter
Bookmarks