'---------------------------------------------------------------------------------------- ' Name: TIMERA_1_00n_Demo.TIG ' Type: Tiger-BASIC(tm) Source Code ' Target: N e w F e a t u r e Device Driver "TIMERA.TDD", Vers. 1.00n and later ' ' (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 ' '---------------------------------------------------------------------------------------- ' ' "TIMERA.TDD" is an 8 bit timer, that can be operated in 3 ranges for generating up to ' 25,000 samples per second or with an external trigger input to synchronize to external ' units. ' ' The ranges: 0 = stop timer ' 1 = 0.4 usec per count ' 2 = 1.6 usec per count ' 3 = 6.4 usec per count ' 4 = External trigger input pin = L70 ' ' ' ! Range ! Timebase ! Resolution ! Time range ! ' !---------+--------------+------------+------------------------! ' ! 1 ! 2,500,000 Hz ! 0.400 us ! 100.0 us ... 102.4 us ! ' ! 2 ! 625,000 Hz ! 1.600 us ! 100.8 us ... 409.7 us ! ' ! 3 ! 156,250 Hz ! 6.400 us ! 102.4 us ... 1639.3 us ! ' ' ' See Tiger-BASIC(tm) manual, help(F1) or sample programs (TIMERA*.TIG) for more details. ' '---------------------------------------------------------------------------------------- ' ' ==> N e w f u n c t i o n for Version 1.00n of this device driver: ' ' For a more convenient frequency setting of the TIMERA device driver, ' it is now possible to use a FREQUENCY value in Hz directly to set the driver ' clock rate - instead of a RANGE setting + a DIVIDER setting. ' ' Note: All previous functions also are still available! ' ' ' Set frequ.: PUT #TA, #1, ' Sec-Addr: 1, direct frequency setting ! ' Stop timer: PUT #TA, #1, 0 ' Sec-Addr: 1, value: 0 -> S T O P Timer-A ' ' ' Frequency range: 0 = STOP ' 1 = 610 Hz (minimum frequ. module type ANN-1/1) ' nnnnnnnn = 25 kHz (maximum frequ. module type ANN-1/1) ' Note: Care must be taken not to overload the system ' by too many system task calls per second. ' See manual / help for discussion on this issue. ' ' ' Note: Any INTEGER var type as: BYTE, WORD, LONG or integer constant may be used. ' Also STRING could be used - interpreting the bytes of the STRING as an integer ' value accordingly (LSB first !!). ' ' Examples: ' ' -> PUT #TA, #1, 12345 ' Sec-Addr: 1, direct frequency setting = 12345 Hz ' -> PUT #TA, #1, BYTE1 ' Sec-Addr: 1, direct frequency setting = 610 Hz (Minimum) ' -> PUT #TA, #1, WORD2 ' Sec-Addr: 1, direct frequency setting = as ' -> PUT #TA, #1, LONG7 ' Sec-Addr: 1, direct frequency setting = as ' -> PUT #TA, #1, "00 04"% ' Sec-Addr: 1, direct frequency setting = 1024 Hz ' -> PUT #TA, #1, "<1><4>" ' Sec-Addr: 1, direct frequency setting = 1025 Hz ' ' ' Note: If a requested frequency value is not exactly available, the next higher ' available frequency will be set. ' '---------------------------------------------------------------------------------------- ' ' This demo used on the "Plug + Play Lab": ' ' To hear the frequencies generated by Timer-A connect L80 (Pin 24) of the ' BASIC-Tiger to pin "PA-in" on the "Plug + Play Lab". ' Then connect the speaker and hear a sequence of tones. ' '---------------------------------------------------------------------------------------- USER_VAR_STRICT ' variables must be declared TASK MAIN ' begin task MAIN LONG N ' DIR_PORT 8, 0 ' Port 8 is output port INSTALL_DEVICE #11, "TIMERA.TDD", 3, 64 ' 2441 Hz <=== initial frequency ' INSTALL_DEVICE #1, "SET1.TDD", 80 ' <-- set high ' INSTALL_DEVICE #2, "RES1.TDD", 80 ' <-- set low again (f) INSTALL_DEVICE #2, "XOR1.TDD", 80 ' <-- generate 50% duty cycle rectangulars of (f/2) ' INSTALL_DEVICE #2, "STR1.TDD", 80 ' <-- generate strobes of (f) WAIT_DURATION 1000 ' 1 second at starting frequency LOOP 999999999 ' many loops LOOP 4 ' 4 loops FOR N = 600 TO 1800 STEP 200 ' several frequencies for Timer-A PUT #11, #1, N ' <=== set Timer-A frequency WAIT_DURATION 120 ' wait 120 ms NEXT ' next frequency FOR N = 2000 TO 800 STEP -200 ' several frequencies for Timer-A PUT #11, #1, N ' <=== set Timer-A frequency WAIT_DURATION 120 ' wait 120 ms NEXT ' ENDLOOP ' LOOP 6 ' 6 loops FOR N = 600 TO 1800 STEP 300 ' several frequencies for Timer-A PUT #11, #1, N ' <=== set Timer-A frequency WAIT_DURATION 60 ' wait 60 ms NEXT ' ENDLOOP ' PUT #11, #1, 0 ' <=== S T O P Timer-A for a moment WAIT_DURATION 1000 ' wait 1 second ENDLOOP ' END ' end of task MAIN