Post up the code you have (use the "code /code " tags) and state what the actual problem is and I'm sure someone will offer assistance
Post up the code you have (use the "code /code " tags) and state what the actual problem is and I'm sure someone will offer assistance
Hi I am using tmro interrupt.
My program is;
anyone can help me for this?Code:@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF &_BODEN_ON & _LVP_OFF & _DATA_CP_OFFON INTERRUPT GoTo VAIL OPTION_REG=000001 define OSC 4 CMCON=7 INTCON=100000 trisa=0 trisb=0 porta=0 portb=0 SYMBOL SES=PORTA.1 t var word a1 var byte a var byte x var byte a=0:a1=55:t=0:x=0 tmr0=55 wail: goto wail VAIL: disable TOGGLE SES t=t+1 if t=20 and a=0 then t=0 a1=a1+1 if a1>242 then a=1 endif if t=125 and a=1 then t=0 a1=a1+1 if a1>245 then a=2 endif if t=125 and a=2 then t=0 a1=a1-1 if a1<242 then a=3 endif if t=20 and a=3 then t=0 a1=a1-1 if a1=<55 then a=0 endif tmr0=a1 INTCON.2=0 resume enable end
well this may be one reason... it's looping but doing nothing in-betweenCode:a=0:a1=55:t=0:x=0 tmr0=55 wail: goto wail VAIL: disable
I think that is ok, it loops until tmr0 interrupts on overflow.
I have never used ON INTERRUPT, but I see some mistakes probably from cut and paste. ON INTERRUPT should be on a separate line, not in the configurations
OPTION_REG and INTCON need % in front of the binary numbers
enable at the end of the code will never happen, since resume returns us to the main program.
What else?
Code:@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF &_BODEN_ON & _LVP_OFF & _DATA_CP_OFFON INTERRUPT GoTo VAIL OPTION_REG=000001 define OSC 4 CMCON=7 INTCON=100000 trisa=0 trisb=0 porta=0 portb=0 SYMBOL SES=PORTA.1 t var word a1 var byte a var byte x var byte a=0:a1=55:t=0:x=0 tmr0=55 wail: goto wail VAIL: disable TOGGLE SES t=t+1 if t=20 and a=0 then t=0 a1=a1+1 if a1>242 then a=1 endif if t=125 and a=1 then t=0 a1=a1+1 if a1>245 then a=2 endif if t=125 and a=2 then t=0 a1=a1-1 if a1<242 then a=3 endif if t=20 and a=3 then t=0 a1=a1-1 if a1=<55 then a=0 endif tmr0=a1 INTCON.2=0 resume enable end
Hi Marks
You are right. İt is problem related to copy paste selection.
I looked to my program on the editor mode, it is right.
I am using this program on the isus simulation program.
All commands is good, without one position.
High frequency sound is very bad. I am trying to make good sound this frequency.
I asked you , if you have sapmle code related this program pls share for me.
Thank you for your interest.
I found this on the net, no idea if it works, but the code is very well commented and may help you with your project. Note the hardware too
https://www.scribd.com/doc/103363423...icrocontroller
And another project, but in mikroC which may be easier to convert to PBP http://www.electroschematics.com/873...ecurity-alarm/
Last edited by Scampy; - 20th May 2016 at 09:07.
Hi Scampy;
Thank you for your solutions.
I saw this project on the web, these are related , simple siren sound.
I wanna professional siren sound. I saw more softwear on the web, all softwear writing asm language.
Then I decide to learn asm.
İt is mine solutions.
Thank you![]()
Bookmarks