summaryrefslogtreecommitdiffstats
path: root/test/boost/interrupt.pic16.bas
diff options
context:
space:
mode:
Diffstat (limited to 'test/boost/interrupt.pic16.bas')
-rw-r--r--test/boost/interrupt.pic16.bas34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/boost/interrupt.pic16.bas b/test/boost/interrupt.pic16.bas
new file mode 100644
index 0000000..370e582
--- /dev/null
+++ b/test/boost/interrupt.pic16.bas
@@ -0,0 +1,34 @@
+#include <basic\PIC16F877.bas>
+'
+' Basic sample for BoostBasic compiler.
+' Use the "Led Block" plugin to see
+' changing value on port B.
+'
+
+' Set configuration word (sample only, ajust for your particular case)
+#pragma DATA _CONFIG, _HS_OSC & _WDT_OFF
+
+Sub interrupt()
+
+ portb = portb + 1
+
+ intcon = intcon & ~(1 << T0IF) 'clear TMR0 overflow flag
+
+End Sub
+
+Sub main()
+
+ trisb = 0 'configure port B
+ portb = 0 'clear port B
+
+ option_reg = 7 'set prescaler
+
+ ' enable interrupts
+ intcon = intcon | (1 << T0IE) 'enable TMR0 overflow bit
+ intcon = intcon | (1 << GIE) 'set global interrupt bit
+
+ ' endless loop
+ Do while 1
+ Loop
+
+End Sub