![]() |
|
| Roadmap to Sample Programs | |
Sample programs are provided in the Dynamic C
SAMPLESfolder. The various directories in theSAMPLESfolder contain specific sample programs that illustrate the use of the corresponding Dynamic C libraries with particular boards.
RabbitNet Peripheral Cards General Board Operation
Digital I/O
A/D Converter
D/A Converter
Relay Outputs
Keypad/Display Interface
Most of the sample programs for RabbitCore modules are based on peripherals available on the Prototyping Board associated with the specific RabbitCore module, and so the Prototyping Board is required to run the sample programs. Sample programs illustrating the LCD/keypad require the optional LCD/keypad module.
Rabbit 2000 Based RabbitCore Modules General Board Operation
Digital I/O
Serial Communication
TCP/IP
LCD/Keypad
Click here for a roadmap to TCP/IP sample programs that are not board-specific.
1.1 BL1800
1.1.1 Digital I/O
DEMOJR1.CThis program flashes LED DS3 on the Jackrabbit Prototyping Board.
DEMOJR2.CThis program flashes LED DS3 on the Jackrabbit Prototyping Board and illustrates the use of the Dynamic Crunwatch()function call.
DEMOJR3.CThis program flashes LED DS4 on the Jackrabbit Prototyping Board and will toggle DS1 on/off when pushbutton switch S1 is pressed. This program also illustrates the use of Dynamic C costatements.
JRIOTEST.CThis program exercises the JackRabbit's 4 digital output channels, the 2 analog output channels, and the one analog input channel.
RABDB01.CThis sample program flashes LEDs DS5DS8 lights on the Jackrabbit Prototyping Board, and flashes LEDs DS1DS4 when pushbutton switches S1S4 are pressed. The buzzer will sound whenever pushbutton switch S1 is pressed.
RABDB02.CThis sample program flashes LEDs DS5DS8 lights on the Jackrabbit Prototyping Board, and flashes LEDs DS1DS4 when pushbutton switches S1S4 are pressed. The buzzer will sound whenever pushbutton switch S1 is pressed.1.1.2 A/D Converter
1.1.3 Serial Communication
JR_FLOWCONTROL.CThis sample program requires two boards and demonstrates RS-232 flow control.
JR_PARITY.CThis program sends byte values 0127 from Serial Port B to Serial Port C, and will switch between generating parity and not generating parity, which Serial Port C will be checking for.1.1.4 LCD/Keypad
LCD_DEMO.CThis sample program illustrates using the Rabbit 2000 external I/O to drive an LCD that uses the HD44780 controller or an equivalent.1.2 BL2000
1.2.1 General Board Operation
BOARD_ID.CThis program is used to identify the model of BL2000 being used, and display that information in the STDIO window.
COUNTLEDS.CThis program will count from 0 to 31 in binary, using the four general- purpose LEDs, DS4DS7, and the Processor Bad LED, DS8. The LEDs are used in reverse logical order to minimize the cycling of the relay, which is slaved to the same output as DS4.
LEDS_4.CThis program creates four "devices" (lights), and four buttons to toggle them. Users can view the devices with their Web browser, and change the status of the lights. If the Demonstration Board is connected to the BL2000, the lights on the Demonstration Board will match the ones on the Web page. See Appendix D of the BL2000 User's Manual for hookup instructions for the Demonstration Board.1.2.2 Digital I/O
ANADIGIN.CDemonstrates using the A/D converter channels as digital inputs. You will be able to see an input channel toggle HIGH and LOW when pressing the pushbuttons on the Demonstration Board.
DIGIN.CDemonstrates the use of the digital inputs. Using the Demonstration Board, you can see an input channel toggle from HIGH to LOW when pressing a pushbutton on the Demonstration Board.
DIGOUT.CDemonstrates the use of the high-current outputs. Using the Demonstration Board, you can see an LED toggle on/off via a high-current output.
LED.CDemonstrates how to toggle the output LEDs on the BL2000 on/off.
PWM.CDemonstrates the use of Timer B to generate a PWM signal on digital output OUT8. The program generates a 42 Hz PWM signal with the duty cycle adjustable from 1 to 99%.1.2.3 A/D Converter
AD_CALIB.CDemonstrates how to recalibrate an A/D converter channel using two known voltages to generate two coefficients, gain and offset, which are rewritten into the user block data area. The voltage that is being monitored is displayed continuously. Note that this sample program will overwrite the calibration constants set at the factory.
AD1.CDemonstrates how to access the A/D internal test voltages in the TLC2543 A/D converter chip. The program reads the A/D internal voltages and then uses the STDIO window to display the RAW data.
AD2.CDemonstrates how to access the A/D channels using theanaInVolt()function. The program uses the STDIO window to display the voltage that is being monitored.
AD3.CDemonstrates how to access the A/D converter channels with the low-level A/D driver. The program uses the STDIO window to display the voltage that is being monitored on all the A/D channels using the low-level A/D driver.
AD4.CDemonstrates how to use the A/D converter channels with the low-level A/D driver. The program uses the STDIO window to display the voltage (average of 10 samples) that is being monitored on all the A/D converter channels using the low-level A/D driver.1.2.4 D/A Converter
DACAL.CThis program demonstrates how to recalibrate an D/A converter channel using two known voltages, and defines the two coefficients, gain and offset, that will be rewritten into the D/A converter's EEPROM simulated in flash memory. Note that this sample program will overwrite the calibration constants set at the factory.
DAOUT1.CThis program outputs a voltage that can be read with a voltmeter. The output voltage is computed using the calibration constants that are read from the EEPROM simulated in flash memory.
DAOUT2.CThis program demonstrates the use of both the D/A and the A/D converters. The user selects both the D/A converter and A/D channel to be used, then sets the D/A converter output voltage to be read by the A/D channel. All activity will be displayed in the STDIO window.1.2.5 Serial Communication
PUTS.CTransmits and then receives an ASCII string on Serial Ports B and C. It also displays the serial data received from both ports in the STDIO window.
RELAYCHR.CThis program echoes characters over Serial Port B to Serial Port C. It must be run with a serial utility such as HyperTerminal.
MASTER.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave BL2000. The slave will send back converted upper case letters back to the master BL2000 and display them in the STDIO window. UseSLAVE.Cto program the slave BL2000.
SLAVE.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave BL2000. The slave will send back converted upper case letters back to the master BL2000 and display them in the STDIO window. UseMASTER.Cto program the master BL2000.1.2.6 Relay Outputs
1.2.7 TCP/IP
SSI.CThis program demonstrates how to make the BL2000 a Web server. This program allows you to turn the LEDs on an attached Demonstration Board from the Tool Kit on and off from a remote Web browser. LEDs DS4DS8 on the BL2000 will match those on the Web page. As long as you have not modified theTCPCONFIG 1macro in the sample program, enter the following server address in your Web browser to bring up the Web page served by the sample program.
SMTP.CThis program allows you to send an E-mail when a switch on the Demonstration Board is pressed. Follow the instructions included with the sample program.
TELNET.CThis program allows you to communicate with the BL2000 using the Telnet protocol. This program takes anything that comes in on a port and sends it out Serial Port B. It uses digital input IN0 to indicate that the TCP/IP connection should be closed, and it uses high-current output OUT0 to indicate that there is an open connection. You may change the digital input and output to suit your application needs.1.3 BL2100
1.3.1 General Board Operation
BOARD_ID.CThis program is used to identify the model of BL2100 being used, and display that information in the STDIO window.1.3.2 Digital I/O
DIGIN.CDemonstrates the use of the digital inputs. Using the Demonstration Board, you can see an input channel toggle from HIGH to LOW when pressing a pushbutton on the Demonstration Board.
DIGOUT.CDemonstrates the use of the high-current outputs configured as either sinking or sourcing outputs. Using the Demonstration Board, you can see an LED toggle on/off via a high-current output.
PWM.CDemonstrates the use of Timer B to generate a PWM signal on PE5-INT located on screw terminal header J11. The program generates a 42 Hz PWM signal with the duty cycle adjustable from 1 to 99%.1.3.3 A/D Converter
AD_CALIB.CDemonstrates how to recalibrate an A/D converter channel using two known voltages to generate two coefficients, gain and offset, which are rewritten into the user block data area. The voltage that is being monitored is displayed continuously. Make sure that you don't exceed the voltage range of the A/D converter input channel.
NOTE This sample program will overwrite the calibration constants set at the factory.
AD1.CDemonstrates how to access the A/D internal test voltages in both the TLC2543 and TLC1543 A/D converter chips. The program reads the A/D internal voltages and then uses the STDIO window to display the RAW data.
AD2.CDemonstrates how to access the A/D channels using theanaInVolt()function. The program uses the STDIO window to display the voltage that is being monitored.
AD3.CDemonstrates how to access the A/D converter channels with the low-level A/D driver. The program uses the STDIO window to display the voltage that is being monitored on all the A/D channels using the low-level A/D driver.
AD4.CDemonstrates how to use the A/D converter channels with the low-level A/D driver. The program uses the STDIO window to display the voltage (average of 10 samples) that is being monitored on all the A/D converter channels using the low-level A/D driver.1.3.4 D/A Converter
DACAL.CThis program demonstrates how to recalibrate an D/A converter channel using two known voltages, and defines the two coefficients, gain and offset, that will be rewritten into the D/A converter's EEPROM simulated in flash memory.
NOTE This sample program will overwrite the calibration constants set at the factory.
DAOUT1.CThis program outputs a voltage that can be read with a voltmeter. The output voltage is computed using the calibration constants that are read from the EEPROM simulated in flash memory.
DAOUT2.CThis program demonstrates the use of both the D/A and the A/D converters. The user selects both the D/A converter and A/D channel to be used, then sets the D/A converter output voltage to be read by the A/D channel. All activity will be displayed in the STDIO window.1.3.5 Using Calibration Constants
FOLDER:
SAMPLES\BL2100\Calib_Save_RetrieveThe following sample programs prompt you to use a serial number for the BL2100. This serial number can be any 5-digit number of your choice, and will be unique to a particular BL2100. Do not use the MAC address on the bar code label of the RabbitCore module attached to the BL2100 since you may at some later time use that particular RabbitCore module on another BL2100, and the previously saved calibration data would no longer apply.
GETCALIB.CThis program demonstrates how to retrieve your analog calibration data to rewrite it back to the simulated EEPROM in flash with using a serial utility such as Tera Term.
NOTE Calibration data must be saved previously in a file by the sample program SAVECALIB.C.
SAVECALIB.CThis program demonstrates how to save your analog calibration coefficients using a serial port and a PC serial utility such as Tera Term.
NOTE Use the sample program GETCALIB.Cto retrieve the data and rewrite it to the single-board computer.1.3.6 Serial Communication
PUTS.CTransmits and then receives an ASCII string on Serial Ports B and C. It also displays the serial data received from both ports in the STDIO window.
RELAYCHR.CThis program echoes characters over Serial Port B to Serial Port C. It must be run with a serial utility such as HyperTerminal.
MASTER.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave BL2100. The slave will send back converted upper case letters back to the master BL2100 and display them in the STDIO window. UseSLAVE.Cto program the slave BL2100.
SLAVE.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave BL2100. The slave will send back converted upper case letters back to the master BL2100 and display them in the STDIO window. UseMASTER.Cto program the master BL2100.1.3.7 TCP/IP
SSI.CThis program demonstrates how to make the BL2100 a Web server. This program allows you to turn the LEDs on an attached Demonstration Board from the Tool Kit on and off from a remote Web browser. LED0 and LED1 on the LCD/keypad module (LED1 and LED2 on the Demonstration Board) will match those on the Web page.
SMTP.CThis program allows you to send an e-mail when a switch on the Demonstration Board is pressed. Follow the instructions included with the sample program.
TELNET.CThis program allows you to communicate with the BL2100 using the Telnet protocol. This program takes anything that comes in on a port and sends it out Serial Port B. It uses digital input IN00 to indicate that the TCP/IP connection should be closed, and it uses high-current output OUT00 to indicate that there is an open connection. You may change the digital input and output to suit your application needs.1.4 BL2500
1.4.1 General Board Operation
CONTROLLED.CUses the D/A converters to vary the brightness of the LEDs on the Demonstration Board.
FLASHLEDS.CUses cofunctions and costatements to flash LEDs on the BL2500 at different intervals.
TOGGLESWITCH.CUses costatements to detect switches presses on the Demonstration Board with press and release debouncing. Corresponding LEDs will turn on or off.1.4.2 Digital I/O
DIGIN.CThis program demonstrates the use of the digital inputs and the function calldigIn()using the Demonstration Board to see an input channel toggle from HIGH to LOW when pressing a pushbutton on the Demonstration Board.
DIGOUT.CThis program demonstrates the use of the digital outputs and the function calldigOut()using the Demonstration Board to see the logic levels of output channels in the STDIO window and the state of the corresponding LEDs on the Demonstration Board.1.4.3 A/D Converter
AD0.CThis program reads and displays the voltage on channel AD0 and its equivalent value to the STDIO window.
ADCCALIB.CThis program demonstrates how to recalibrate one single-ended A/D converter channel using two known voltages to generate constants that are then rewritten into the user block data area.
COF_ANAIN.CThis program demonstrates the use of the analog input driver as a cofunction. Connect DA1 to AD0 to provide an input voltage. When the program runs, it will read the input voltage ten times while another costatement is executed concurrently. The values will be printed out at the end of the program.
DA2AD.CThis program allows the user to input a voltage in the Dynamic C STDIO window for DA1 to output. The user needs to connect DA1 to AD0. The program will display the voltage read in the STDIO window.1.4.4 D/A Converter
DAC.CDemonstrates pulse-width modulation as an analog output voltage by displaying the voltage entered and measuring the voltage output.
DACCALIB.CDemonstrates how to recalibrate one single-ended analog output channel using two known voltages to generate constants for that channel that are then rewritten into the user block data area.
PWM.CDemonstrates pulse-width modulation as an analog output.1.4.5 Using Calibration Constants
UPLOADCALIB.CThis program demonstrates reading calibration constants from a controller's user block in flash memory and transmitting the file using a serial port with a PC serial utility such as Tera Term.
NOTE Use the sample program DNLOADCALIB.Cto retrieve the data and rewrite it to the single-board computer.
DNLOADCALIB.CThis program demonstrates how to retrieve your analog calibration data to rewrite them back to simulated EEPROM in flash using a serial utility such as Tera Term.
NOTE Calibration data must be saved previously in a file by the sample program UPLOADCALIB.C.NOTE In addition to loading the calibration constants on the replacement RabbitCore module, you will also have to add the product information for the BL2500 to the ID block associated with the RabbitCore module. The sample program WRITE_IDBLOCK.C, available on the Z-World Web site at http://www.zworld.com/support/feature_downloads.shtml, provides specific instructions and an example.1.4.6 Serial Communication
FLOWCONTROL.CDemonstrates hardware flow control by sending a pattern of * characters out of Serial Port E (PG6) at115,200 bps. One character at a time is received from PG6 and is displayed. In this example, PG3 is configured as the CTS input, detecting a clear to send condition, and PG2 is configured as the RTS output, signaling a ready condition. This demonstration can be performed with either one or two boards.
SIMPLE3WIRE.CDemonstrates basic initialization for a simple RS-232 3-wire loopback displayed in the STDIO window.
SWITCHCHAR.CThis program transmits and then receives an ASCII string on Serial Ports E and F when a switch is pressed. It also displays the serial data received from both ports in the STDIO window.
SIMPLE485MASTER.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave. The slave will send back converted upper case letters back to the master BL2500 and display them in the STDIO window. UseSIMPLESLAVE.Cto program the slave.
SIMPLE485SLAVE.CThis program demonstrates a simple RS-485 transmission of lower case letters to a master BL2500. The slave will send back converted upper case letters back to the master BL2500 and display them in the STDIO window. UseSIMPLEMASTER.Cto program the master BL2500.1.4.7 TCP/IP
BROWSELED.CThis program demonstrates a basic controller running a Web page. Two "LEDs" are created on the Web page, and two buttons on the Demonstration Board then toggle them. Users can change the status of the lights from the Web browser. The LEDs on the Demonstration Board match the ones on the Web page.
SMTP.CThis program allows you to send an E-mail when a switch on the Demonstration Board is pressed. Follow the instructions included with the sample program.
PINGLED.CThis program demonstrates ICMP by pinging a remote host. It will flash LEDs DS1 and DS2 on the Demonstration Board when a ping is sent and received.1.5 BL2600
1.5.1 General Board Operation
BOARD_ID.CThis program is used to identify the model of BL2600 being used, and displays that information in the STDIO window.1.5.2 Digital I/O
DIGIN.CDemonstrates the use of the digital inputs. Using the Demonstration Board, you can see an input channel toggle from HIGH to LOW when pressing a pushbutton on the Demonstration Board. See Appendix C in the BL2600 User's Manual for hookup instructions for the Demonstration Board. This sample program does not explicitly configure any of the configurable I/O, so all the configurable I/O are available by default as digital inputs.
DIGINBANK.CDemonstrates the use ofdigInBank()to read digital inputs. Using the Demonstration Board, you can see an input channel toggle from HIGH to LOW when pressing a pushbutton on the Demonstration Board. See Appendix C in the BL2600 User's Manual for hookup instructions for the Demonstration Board. This sample program does not explicitly configure any of the configurable I/O, so all the configurable I/O are available by default as digital inputs.
DIGOUT.CDemonstrates the use of the configurable I/O sinking outputs. Using the Demonstration Board, you can see an LED toggle on/off via a sinking output. See Appendix C in the BL2600 User's Manual for hookup instructions for the Demonstration Board.
DIGOUTBANK.CDemonstrates the use ofdigInBank()to control the configurable I/O sinking outputs. Using the Demonstration Board, you can see an LED toggle on/off via a sinking output. See Appendix C in the BL2600 User's Manual for hookup instructions for the Demonstration Board.
HIGH_CURRENT_IO.CDemonstrates the use of the high-current outputs configured as either sinking or sourcing outputs. High-current output HOUT0 is configured for sourcing to provide power to the Demonstration Board. Outputs HOUT1 and HOUT2 are configured to demonstrate tristate operation to toggle the LEDs on the Demonstration Board. Output HOUT3 is configured as a sinking output to toggle an LED on the Demonstration Board. See Appendix D for hookup instructions for the Demonstration Board.
PWM.CDemonstrates the use of the four PWM channels on Parallel Port F (PF4PF7) on pins DIN20DIN23. The PWM signals are set for a frequency of 10 kHz with the duty cycle adjustable from 1 to 99% by the user. Since the output voltage swing is 0 V to 2.5 V DC, the PWM outputs should interface only with TTL-compatible components.1.5.3 A/D Converter
NOTE The calibration sample programs will overwrite the calibration constants set at the factory.
ADC_CAL_DIFF.CDemonstrates how to recalibrate a differential A/D converter channel using two known voltages to generate two coefficients, gain and offset, which are rewritten into the reserved EEPROM. The voltage that is being monitored is displayed continuously.
ADC_CAL_MA.CDemonstrates how to recalibrate a milli-amp A/D converter channel using two known currents to generate two coefficients, gain and offset, which are rewritten into the reserved EEPROM. The current that is being monitored is displayed continuously.
ADC_CAL_SE_BIPOLAR.CDemonstrates how to recalibrate a single-ended bipolar A/D converter channel using two known voltages to generate two coefficients, gain and offset, which are rewritten into the reserved EEPROM. The voltage that is being monitored is displayed continuously.
ADC_CAL_SE_UNIPOLAR.CDemonstrates how to recalibrate a single-ended unipolar A/D converter channel using two known voltages to generate two coefficients, gain and offset, which are rewritten into the reserved EEPROM. The voltage that is being monitored is displayed continuously.
AD_RD_DIFF.CDemonstrates how to read and display voltage and equivalent values for a differential A/D converter channel using calibration coefficients previously stored in the EEPROM. The user selects to display either the raw data or the voltage equivalent.
AD_RD_MA.CDemonstrates how to read and display voltage and equivalent values for a milli-amp A/D converter channel using calibration coefficients previously stored in the EEPROM. The user selects to display either the raw data or the current equivalent.
AD_RD_SE_BIPOLAR.CDemonstrates how to read and display the voltage of all single-ended A/D converter channels using calibration coefficients previously stored in the EEPROM.
AD_RD_SE_UNIPOLAR.CDemonstrates how to read and display the voltage of all single-ended A/D converter channels using calibration coefficients previously stored in the EEPROM.1.5.4 D/A Converter
NOTE The calibration sample programs will overwrite the calibration constants set at the factory.
DAC_CAL_MA.CDemonstrates how to recalibrate a D/A converter channel using a known current to generate calibration constants, which are written into the reserved EEPROM.
DAC_CAL_VOLTS.CDemonstrates how to recalibrate a D/A converter channel using a known voltage to generate calibration constants, which are written into the reserved EEPROM.
DAC_MA_ASYNC.CDemonstrates how to output a current that can be read with an ammeter. The output current is computed with using the calibration constants that are stored in the reserved EEPROM.
- The D/A converter circuit is set up for asynchronous operation, which updates the D/A converter output at the time it's being written via the
anaOut()oranaOutmAmps()function calls.
DAC_MA_SYNC.CDemonstrates how to output a current that can be read with an ammeter. The output current is computed with using the calibration constants that are stored in the reserved EEPROM.
- The D/A converter circuit is set up for synchronous operation, which updates the D/A converter output when the
anaOutStrobe()function call executes. The outputs will be updated with values previously written via theanaOut()oranaOutmAmps()function calls.
DAC_VOLT_ASYNC.CDemonstrates how to output a voltage that can be read with a voltmeter. The output voltage is computed with using the calibration constants that are stored in the reserved EEPROM.
- The D/A converter circuit is set up for asynchronous operation, which updates the D/A converter output at the time it's being written via the
anaOut()oranaOutVolts()function calls.
DAC_VOLT_SYNC.CDemonstrates how to output a voltage that can be read with a voltmeter. The output voltage is computed with using the calibration constants that are stored in the reserved EEPROM.1.5.5 Using Calibration Constants
ADC_RD_CALDATA.CDemonstrates how to display the two calibration coefficients, gain and offset, in the Dynamic C STDIO window for each channel and mode of operation.
DAC_RD_CALDATA.CDemonstrates how to display the calibration coefficients, gain and offset, in the Dynamic C STDIO window for each channel and mode of operation.1.5.6 Serial Communication
PARITY.C This sample program repeatedly sends byte values 0127 from Serial Port F to Serial Port C. The program switches between generating parity and not generating parity on Serial Port F. Serial Port C will always be checking parity, so parity errors should occur during every other sequence. The results are displayed in the Dynamic C STDIO window.
SIMPLE3WIRE.CThis program demonstrates basic RS-232 serial communication. Connect TxC to RxF on header J17 and connect TxF to RxC on header J17 before compiling and running this sample program.
SIMPLE5WIRE.CThis program demonstrates 5-wire RS-232 serial communication. Connect TxC to RxC on header J17 and connect TxF to RxF on header J17 before compiling and running this sample program.
MASTER.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave. The slave will send back converted upper case letters back to the master BL2600 and display them in the STDIO window. UseSLAVE.Cto program the slave. Make the following connections between the master and slave:485+ to 485+
485- to 485-
GND to GND
SLAVE.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave. The slave will send back converted upper case letters back to the master BL2600 and display them in the STDIO window. UseMASTER.Cto program the master BL2600.1.5.7 Serial Flash
The following sample programs demonstrate the use of the optional SF1000 serial flash card on the BL2600. The SF1000 User's Manual contains additional information and API functions for the SF1000.
FLASH_PATTERN_INSPECT.CWrites a pattern to the first 100 sectors of the SF1000, which can then be inspected or cleared by the user. The user then has the option to either inspect or clear a page of serial flash memory.
SFLASH_TEST.CDemonstrates how to read and write data from/to the SF1000. Once the sample program is compiled and run, it displays a message in the Dynamic C STDIO window to report whether the test was successful.1.5.8 TCP/IP
SSI.CThis program demonstrates how to make the BL2600 a Web server. This program allows you to turn the LEDs on an attached Demonstration Board from the Tool Kit on and off from a remote Web browser. The LEDs on the Demonstration Board match the ones on the Web page. Follow the instructions included with the sample program.
SMTP.CThis program allows you to send an e-mail when a switch on the Demonstration Board is pressed. Follow the instructions included with the sample program.
TELNET.CThis program allows you to communicate with the BL2600 using the Telnet protocol. This program takes anything that comes in on a port and sends it out Serial Port C. It uses a digital input to indicate that the TCP/IP connection should be closed and a digital output to toggle a LED to indicate that there is an active connection.1.6 LP3500
1.6.1 Power Modes
POWER.CThis program demonstrates switching from the normal raw DC power source to an external battery using the Prototyping Board. Pressing a switch will change from the power source and will be displayed by flashing LEDs.
LOWPWRDEMO.CThis program demonstrates a low-power mode with the normal power source connected to the LP3500.
VCCMONITOR.CThis program demonstrates the Vcc monitoring function on AIN7. All activity will be displayed in the STDIO window1.6.2 Digital I/O
DIGIN.CDemonstrates the use of the digital inputs. Using the Prototyping Board, you can see an input channel toggle from HIGH to LOW when pressing a pushbutton on the Prototyping Board.
DIGOUT.CDemonstrates the use of the high-current outputs configured as either sinking or sourcing outputs. Using the Prototyping Board, you can see an LED toggle on/off via a high-current output.
DIGBANKIN.CDemonstrates the use of the digital inputs. Using the Prototyping Board, you can see a bank of input channels toggle from HIGH to LOW when pressing a pushbutton on the Prototyping Board.
DIGBANKOUT.CDemonstrates the use of the high-current outputs configured as either sinking or sourcing outputs. Using the Prototyping Board, you can see a bank of channels toggle the corresponding LEDs on/off via high-current outputs.
PWMOUT.CThis program demonstrates the PWM functions. It will set the PWM channels, PWM0PWM2, to the following duty cycles:PWM Channel 0 to 10%
PWM Channel 1 to 25%
PWM Channel 2 to 50%1.6.3 A/D Converter
AD_RDVOLT_ALL.CThis program reads and displays the voltage and equivalent values of each single-ended A/D converter channel. Coefficients are read from the A/D converter's simulated EEPROM in flash memory to compute the equivalent voltages. Computed raw data and equivalent voltages are displayed in the STDIO window.
AD_RDVOLT_CH.CThis program reads and displays the voltage and equivalent values of one single-ended A/D converter channel. Coefficients are read from the A/D converter's simulated EEPROM in flash memory to compute the equivalent voltages. Computed raw data and equivalent voltages are displayed in the STDIO window.
AD_RDDIFF_CH.CThis program demonstrates reading one differential A/D converter channel. Coefficients are read from the A/D converter's simulated EEPROM in flash memory to compute the equivalent voltages. Computed raw data and equivalent voltages are displayed in the STDIO window.
AD_RDMA_CH.CThis program demonstrates reading one milliampere A/D converter channel. Coefficients are read from the A/D converter's simulated EEPROM in flash memory to compute the equivalent currents. Computed raw data and equivalent currents are displayed in the STDIO window.
AD_SAMPLE.CThis program demonstrates how to use the A/D low-level driver. The program will display the average voltage that is present on an A/D converter channel. The particular channel and the number of samples may be changed by the user.
ADCAL_ALL.CThis program demonstrates how to recalibrate all single-ended A/D converter channels using two known voltages to generate constants for each channel, and will be written into the user block data area. The program uses the STDIO window to display the voltage that is being monitored.
NOTE This sample program will overwrite the calibration constants set at the factory.
ADCAL_CHAN.CThis program demonstrates how to recalibrate one single-ended A/D converter channel using two known voltages to generate constants for each channel, and will be written into the user block data area. The program uses the STDIO window to display the voltage that is being monitored.
NOTE This sample program will overwrite the calibration constants set at the factory.
AD_CALDIFF.CThis sample program demonstrates how to recalibrate one differential A/D converter channel using two known voltages to generate constants for that channel and rewrite the constants into the user block data area. The program uses the STDIO window to display the voltage that is being monitored.
NOTE This sample program will overwrite the calibration constants set at the factory.
AD_CALMA_CH.CThis sample program demonstrates how to recalibrate one A/D converter channel operating in the 420 mA current mode using two known currents to generate two coefficients, gain and offset, which are rewritten into the user block data area. The program uses the STDIO window to display the current that is being monitored.
NOTE This sample program will overwrite the calibration constants set at the factory. 1.6.4 Serial Communication
SIMPLE3WIRE.CThis program demonstrates basic initialization for a simple RS-232 3-wire loopback displayed in the STDIO window.
SIMPLE485MASTER.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave LP3500. The slave will send back converted upper case letters back to the master LP3500 and display them in the STDIO window. UseSIMPLE485SLAVE.Cto program the slave LP3500.
SIMPLE485SLAVE.CThis program demonstrates a simple RS-485 transmission of lower case letters to a slave LP3500. The slave will send back converted upper case letters back to the master LP3500 and display them in the STDIO window. UseSIMPLE485MASTER.Cto program the master LP3500.1.6.5 Relay Outputs
SWRELAY.CThis program demonstrates the relay-switching function call operating on normal power source. Use the pushbutton switches on the Prototyping Board to switch the relay between the SET (NO) and RESET (NC) positions. All activity will be displayed with the LEDs.1.6.6 LCD/Keypad
FOLDER:
SAMPLES\LP3500\DISPLAY_KEYPAD
DISPLED.CThis sample program demonstrates how to toggle the LEDs on the LCD/keypad module.
KEYMENU.CThis sample program demonstrates how to implement a menu system using a highlight bar on the LCD/keypad module.These two sample programs are board-specific to the LP3500. Click here for additional sample programs that illustrate the use of the LCD/keypad module.
1.7 Intellicom
1.7.1 General Board Operation
COFTERMA.CDemonstrates cofunctions, the cofunction serial library, and using a serial ANSI terminal such as HyperTerminal from an available PC COM port connection.
ICOMDEMO.CDemonstration program to illustrate Intellicom features. This demonstration program comes up when the Intellicom is first powered up before new programs are compiled and run.
MUSIC.CSpeaker demonstration: plays one line of "Bicycle Built For Two" (with lyrics).
MUSIC2.CSpeaker demonstration: plays one line of "Für Elise" as background music while other processing is going on.
SPEAKER.CDemonstrates how to adjust the speaker frequency and volume.1.7.2 Digital I/O