'---------------------------------------------------------------------------------------- ' Name: Interrupts.tig ' Type: TIGER-BASIC(tm) Source Code ' Purpose: shows functionality of the Tiger2 Interrupts ' ' (C) - Copyright Wilke Technology, P.O.Box 1727, D-52018 Aachen, Germany '---------------------------------------------------------------------------------------- ' ' Thank you for using BASIC Tigers in your products. If you have questions, ideas ' or special needs, please contact your next distributor or the Tiger support team ' and visit our web site: ' ' Wilke Technology GmbH ' The Tiger Support Team ' P.O.Box 1727, D-52018 Aachen, Germany ' Krefelder Str. 147, D-52070 Aachen, Germany ' ' email: support@wilke-technology.com (english) ' email: support@wilke.de (german) ' Phone: +49 (241) 918 900 Mo to Fr, 7:00 to 16:00 (GMT) ' Fax: +49 (241) 918 9068 ' ' New information, new drivers and free downloads see: ' ' www.wilke-technology.com (english) ' www.wilke.de (german) ' ' Sincerely, ' ' Your Tiger Support Team ' '---------------------------------------------------------------------------------------- ' ' required Hardware: Tiger 2 ' ' This programm Counts Interrupts at INTM0 and INTM1 ' and the Timer Interrupt ' ' ' Note: ' In PC-Mode, the Interrupts must be E N A B L E D in the Tiger IDE. ' ' Please Check Debug->Interrupts... ' These settings are primary!!! ' '---------------------------------------------------------------------------------------- #include define_a.inc '---------------------------------------------------------------------------------------- ' global variables '---------------------------------------------------------------------------------------- long INT1 long INT2 long INT3 long INT4 long main_cnt byte int2out task main '----------------------------------------------------------------------------------------------------- ' Reset the LCD '----------------------------------------------------------------------------------------------------- dir_pin 8,5,0 ' Tiny Tiger 2 Prtotyping Board: This is the RESET of the LCD OUT 8, 255, 0 ' Reset the LCD OUT 8, 255, 255 ' Be sure there is no reset more wait_duration 500 ' wait that the LCD is not busy '----------------------------------------------------------------------------------------------------- ' Install the Device '----------------------------------------------------------------------------------------------------- install_device #0, "LCD-S1D13700.TD2",0,0,0EEH,1,250, 02H dir_pin 3, 7, 0 ' init Vars INT1 = 0 INT2 = 0 INT3 = 0 INT4 = 0 main_cnt = 0 int2out = 0 ' show startvalues print #0, "<1BH>A"; CHR$(0); CHR$(0); "<0F0H>"; "Loop : " ; main_cnt' print #0, "<1BH>A"; CHR$(0); CHR$(1); "<0F0H>"; "INTM1: " ; INT1 ' print #0, "<1BH>A"; CHR$(0); CHR$(2); "<0F0H>"; "Timer: " ; INT2 ' print #0, "<1BH>A"; CHR$(0); CHR$(3); "<0F0H>"; "INTM3: " ; INT3 ' print #0, "<1BH>A"; CHR$(0); CHR$(4); "<0F0H>"; "INTM4: " ; INT4 ' ' set_int eins, 1 ' ! ! ' ! Interrupt number (1: INTM1 2: Timer 3: INTM3) ' ! ' Interrupt Task ' set interrupt vectors set_int INT_TASK_1, 1 ' set_int INT_TASK_2, 2 ' set_int INT_TASK_3, 3 ' set_int INT_TASK_4, 4 ' ' config_timer_int 2, 62500, 10 ' Konfiguriere Timer Interrupt ( 4 sec ) ' ! ! ! ' ! ! Postscaler ' ! ! ' ! Interval ' ! ' Prescaler ' ' 0,4s / 6,4s * 10 = 4s ' config_timer_int 2, 62500, 10 ' configure Timer Interrupt ( 4 sec ) ' enable_int 255, 0 ' ! ! ' ! 0= buffered 1= unbuffered ' ! ' Interrupt Number OR 255 = ALL enable_int 255, 0 ' enable ALL Interrupts ' disable_int 0 ' ! ' Interrupt Number OR 255 = ALL while 1=1 ' LOOP TOP print #0, "<1BH>A"; CHR$(0); CHR$(0); "<0F0H>"; "Loop : " ; main_cnt' print #0, "<1BH>A"; CHR$(0); CHR$(1); "<0F0H>"; "INTM1: " ; INT1 ' print #0, "<1BH>A"; CHR$(0); CHR$(2); "<0F0H>"; "Timer: " ; INT2 ' print #0, "<1BH>A"; CHR$(0); CHR$(3); "<0F0H>"; "INTM3: " ; INT3 ' print #0, "<1BH>A"; CHR$(0); CHR$(4); "<0F0H>"; "INTM4: " ; INT4 ' wait_duration 50 ' main_cnt = main_cnt + 1 ' endwhile ' endwhile 1=1 end inttask INT_TASK_1 INT1 = INT1 + 1 ' count Interrupts end inttask INT_TASK_2 int2out = int2out bitxor 255 ' OUT 3, 10000000B, int2out ' toggle L37 INT2 = INT2 + 1 ' count Interrupts end inttask INT_TASK_3 INT3 = INT3 + 1 ' count Interrupts end inttask INT_TASK_4 INT4 = INT4 + 1 ' count Interrupts end