File: MICRO.TXT Date: 12/09/1999 The following is a list of the files available for downloading. They include BASIC and assembly language examples. All the programs were written specifically for the Micro-440e, but most can be easily adapted to the Micro-485. Some may also be adapted to be used with the Xplor-52 series. File Name Size Date Description ------------ ----- -------- ADC3X100.A51 7244 01/24/92 Sample program to sample three analog channels at an exact high speed. It is easily configurable for other channels, sample rate, or sample count. ADC_40US.A51 5103 05/04/93 This program can be used to store a block of analog data from a single analog input. The input is sampled exactly every 40 microseconds. ADC_ALL.BAS 943 01/24/92 Sample all eight analog inputs and continuously display the results on a single line. AUTOEXEC.BAS 1625 07/22/92 Initializes the controller for the autoexecute mode. The autoexecute mode allows the controller to automatically execute a program upon reset. The Autoexit.BAS program, included below, may be used in conjunction with the autoexecute mode. AUTOEXIT.BAS 1008 01/24/92 First program to have in ROMsim when using the autoexec feature. It allows you to type a space to transfer to the interpreter mode or do nothing to run the next saved program. BAUD_2ND.A51 14742 11/05/92 This file is the assembly language source file for a baud rate converter program. It is essentially the combination of BUFFER.A51 and PCA_PORT.A51. It allows buffered serial reception on the primary serial channel, and echos each character to the secondary (independent) serial channel at the baud rate specified by the BASIC program included with the assembly language source file. This is a great way to make two devices that are operating at different baud rates talk to each other. A similar function is implemented using only the primary serial channel and is titled "X_Baud_R.A51". BUFFER.A51 9659 09/23/92 This program implements a 256 byte circular buffer for receiving serial characters via the '51's on-chip UART. This is a popular program used in many applications, including those where the Micro-440e needs to receive and send characters in any type of non-standard format. DATALOG.BAS 3529 03/21/92 This program allows up to eight channels of data to be stored with a period of 1 to 3600 seconds. It uses the Real Time Clock for timing and the IDLE mode to conserve power between readings. NOTE: The program assumes that memory has been partitioned to allocate more memory to data storage. See User's Manual page 16-3, Memory Allocation. DATALOG8.BAS 3643 07/28/92 This program allows up to eight channels of data to be stored once per hour. Samples are taken every fifteen minutes and averaged to get a single data point for each hour. It uses the Real Time Clock for timing and the IDLE mode to conserve power between readings. FAN_CTRL.BAS 1858 09/30/92 This BASIC program is an updated and simplified version of the fan controller program included in chapter 6 of the Micro-440e User's Manual. It demonstrates how to use the X-10 AC Control Modules to turn a device on or off based on an analog input reading. Refer to the User's Manual for more details on this application, including specific wiring information. HEXLOAD.A51 5550 01/20/94 This program was written to allow an Intel Hex file to be loaded anywhere in RAM. The program itself is located at 7F00H to 7FFFH, so it would have to be modified, reassembled, and loaded somewhere else in order to load a hex file to memory in the range of 7F00H to 7FFFH. The Hex file created from the source file is appended to the end of the assembly language source file. The primary reason for the Hex file loading programs is to overcome the limitations of the MONITOR-51 Hex loading routine. In the standard Blue Earth Micro configuration, MONITOR-51 can not be used to load a Hex file to addresses in the range 4E00H to 4FFFH. LCD_KP1@.A51 20107 01/25/95 The attached file implements an assembly language driver for the BASIC PRINT@ Statement. When this file is executed, any characters output by the BASIC PRINT@ Statement will be directed to an LCD which is assumed to be connected to Port1 of the Micro. It also includes an interrupt driven routine for scanning a 4x4 (or 4x2) matrix keypad connected to Port1 and Port3. LCD_P1.A51 21078 07/28/93 Program to allow almost any standard character-type LCD module to be driven by a BASIC or other main program. It only requires six lines on PORT1, plus power, ground, contrast, backlighting, etc. It implements a TIMER0 Interrupt to output a command or data every 5 mS when there is a byte in the output buffer. LCD_P13@.A51 10846 07/28/93 The attached program allows almost any standard character-type LCD module to be driven by BASIC or other main program. It only requires four lines on Port1, and 2 lines on Port3 plus power, ground, contrast, backlighting, etc. The LCD data is transferred on the lower nibble of Port1 in order to allow the use of four of the five PCA module pins (P1.4-P1.7). This program implements an assembly language driver for the BASIC PRINT@ Statement. When this file is executed, any characters output by the BASIC PRINT@ Statement will be directed to the LCD. LCD_P1L.A51 21376 07/28/93 This program allows almost any standard character-type LCD module to be driven by BASIC or other main program. It only requires six lines on Port1, plus power, ground, contrast, backlighting, etc. The LCD data is transferred on the lower nibble of Port1 in order to allow the use of a serial printer on P1.6 and P1.7. This interface should not be used with the application Module, since the beeper on P1.3 will affect the signal transition times. Also see "LCD_P1.A51". This program implements a TIMER0 Interrupt to output a command or data every 5 mS when there is a byte in the output buffer. LCD_P1P3.A51 21191 07/28/93 This program allows almost any standard character-type LCD module to be driven by BASIC or other main program. It only requires four lines on Port1, and 2 lines on Port3 plus power, ground, contrast, backlighting, etc. The LCD data is transferred on the lower nibble of Port1 in order to allow the use of four of the five PCA module pins (P1.4-P1.7). This program implements a timer interrupt to output a command or data character every 5 mS when there is a byte in the output buffer. LCD_P@.A51 10630 07/28/93 This program implements an assembly language driver for the BASIC PRINT@ Statement. When this file is executed, any characters output by the BASIC PRINT@ Statement will be directed to an LCD which is assumed to be connected to PORT1 of the Micro-440e. MOVBLOCK.A51 3289 04/13/92 This file is an assembly language subroutine that can be called from BASIC to transfer a large block of data from one location in External RAM to any other valid, non-overlapping location. PCA2@ODD.A51 22628 01/19/96 This program implements a full duplex interrupt driven serial port on the Micro-440e's primary and secondary serial ports. It also supports odd parity. Most of the code (excepts for the support for parity) was taken from the PCA_2Buf.A51 program PCACOUNT.A51 4879 07/23/92 This program sets up the PCA to count pulses. An overflow interrupt increments a register so a total of 65,535+255*65,536=16,777,215 pulses can be counted. Also included is a BASIC program that can be used if no overflow detection is necessary. Up to 65,535 pulses could then be counted. PCA_2BUF.A51 22991 03/09/95 This file implements a full duplex software serial port on the Micro-440's Rxd2 and Txd2 (P1.6 and P1.7, respectively) using the PCA as the time base for both send and receive. It also incorporates interrupt-driven communications on the primary serial port (taken from the BUFFER.A51 program). The default baud rate for the second port is 9600 baud, but it can be changed either in the assembly language program or from the main (BASIC) program. A sample BASIC program is also included. PCA_FREQ.A51 6765 03/05/92 This file enables the PCA to measure the frequency input on P1.3. The "REGFX.INC" file is necessary in order to assemble this program. PCA_PORT.A51 13821 12/13/94 This example implements a full duplex software serial port on the Micro-440e's Rxd2 and Txd2 (P1.6 and P1.7, respectively) using the PCA as the time base for both send and receive. It was tested for several hours at 4800 baud with no apparant malfunctions. PCA_RXD2.A51 10576 04/18/94 The attached file uses the PCA to generate a software serial port receiver on the Micro's second serial port using the PCA. It puts received characters into memory. Since it is interrupt driven, there is little overhead to BASIC. Note that the second serial port is set up as receive only in this driver. Other drivers for transmit and bi-directional serial ports are also available. PCA_TXD2.A51 10475 02/25/93 This file uses the PCA to generate a software serial port on the Micro's second serial port using BASIC's PRINT@ statement. The baud rate can be initialized from BASIC. The PCA driven serial port has much less software overhead (it is interrupt driven) than BASIC's software serial port using the PRINT# statement. The second serial port is set up as transmit only in this driver. PL513B.A51 5362 12/09/93 The X-10 Transmit software driver for the PL513 has been updated to include support for Bright and Dim codes. Code has also been added to support 3-phase power systems. The attached source file also includes a hex file at the end that may be downloaded directly to your controller. The bi-directional software to support the TW523 transceiver module is currently not available. PORT13IO.BAS 2910 12/08/99 Sample program to demonstrates how to write values to the CPU I/O Port pins. It includes individual example lines of code for writing each of the available Port1 and Port3 pins high and low. PORT3.BAS 1029 01/24/92 Sample program to exercise the MOSFETs on the Application Module. PULSEWID.A51 8864 02/13/92 This file enables the PCA to measure pulse width for up to 4 input channels. The "REGFX.INC" file is necessary in order to assemble this program. PWM_PCA.BAS 2315 09/09/92 This program can be used to set up the PCA to generate a PWM output at a user specified frequency. The duty cycle is determined by the input to the ADC channel 8. READ_RTC.A51 11159 07/14/92 This file includes assembly language subroutines for accessing the Micro-440e's Real Time Clock/Calendar (RTC). These include setting and reading the clocks registers. Also included is a routine to format the output to ASCII characters for printing to a terminal or display. REGFX.INC 2912 09/20/90 This file contains all the register declarations for the 8xC51FA/FB series of processors. This is used with the assembly language "$NOMOD51" and "$INCLUDE(REGFX.INC)" directives. ROMSFILL.BAS 8708 07/08/92 This file can be used to fill up the Micro-440e's ROMsim area with REM Statements in applications where the actual system BASIC program is stored in an external memory device (typically an EPROM or EEPROM). TENMSINT.A51 4481 02/13/92 Set up TIMER0 to generate an interrupt every 10 milliseconds. This program can be easily adapted to other interrupt periods. X_BAUD_R.A51 12513 11/18/92 This file allows the transmit and receive channels on the primary serial port to be programmed for different baud rates. The assembly language routine can be used to simply set up the serial port, or to also implement an interrupt driven receive buffer with an automatic echo function (at an independent baud rate). Note that this only uses the primary serial channel. A similar program that can be used to echo characters on the secondary serial channel is posted named "Baud_2nd.A51".