' ********************************************************************** ' * File: uk_BAS51_006.BAS * ' * Version: 1.1 * ' * Date: 26.04.10 * ' * Development Tools: Bascom 8051 COMP.,IDE 2.0.14.0 + FLIP 2.4.6 * ' * Cards: GMM 5115 + GMM TST3 * ' * Developed by: GRIFO(r) Italian Technology * ' * via Dell'Artigiano 8/6 * ' * 40016 S. Giorgio di Piano (BO) * ' * Tel. +39 051 892052 Fax. +39 051 893661 * ' * http://www.grifo.com http://www.grifo.it * ' * Author: Gianluca Angelini * ' ********************************************************************** ' Example program 006 of BASCOM 8051 course. ' It executes simple operations on digital I/O, by using the GMM 5115 on board ' LED. ' The program generates a base timing of one second that changes status to ' activity LED DL1. The base timing is generated by proper WAITMSE instruction ' of BASCOM 8051, that generates a variable delay from 1 to 65535 milliseconds. ' ' Added instructions: WAITMSE. ' ' 26/04/10: uk_BAS51_006.BAS - Ver 1.1 - By G.A. ' First version. ' ' '**************************** IDE Configurations ******************************* ' NOTE: in order to coorectly use this demo program, please execute the following ' steps: ' 1) Check the availability of 89C5115.DAT file into the directory where the ' BASCOM 8051 is installed and copy it if not present. ' 2) Into the window "Options | Compiler | Misc" set: ' Register File = 89C5115.DAT ' Byte End(Hex) = A0 ' Size warning = selected at 16384 (=4000H) '************************* Compiler directives ********************************* $regfile "89C5115.DAT" ' Definitions file for used microcontroller $romstart = &H0 ' Code start address on FLASH $iramstart = &H0 ' Data start address on internal RAM $ramstart = &H0 ' Data start address on external RAM $ramsize = &H100 ' External RAM size $crystal = 14745600 ' Microcontroller crystal frequency $large ' Code size > 2K $map ' Generate debug information '******************************* Definitions *********************************** ' The resources used by program are connected as described in following table: ' ' Resource GMM TST3 Z1 pin GMM 5115 pin uP signal ' LED DL1 33 27 P1.0 Pindl1 Alias P1.0 ' Signal connected DL1 on GMM 5115 '************************* Constants declaration ******************************* '************************* Variables declaration ******************************* Dim Dl1stat As Bit ' Boolean variable for DL1 LED status '************************ Subroutines declaration ****************************** '****************************** Main program *********************************** Main: Pindl1 = 1 ' Initialize signal connected to DL1 as digital output, high Dl1stat = 1 ' Initialize DL1 status as disabled Do ' Begin endless loop Dl1stat = Not Dl1stat ' Invert variable with DL1 status Pindl1 = Dl1stat ' Set DL1 LED with new status ' Perform 1 second delay: uses proper instruction WAITMSE Waitmse 1000 ' Perform a delay of 1000 milliseconds=1 second Loop ' End endless loop End '*************************** End of main program *******************************