something wrong with my interrupts

im making a simple programme for an led flashing and a speaker going off when something happens and to deacvitiate the ldr and led i have to press an other switch which will be detected by an interrupt. im using a 08-m pic.
this is my programme from when the interrupt is set to when the interrupt stops:

alarm: setint %00001000,%00001000
high red
tune part 1
low red
high blue
tune part 2
low blue
goto alarm

interrupt: high 3
goto sense
return

my problem is that when i try to upload the programme the syantax thing says that i can't use pin 3 as an output but i don't want pin 3 as an output, i want it as an input (and pin three is an input) and when i push a switch i want the pin 3 to detect that i pushed the switch (pin 3 goes high)and then go back to waiting for the led and speaker trigger (sense).
can you please tell me what is wrong and please give me the right programme. you don't really have to worry about the speaker and leds because its just the interrupt that doesn't work.

Edited by - annoyin_kid on 05/10/2006 22:31:17
 
also if it is possible can someone upload the picaxe installer (bas805.exe) onto another website and give me the url because the doesn't download properly in newzealand for someone reason and i always have to goto school to test something new. pls help.
if u want u can also email to me annoyin_kid@gmail.com
 

inglewoodpete

Senior Member
Lets clear up your intentions. From your code, when an interrupt occurs, the first thing you're trying to do is make (input) pin 3 high? The command "High 3" would automatically try to set the pin as an output. The syntax checker is just trying to do its job.

SetInt should be followed by 2 bytes, not 1.

As an aside, I noticed that you don't re-initialise the interrupts.

Edited by - inglewoodpete on 05/10/2006 04:46:57
 
no i want pin 3 to detect that i pushed the switch by senseing that there is electricity flowing to it.
then i want it to stop everything it was doing and go back to waiting for something to trigger the speaker and leds.
also i didn't want the interrupt to be set again.

in other words do i have to tell the interrupt when the programme gets upto the "interrupt:" bit that i want it to only goto sense if there is power going to pin three or does setint do that for me?

Edited by - annoyin_kid on 05/10/2006 22:34:26
 

hippy

Ex-Staff (retired)
Yes, SETINT does everything for you. You will only reach the 'Interrupt:' label when Pin 3 has gone high.
 
Top