12f683 again. Trying to play with interupts and lost @ where to start. I tried things I thought would work but only confused myself worse. What I would like to do is set any pin to interupt and go to a sub. Read data sheet but am still pretty confused on the hardware setup. Anyone have a little code or something to read that might get me started. Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
First you must define one port (GPIO) in input with DIR command ( It must be configured as digital input , not A/D)
Then you create a new sub handler for your interrupt
Then you write "On interrupt GPIOchange call xxx (sub)"
The program 'll execute that sub when a event 'll occur on this pin and 'll return to the main loop
See the chapter "Interrupts" in GCBasic.chm and "Interrupt-on-change" in 12F683 datasheet .
If it's not enough , you can configure register IOC to determine what GPIO pin enable interrupt-on-change (register 4-5 in datasheet , 1=enable , 0=disable)
Third , you write Inton to enable interrupts and you can execute the main program
GC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
12f683 again. Trying to play with interupts and lost @ where to start. I tried things I thought would work but only confused myself worse. What I would like to do is set any pin to interupt and go to a sub. Read data sheet but am still pretty confused on the hardware setup. Anyone have a little code or something to read that might get me started. Thanks
This post is me guess I didn't log in
Hi,
First you must define one port (GPIO) in input with DIR command ( It must be configured as digital input , not A/D)
Then you create a new sub handler for your interrupt
Then you write "On interrupt GPIOchange call xxx (sub)"
The program 'll execute that sub when a event 'll occur on this pin and 'll return to the main loop
See the chapter "Interrupts" in GCBasic.chm and "Interrupt-on-change" in 12F683 datasheet .
If it's not enough , you can configure register IOC to determine what GPIO pin enable interrupt-on-change (register 4-5 in datasheet , 1=enable , 0=disable)
Third , you write Inton to enable interrupts and you can execute the main program
GC
Thanks that sent me in the right direction