Digi BL4S100 User Manual

C-programmable single-board computer with networking
Table of Contents

Advertisement

Quick Links

BL4S100
C-Programmable Single-Board Computer with Networking
User's Manual
019–0172_D

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the BL4S100 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Digi BL4S100

  • Page 1 BL4S100 C-Programmable Single-Board Computer with Networking User’s Manual 019–0172_D...
  • Page 2 Rabbit, RabbitCore, and Dynamic C are registered trademarks of Digi International Inc. RabbitNet is a trademark of Digi International Inc. The latest revision of this manual is available on the Digi International Inc. website, www.digi.com, for free, unregistered download. Digi International Inc.
  • Page 3: Table Of Contents

    2.2 Installing Dynamic C ..........................13 2.3 Starting Dynamic C ..........................14 2.4 Run a Sample Program ........................14 2.4.1 Troubleshooting ..........................14 2.4.2 Run a ZigBee Sample Program (BL4S100/BL4S150 only) ............15 2.5 Where Do I Go From Here? .......................16 Chapter 3. Subsystems 3.1 BL4S100 Pinouts ..........................18 3.1.1 Connectors ..........................18...
  • Page 4 Chapter 6. Using the ZigBee Features 6.1 Introduction to the ZigBee Protocol ....................103 6.2 ZigBee Sample Programs .........................104 6.2.1 Setting Up the Digi XBee USB Coordinator ................105 6.2.2 Setting up Sample Programs .....................107 6.3 Dynamic C Function Calls........................111 6.4 Where Do I Go From Here? ......................111 Appendix A.
  • Page 5 Appendix F. Additional Configuration Instructions F.1 XBee Module Firmware Downloads ....................134 F.1.1 Dynamic C v. 10.44 and Later ....................134 ® F.2 Digi XBee USB Configuration ......................135 F.2.1 Additional Reference Information ....................136 ® F.2.2 Update Digi XBee USB Firmware ..................138 Index Schematics BL4S100 User’s Manual...
  • Page 6: Chapter 1. Introduction

    4000 microprocessor provides fast data processing. 1.1 BL4S100 Description Throughout this manual, the term BL4S100 refers to the complete series of BL4S100 single- board computers unless other production models are referred to specifically. The BL4S100 is an advanced single-board computer that incorporates the powerful Rabbit 4000 microprocessor, serial flash memory, static RAM, digital inputs, digital outputs, A/D converter inputs, RS-232 serial ports, and Ethernet and ZigBee network connectivity.
  • Page 7 • Watchdog supervisor. Four BL4S100 models are available. Their standard features are summarized in Table 1. Table 1. BL4S100 Models Feature BL4S100 BL4S110 BL4S150 BL4S160 Microprocessor Rabbit 4000 running at 40.00 MHz Program Execution SRAM 512KB Data SRAM 512KB Serial Flash Memory...
  • Page 8: Development And Evaluation Tools

    1.3 Development and Evaluation Tools 1.3.1 Tool Kit A Tool Kit contains the hardware essentials you will need to use your own BL4S100 single- board computer. These items are supplied in the Tool Kit. • Getting Started instructions. • Dynamic C CD-ROM, with complete product documentation on disk.
  • Page 9: Software

    1.3.2 Software The BL4S100 is programmed using version 10.44 or later of Rabbit’s Dynamic C. A com- This version of Dynamic C includes the patible version is included on the Tool Kit CD-ROM. popular µC/OS-II real-time operating system, point-to-point protocol (PPP), FAT file...
  • Page 10: Ce Compliance

    The BL4S110, BL4S150, and BL4S160 single-board computers are also CE qualified as they are sub-versions of the BL4S100 single-board computer. Boards that are CE-compliant have the CE mark. Immunity The BL4S100 series of single-board computers meets the following EN55024/1998 immunity standards.
  • Page 11: Design Guidelines

    CE compliance and to conform to good cable design practices. • When installing or servicing the BL4S100, it is the responsibility of the end-user to use proper ESD precautions to prevent ESD damage to the BL4S100.
  • Page 12: Chapter 2. Getting Started

    2. G ETTING TARTED Chapter 2 explains how to connect the programming cable and power sup- ply to the BL4S100 BL4S100 User’s Manual...
  • Page 13: Bl4S100 Connections

    Connect the 10-pin PROG connector of the programming cable to header J8 on the BL4S100. Ensure that the colored edge lines up with pin 1 as shown. (Do not use the DIAG connector, which is used for monitoring only.) Connect the other end of the pro- gramming cable to an available USB port on your PC or workstation.
  • Page 14: Hardware Reset

    Release the clip to secure the plug assembly in the AC adapter. Connect the power supply to header J17 on the BL4S100 as shown in Figure 3. Be sure to match the latch mechanism with the top of the connector to header J17 on the BL4S100 as shown.
  • Page 15: Installing Dynamic C

    If you have not yet installed Dynamic C version 10.44 (or a later version), do so now by inserting the Dynamic C CD from the BL4S100 Tool Kit in your PC’s CD-ROM drive. If autorun is enabled, the CD installation will begin automatically.
  • Page 16: Starting Dynamic C

    If the LED is lit, check both ends of the programming cable to ensure that it is firmly plugged into the PC and the programming header on the BL4S100 with the marked (col- ored) edge of the programming cable towards pin 1 of the programming header.
  • Page 17: Run A Zigbee Sample Program (Bl4S100/Bl4S150 Only)

    This section explains how to run a sample program in which the BL4S100/BL4S150 is used in its default setup as a router and the Digi XBee USB is used as the ZigBee coordinator. 1. Connect the Digi XBee USB acting as a ZigBee coordinator to an available USB port on your PC or workstation.
  • Page 18: Where Do I Go From Here

    Technical Support. If the sample program ran fine, you are now ready to go on to explore other BL4S100 features and develop your own applications. When you start to develop an application involving the analog inputs, run...
  • Page 19: Chapter 3. Subsystems

    3. S UBSYSTEMS Chapter 3 describes the principal subsystems for the BL4S100. • Digital I/O • Serial Communication • A/D Converter Inputs • Memory Figure 4 shows these Rabbit-based subsystems designed into the BL4S100. BL4S100 Programming Port Digital Real-Time Main...
  • Page 20: Bl4S100 Pinouts

    Figure 5. BL4S100 Pinouts 3.1.1 Connectors Standard BL4S100 models are equipped with an RJ-45 Ethernet jack, four 1 × 9 screw- terminal headers and one 1 × 6 screw-terminal header for the I/O and RS-232 signals. The polarized 2 × 2 Micro-Fit connector at J17 is for the power supply connection.
  • Page 21: Digital I/O

    3.2 Digital I/O 3.2.1 Digital Inputs The BL4S100 has 12 digital inputs, IN0–IN11, each of which is protected over a range of –36 V to +36 V. The inputs are factory-configured to be pulled up to +5 V, but they can also be pulled up to +K or pulled down to 0 V by changing a jumper as shown in Figure 6.
  • Page 22 Blocks of digital input pins are associated with counters/timers on the Rabbit RIO chip. Table 3 provides complete details for these associations. Table 3. Counter/Timer Associations for BL4S100 Digital Input Pins Configurable I/O Counter/Timer...
  • Page 23 3.2.1.1 Interrupt, Counter, and Event Capture Setup External interrupts on the BL4S100 digital input pins are configured using the setEx- function call. The interrupt can be set up to occur on a rising edge, a fall- tInterrupt() ing edge, or either edge.
  • Page 24: Digital Outputs

    All the digital outputs sink actively. They can be used as low-side drivers, or as an H-bridge driver. When the BL4S100 is first powered up or reset, all the outputs are disabled, that is at a high-impedance state.
  • Page 25 Blocks of digital output pins are associated with counters/timers on the Rabbit RIO chip. Table 4 provides complete details for these associations. Table 4. Counter/Timer Associations for BL4S100 Digital Output Pins Configurable I/O Counter/Timer Block Shared With Pin(s) Blocks OUT0–OUT1 IN6–IN7...
  • Page 26 PPM Shifted Offset outputs are on the same block of a particu- lar Rabbit RIO chip PWM and PPM outputs on the BL4S100 are configured using the setPWM() function calls. setPPM() BL4S100 User’s Manual...
  • Page 27: Serial Communication

    PC while a program is being debugged. The Rabbit 4000 startup-mode pins (SMODE0, SMODE1) are presented to the program- ming port so that an externally connected device can force the BL4S100 to start up in an BL4S100 User’s Manual...
  • Page 28: Ethernet Port

    The BL4S100 can be reset from the programming port via the line. /RESET_IN The Rabbit microprocessor status pin is also presented to the programming port. The status pin is an output that can be used to send a general digital signal.
  • Page 29: A/D Converter Inputs

    3.4 A/D Converter Inputs The single A/D converter chip used in the BL4S100 has a resolution of 12 bits (11 bits for the value and one bit for the polarity). The A/D converter chip has a programmable-gain amplifier. Each external input has circuitry that provides scaling and filtering. All 8 external inputs are scaled and filtered to provide the user with an input impedance of 1 M...
  • Page 30 The current measurements are realized by actu- AIN1 ally measuring the voltage drop across a 100  AIN2 resistor. 100 W AIN3 Figure 12. Analog Current Measurements The A/D converter inputs are factory-calibrated, and the calibration constants are stored in the user block. BL4S100 User’s Manual...
  • Page 31: A/D Converter Calibration

    Single-Ended, unipolar ADC_RD_SE_UNIPOLAR.C ADC_CAL_SE_UNIPOLAR.C Differential, bipolar ADC_RD_DIFF.C ADC_CAL_DIFF.C 4–20 mA ADC_RD_MA.C ADC_CAL_MA.C These sample programs are found in the subdirectory in . See SAMPLES\BL4S1xx Section 4.2.3 for more information on these sample programs and how to use them. BL4S100 User’s Manual...
  • Page 32: Usb Programming Cable

    The USB programming cable is used to connect the serial programming port of the BL4S100 to a PC USB port. The programming cable converts the voltage levels used by the PC USB port to the CMOS voltage levels used by the Rabbit microprocessor.
  • Page 33: Other Hardware

    3.6 Other Hardware 3.6.1 Clock Doubler The BL4S100 takes advantage of the Rabbit microprocessor’s internal clock doubler. A built-in clock doubler allows half-frequency crystals to be used to reduce radiated emissions. The clock doubler may be disabled if the higher clock speeds are not required. Disabling the clock doubler will reduce power consumption and further reduce radiated emissions.
  • Page 34: Memory

    3.7 Memory 3.7.1 SRAM All BL4S100 boards have 512KB of battery-backed data SRAM, and 512KB–1MB of fast program execution SRAM. 3.7.2 Flash Memory BL4S100 boards have 1MB—2MB of serial flash memory. Writing to arbitrary flash memory addresses at run time is also discouraged. Instead, define a “user block”...
  • Page 35: Chapter 4. Software

    Chapter 4 provides the libraries, function calls, and sample programs related to the BL4S100 4.1 Running Dynamic C Since the BL4S100 has a serial flash memory, all software development must be done in the static SRAM. The flash memory and SRAM options are selected with the Options >...
  • Page 36  Hex memory dump—displays the contents of memory at any address.  STDIO window— outputs to this window and keyboard input on the host PC can be printf detected for debugging purposes. output may also be sent to a serial port or file. printf BL4S100 User’s Manual...
  • Page 37: Upgrading Dynamic C

    Secure Sockets Layer (SSL) and a specific Advanced Encryption Standard (AES) library. In addition to the Web-based technical support included at no extra charge, a one-year telephone-based technical support subscription is also available for purchase. Visit our website at www.digi.com for further information and complete documentation. BL4S100 User’s Manual...
  • Page 38: Sample Programs

    . The BL4S100 must be in Program mode (see Section 3.5, “USB Programming Cable,”) and must be connected to a PC using the programming cable as described in Section 2.1, “BL4S100 Connections.” See Appendix C for information on the power-supply connections to the Demonstration Board.
  • Page 39: Digital I/O

    Demonstration Board, you can see an input channel toggle from HIGH to LOW in the Dynamic C window when you press a pushbutton on the Demonstration STDIO Board. The banking functions allow I/O banks to be input or output more efficiently. BL4S100 User’s Manual...
  • Page 40 Using the Demonstration Board, you can see an LED toggle on/off via a sinking output that you selected via the Dynamic C window. The banking func- STDIO tions allow I/O banks to be input or output more efficiently. BL4S100 User’s Manual...
  • Page 41 #define PPM_FREQ instructions when running this sample program. 1. The digital outputs on the BL4S100 do not have an internal pull-up resistor and will not register on the oscilloscope without a pull-up resistor. The Demonstration Board has pull-up resistors— connect OUT0–OUT3 on the BL4S100 to SW1–SW4 on header J1 of the Demonstration Board.
  • Page 42 Follow these instructions when running this sample program. #define PWM_FREQ 1. The digital outputs on the BL4S100 do not have an internal pull-up resistor and will not register on the oscilloscope without a pull-up resistor. The Demonstration Board has pull-up resistors—...
  • Page 43 —Demonstrates the use of quadrature decoders on the • QUADRATURE_DECODER.C BL4S100. See Figure 16 for hookup instructions of the digital I/O pins on headers J3 and J4 with the Demonstration Board. JP15 DIGITAL I/O HEADER J3 BL4S100 IN0 + OUT0...
  • Page 44 PPM_QUADRATURE_DECODER.C output channels connected back to four digital inputs to simulate two Quadrature Decoders feeding signals into the BL4S100. The PWM and PPM outputs are adjusted through a menu system to simulate the movement of a Quadrature Decoder. The results of the Quadrature Decoder inputs are displayed continuously to show the effects of the PWM and PPM outputs.
  • Page 45: Serial Communication

    RTS and CTS are connected again. —This sample program demonstrates using parity over a simple • COMPUTER_PARITY.C three-wire RS-232 connection. Parity is selected for the BL4S100 and for the serial ter- minal emulation program. Characters typed in either the Dynamic C window or STDIO in the serial terminal emulation program are echoed in both displays.
  • Page 46 There may be some differences for special characters such as new lines (enter key), delete, backspace, and others. Each character sent will also increment either the successful or the error counter, depending on the parity of both the BL4S100 and the terminal emulation program.
  • Page 47: A/D Converter Inputs

    Before you compile and run this sample program, connect the power supply (which should be OFF) between the pin (AIN0–AIN7) of an analog input channel and AGND, then compile and run the sample program, and follow the instructions in the Dynamic C window. STDIO BL4S100 User’s Manual...
  • Page 48: Real-Time Clock

    Dynamic C SAMPLES\RTCLOCK folder provides additional examples of how to read and set the real-time clock 4.2.5 TCP/IP Sample Programs TCP/IP sample programs are described in Chapter 5. 4.2.6 ZigBee Sample Programs ZigBee sample programs are described in Chapter 6. BL4S100 User’s Manual...
  • Page 49: Bl4S100 Libraries

    4.3 BL4S100 Libraries Two library directories provide libraries of function calls that are used to develop applica- tions for the BL4S100. —libraries associated with features specific to the BL4S100. The functions in • BL4S1xx library are described in Section 4.4, “BL4S100 Function Calls.”...
  • Page 50: Bl4S100 Function Calls

    4.4 BL4S100 Function Calls 4.4.1 Board Initialization brdInit void brdInit (void); FUNCTION DESCRIPTION Call this function at the beginning of your program. This function initializes Parallel Ports A–E, the Rabbit RIO chip, and the A/D converter. The ports are initialized according to Table A-3 in Appendix A.
  • Page 51: Digital I/O

    The logic state of the specified channel. 0 — logic low 1 — logic high — channel value is out of range. -EINVAL :— channel functionality does not permit this operation. -EPERM SEE ALSO brdInit, setDigIn, digInBank BL4S100 User’s Manual...
  • Page 52 0 — IN0–IN7 1 — IN8–IN11 RETURN VALUE Data read from the bank of digital inputs. Data Bits Bank 0 Bank 1 IN10 IN11 not used — invalid parameter value. -EINVAL SEE ALSO brdInit, digIn, setDigIn BL4S100 User’s Manual...
  • Page 53 RIO chip that have not been configured to support this function call. Appendix D provides the details of the pin and block associations to allow you to identify the channels that need to be reconfigured to support this function call. SEE ALSO brdInit, digIn, setDigIn BL4S100 User’s Manual...
  • Page 54 0 — index on low level non-zero — index on high level RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — resource needed by this function is not available. -EACCESS SEE ALSO brdInit, getCounter, resetCounter BL4S100 User’s Manual...
  • Page 55 ORed together. The low 4 bits are the channel num- ber for the down count input If the mode is selected, has the BL_MATCH_ENABLE options match count to stop at (other match registers on the block are set to max.). BL4S100 User’s Manual...
  • Page 56 RIO chip that have not been configured to support this function call. Appendix D provides the details of the pin and block associations to allow you to identify the channels that need to be reconfigured to support this function call. SEE ALSO brdInit, getCounter, resetCounter BL4S100 User’s Manual...
  • Page 57 — begin event on falling edge BL_EVENT_FALL — begin event on any edge BL_EVENT_BOTH The following two settings are only for the BL_CNT_ON_BEGIN mode: — begin active while signal is high BL_BEGIN_HIGH — begin active while signal is low BL_BEGIN_LOW BL4S100 User’s Manual...
  • Page 58 Appendix D provides the details of the pin and block associations to allow you to identify the channels that need to be reconfigured to support this function call. SEE ALSO brdInit, getBegin, getEnd, getCounter, resetCounter BL4S100 User’s Manual...
  • Page 59 0–11 (pins IN0–IN11) pointer to word variable to place begin register reading begin RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — pin type does not permit this function. -EPERM SEE ALSO brdInit, setCapture, resetCounter, getEnd BL4S100 User’s Manual...
  • Page 60 0–11 (pins IN0–IN11) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — pin type does not permit this function. -EPERM SEE ALSO brdInit, getCounter, setDecoder BL4S100 User’s Manual...
  • Page 61 0–11 (pins IN0–IN11) new value for the limit register limit RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — pin type does not permit this function. -EPERM SEE ALSO brdInit, setCapture, resetCounter BL4S100 User’s Manual...
  • Page 62 0 — success. — invalid parameter value. -EINVAL — pin type does not permit this function. -EPERM — resource needed by this function is not available. -EACCES — internal data fault detected. -EFAULT SEE ALSO brdInit, setSyncOut BL4S100 User’s Manual...
  • Page 63 (main or prescale). This means synchronized blocks may have a small offset when compared to each other. RETURN VALUE 0 — success. — was not run before calling this function. -EPERM brdInit() SEE ALSO brdInit BL4S100 User’s Manual...
  • Page 64 0 — connects the load to GND 1 — puts the output in a high-impedance state RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, digOut, digOutBank BL4S100 User’s Manual...
  • Page 65 0 — connects the load to GND 1 — puts the output in a high-impedance state. RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — pin function was not set up as a digital output -EPERM SEE ALSO brdInit, setDigOut, digOutBank BL4S100 User’s Manual...
  • Page 66 Bitwise value: 0 — connects the load to GND 1 — puts the output in a high-impedance state. RETURN VALUE 0 — success. — invalid parameter value or board not initialized. -EINVAL SEE ALSO brdInit, digOut, setDigOut BL4S100 User’s Manual...
  • Page 67 BL_BIND_LEAD BL_BIND_TRAIL digital output channel hosted by the same block to enable binding for the leading of the PWM output on this channel. Bindings allow PWM and PPM outputs to align their leading and trailing edges. BL4S100 User’s Manual...
  • Page 68 Appendix D provides the details of the pin and block associations to allow you to identify the channels that need to be reconfigured to support this function call. SEE ALSO brdInit, setFreq, setDuty, setSyncIn, setSyncOut, pulseEnable, pulseDisable, setPPM BL4S100 User’s Manual...
  • Page 69 BL_BIND_LEAD BL_BIND_TRAIL digital output channel hosted by the same block to enable binding for the trailing edge of the PPM output on this channel. Bindings allow PWM and PPM outputs to align their leading and trailing edges BL4S100 User’s Manual...
  • Page 70 Appendix D provides the details of the pin and block associations to allow you to identify the channels that need to be reconfigured to support this function call. SEE ALSO brdInit, setFreq, setOffset, setDuty, setSyncIn, setSyncOut, pulseEnable, pulseDisable, setPWM BL4S100 User’s Manual...
  • Page 71 PWM and PPM outputs (should be from 2 Hz to frequency 50 kHz). Use -1 to preserve the existing frequency on the RIO block. RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, setPWM, setPPM, setOffset, setDuty, setSyncIn, setSyncOut, pulseEnable, pulseDisable BL4S100 User’s Manual...
  • Page 72 PWM/PPM output (should be from 0 to 100%) duty RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM, setPPM, setOffset, setFreq, setSyncIn, setSyncOut, pulseEnable, pulseDisable BL4S100 User’s Manual...
  • Page 73 RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM, setPPM, setFreq, setDuty, setSyncIn, setSyncOut, pulseEnable, pulseDisable BL4S100 User’s Manual...
  • Page 74 PWM/PPM enabled, channel 0–7 (OUT0–OUT7) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM, setPPM, pulseDisable BL4S100 User’s Manual...
  • Page 75 0 — success. — invalid parameter value. -EINVAL — pin type does not permit this function. -EPERM — resource needed by this function is not available. -EACCES — internal data fault detected. -EFAULT SEE ALSO brdInit, setSyncIn BL4S100 User’s Manual...
  • Page 76 Match Register 0 BL_IER_MATCH0 bit set if using Match Register 1 BL_IER_MATCH1 bit set if using Match Register 2 BL_IER_MATCH2 bit set if using Match Register 3 BL_IER_MATCH3 — invalid channel value. -EINVAL SEE ALSO brdInit, setPWM, setPPM, setCounter BL4S100 User’s Manual...
  • Page 77: Rabbit Rio Interrupt Handlers

    RETURN VALUE Success — returns the handler ID number ( 0..RSB_MAX_ISR-1 — Invalid parameter given. -EINVAL — No more room in ISR table (increase -ENOSPC RSB_MAX_ISR SEE ALSO addISROut, tickISR, enableISR, setIER BL4S100 User’s Manual...
  • Page 78 RETURN VALUE Success — returns the handler ID number ( 0..RSB_MAX_ISR-1 — Invalid parameter given. -EINVAL — No more room in ISR table (increase -ENOSPC RSB_MAX_ISR SEE ALSO addISRIn, tickISR, enableISR, setIER BL4S100 User’s Manual...
  • Page 79 (bit positions match RIO Interrupt Enable and Status registers) RETURN VALUE 0 — success — Invalid parameter given. -EINVAL — Handler is enabled, can't change IER. -EPERM SEE ALSO addISRIn, addISROut, enableISR, tickISR BL4S100 User’s Manual...
  • Page 80 FUNCTION DESCRIPTION Polls the RIO chip(s) for ISR events if interrupts are not being used. Any enabled ISR events will be passed to the appropriate ISR handler. RETURN VALUE None. SEE ALSO addISRIn, addISROut, enableISR, setIER BL4S100 User’s Manual...
  • Page 81: Serial Communication

    For more information, see the Dynamic C User’s Manual and Technical Note 213, Rabbit Serial Port Software. Use the following function calls with the BL4S100. serMode int serMode(int mode);...
  • Page 82: A/D Converter Inputs

    The values are as follows: — single-ended unipolar (0–20 V) SE0_MODE — differential bipolar (±20 V) DIFF_MODE — 4–20 mA operation mAMP_MODE RETURN VALUE: 0 — success. — invalid parameter. -EINVAL SEE ALSO brdInit, anaInCalib, anaIn, anaInVolts, anaInmAmps, anaInDiff BL4S100 User’s Manual...
  • Page 83 Use one of the opmode following macros to set the mode for the channel being configured. = single-ended unipolar (0–20 V) SE0_mode = differential bipolar (±20 V) DIFF_MODE = 4–20 mA mAMP_mode BL4S100 User’s Manual...
  • Page 84 A/D converter value value2 the voltage corresponding to the second A/D converter value volts2 RETURN VALUE 0 — success. — invalid parameter. -EINVAL — error writing calibration constants. -ERR_ANA_CALIB SEE ALSO brdInit, anaInConfig, anaIn, anaInmAmps, anaInDiff, anaInVolts BL4S100 User’s Manual...
  • Page 85 ± 4 V 0–4 V GAIN_X5 0–2.5 V ± 2.5 V 0–2.5 V GAIN_X8 0–2 V ± 2 V 0–2 V GAIN_X10 0–1.25 V ± 1.25 V 0–1.25 V GAIN_X16 0–1 V ± 1 V 0–1 V GAIN_X20 BL4S100 User’s Manual...
  • Page 86 A/D converter operation errors (will not create run-time error): BL_TIMEOUT BL_OVERFLOW BL_WRONG_MODE System errors (can create run-time error unless disabled): — fault detected in reading calibration factor -ERR_ANA_CALIB — invalid parameter value. -ERR_ANA_INVAL SEE ALSO brdInit, anaInConfig, anaInCalib, anaInmAmps, anaInDiff, anaInVolts BL4S100 User’s Manual...
  • Page 87 ± 4 V 0–4 V GAIN_X5 0–2.5 V ± 2.5 V 0–2.5 V GAIN_X8 0–2 V ± 2 V 0–2 V GAIN_X10 0–1.25 V ± 1.25 V 0–1.25 V GAIN_X16 0–1 V ± 1 V 0–1 V GAIN_X20 BL4S100 User’s Manual...
  • Page 88 — A/D converter is in wrong mode (run BL_WRONG_MODE anaInConfig() System errors (can create run-time error unless disabled): — fault detected in reading calibration facto.r -ERR_ANA_CALIB — invalid parameter value. -ERR_ANA_INVAL SEE ALSO brdInit, anaInConfig, anaIn, anaInmAmps, anaInDiff, anaInCalib BL4S100 User’s Manual...
  • Page 89 0–5 V GAIN_X4 ×5 ± 4 V 0–4 V GAIN_X5 ×8 ± 2.5 V 0–2.5 V GAIN_X8 ×10 ± 2 V 0–2 V GAIN_X10 ×16 ± 1.25 V 0–1.25 V GAIN_X16 ×20 ± 1 V 0–1 V GAIN_X20 BL4S100 User’s Manual...
  • Page 90 — A/D converter is in wrong mode (run BL_WRONG_MODE anaInConfig() System errors (can create run-time error unless disabled): — fault detected in reading calibration factor. -ERR_ANA_CALIB — invalid parameter value. -ERR_ANA_INVAL SEE ALSO brdInit, anaInConfig, anaIn, anaInmAmps, anaInVolts, anaInCalib BL4S100 User’s Manual...
  • Page 91 — A/D converter is in wrong mode (run BL_WRONG_MODE anaInConfig() System errors (can create run-time error unless disabled): — fault detected in reading calibration factor. -ERR_ANA_CALIB — invalid parameter value. -ERR_ANA_INVAL SEE ALSO brdInit, anaInConfig, anaIn, anaInDiff, anaInVolts, anaInCalib BL4S100 User’s Manual...
  • Page 92 ±5 V GAIN_X4 0–4 V ±4 V GAIN_X5 0–2.5 V ±2.5 V GAIN_X8 0–2 V ±2 V GAIN_X10 0–1.25 V ±1.25 V GAIN_X16 0–1 V ±1 V GAIN_X20 calibration structure pointer to gain and offset values pcal_data BL4S100 User’s Manual...
  • Page 93 (continued) RETURN VALUE 0 — success. -1 — invalid address or range. -2 — no valid user block found (block version 3 or later) -3 — flash read error — invalid parameter -EINVAL SEE ALSO anaInCalib, _anaInAddr BL4S100 User’s Manual...
  • Page 94 MSB is set high for direct-mode access. The format is as follows: D6–D4 D3–D0 gain_code channel_code Use the following calculation and tables to determine cmd = 0x80 | (gain_code<<4) + channel_code Multiplier gain_code BL4S100 User’s Manual...
  • Page 95 BL_ERRCODESTART — conversion incomplete, busy bit timeout BL_TIMEOUT — overflow or out of range BL_OVERFLOW System errors (can create run-time error unless disabled): — invalid parameter value -ERR_ANA_INVAL SEE ALSO anaInConfig, anaIn, brdInit BL4S100 User’s Manual...
  • Page 96: Sram Use

    4.4.6 SRAM Use The BL4S100 has a battery-backed data SRAM and a program-execution SRAM. Dynamic C provides the keyword to identify variables that are to be placed protected into the battery-backed SRAM. The compiler generates code that maintains two copies of each protected variable in the battery-backed SRAM.
  • Page 97: Chapter 5. Using The Ethernet Tcp/Ip Features

    If you do not have access to an Ethernet network, use a crossover CAT 5/6 Ethernet cable to connect the BL4S100 to a PC that at least has a 10Base-T Ethernet card. If you have Ethernet access, use a straight-through CAT 5/6 Ethernet cable to establish an Ethernet connection to the BL4S100 from an Ethernet hub.
  • Page 98 Direct Connection Using a Hub (network of 2 computers) Figure 17. Ethernet Connections The PC running Dynamic C through the serial programming port on the BL4S100 does not need to be the PC with the Ethernet card. 3. Apply Power Plug in the AC adapter.
  • Page 99: Tcp/Ip Sample Programs

    These programs require that you connect your PC and the BL4S100 together on the same network. This network can be a local private network (pre- ferred for initial experimentation and debugging), or a connection via the Internet.
  • Page 100: How To Set Up Your Computer For Direct Connect

    IP Address : 10.10.6.101 Netmask : 255.255.255.0 Default gateway : 10.10.6.1 4. Click to exit the various dialog boxes. <OK> <Close> BL4S100 Board IP 10.10.6.101 Netmask 255.255.255.0 User’s PC crossover CAT 5/6 Ethernet cable Direct Connection PC to BL4S100 BL4S100 User’s Manual...
  • Page 101: Run The 5.2.4 Running More Demo Programs With A Direct Connection

    Dynamic C. When the program starts running, the green light on the BL4S100 should be on to indicate an Ethernet connection is made. (Note: If the light does not light, you may not have a crossover cable, or if you are using a hub perhaps the power is off on the hub.)
  • Page 102 • RWEB_DIGITAL_OUTPUTS.C digOut() sinking digital outputs on the BL4S100 to toggle the LEDs on the Demonstration Board on/off. Once the sample program is compiled and running, open your PC Web browser. As long as you have not modified the...
  • Page 103 Now use a wire to touch +5 V from header J4 on the BL4S100 to the various digital and analog inputs on header J3, J15, and J16 —Uses the SMTP library to send an e-mail when a pushbutton switch on the •...
  • Page 104: Where Do I Go From Here

    5.3 Where Do I Go From Here? NOTE: If you purchased your BL4S100 through a distributor or Rabbit partner, contact the distributor or partner first for technical support. If there are any problems at this point: • Use the Dynamic C menu to get further assistance with Dynamic C.
  • Page 105: Chapter 6. Using The Zigbee Features

    IEEE 802.15.4 stan- dard for wireless personal area networks (WPANs). The XBee RF module used by the BL4S100 and the BL4S150 operates in the 2.4 GHz industrial, scientific, and medical (ISM) radio band in most jurisdictions worldwide.
  • Page 106: Zigbee Sample Programs

    Refer to Chapter 2, “Getting Started,” if you need further information on these steps. NOTE: The Digi XBee USB device is an optional accessory and is not a part of the stan- dard BL4S200 Tool Kit. See section F.2 Digi XBee USB Configuration for more infor- mation on the Digi XBee USB device.
  • Page 107: Setting Up The Digi Xbee Usb Coordinator

    6.2.1 Setting Up the Digi XBee USB Coordinator 1. Connect the Digi XBee USB acting as a ZigBee coordinator to an available USB port on your PC or workstation. Your PC should recognize the new USB hardware. 2. Connect the Demonstration Board to the BL4S100 as shown below.
  • Page 108 • 1 stop bit Now select the COM port the Digi XBee USB is connected to, and click the “Open Com Port” button. The message “Radio Found” is displayed to indicate that you selected the correct COM port. The ZigBee parameters (firmware version, operating channel, PAN ID) for the Digi XBee USB will be displayed in the “Radio Parameters”...
  • Page 109: Setting Up Sample Programs

    Try pinging the selected device by clicking the “Send Ping” button. 6.2.2 Setting up Sample Programs The sample programs are set up so that the BL4S100/Bl4S150 you are using is a ZigBee router, coordinator, or end device. Uncomment the line corresponding to the role the BL4S100/Bl4S150 will have once it is running the sample program.
  • Page 110 DEFAULT_PANID Dynamic C library, otherwise defaults to LIB\Rabbit4000\XBee\XBEE_API.LIB to match the default used on the Digi XBee USB. 0x0123456789abcdef If set to , tells coordinators to “select a random extended PAN ID,” and tells routers 0x00 and end devices to “join any network.”...
  • Page 111 XBEE_GPIO_GUI.exe Utilities\XBee GPIO GUI folder) on your PC. Configure the GUI client to connect to the Digi USB XBee coordi- nator and scan for devices. Make sure the BL4S100/BL4S150 and the Digi USB XBee coordinator are configured with the same PAN ID.
  • Page 112 You can use the Web browser to control the boards. Note that the XB24-ZB_2x40 firmware allows you to set digital outputs on all node types, but analog and digital inputs can only be read on end devices. BL4S100 User’s Manual...
  • Page 113: Dynamic C Function Calls

    Introduction to ZigBee, which is included in the online documentation set. 6.4 Where Do I Go From Here? NOTE: If you purchased your BL4S100/BL4S150 through a distributor or through a Rabbit partner, contact the distributor or partner first for technical support.
  • Page 114: Appendix A. Specifications

    A. S PPENDIX PECIFICATIONS Appendix A provides the specifications for the BL4S100. BL4S100 User’s Manual...
  • Page 115: Electrical And Mechanical Specifications

    A.1 Electrical and Mechanical Specifications Figure A-1 shows the mechanical dimensions for the BL4S100. 0.125 dia × 4 (3.2) 0.375 0.497 (9.5) (12.6) RJ-45 jack extends 0.12" (3.1 mm) R26 R34 past edge of board ® Micro-Fit connector R48 R49 extends 0.11"...
  • Page 116 Table A-1 lists the electrical, mechanical, and environmental specifications for the BL4S100. Table A-1. BL4S100 Specifications Feature BL4S100 BL4S110 BL4S150 BL4S160 Microprocessor Rabbit 4000 at 40.00 MHz Ethernet Interface 10Base-T ZigBee PRO ZigBee PRO ZigBee Interface — — (802.15.4) (802.15.4)
  • Page 117: Exclusion Zone

    It is recommended that you allow for an “exclusion zone” of 0.25" (6 mm) around the BL4S100 in all directions when the BL4S100 is incorporated into an assembly that includes other components. This “exclusion zone” that you keep free of other components and boards will allow for sufficient air flow, and will help to minimize any electrical or EMI interference between adjacent boards.
  • Page 118: Jumper Configurations

    A.2 Jumper Configurations Figure A-3 shows the header locations used to configure the various BL4S100 options via jumpers. Battery Figure A-3. Location of BL4S100 Configurable Positions Table A-2 lists the configuration options. Table A-2. BL4S100 Jumper Configurations Factory Header Description...
  • Page 119 Table A-2. BL4S100 Jumper Configurations (continued) Factory Header Description Pins Connected Default × None Voltage Option A/D Converter Voltage/Current 1–2 AIN2 4–20 mA option Measurement Options 5–6 AIN3 4–20 mA option × None Voltage Option A/D Converter Voltage/Current 1–2 AIN0 4–20 mA option Measurement Options 5–6 AIN1 4–20 mA option...
  • Page 120: Use Of Rabbit Microprocessor Parallel Ports

    A.3 Use of Rabbit Microprocessor Parallel Ports Table A-3 lists the Rabbit microprocessor parallel ports and their use in the BL4S100 boards. Table A-3. Use of Rabbit Microprocessor Parallel Ports Port Signal Initial State PA0–PA7 Rabbit RIO D0–D7 Bus data line...
  • Page 121 Output Serial Flash /CS Inactive high Output Ethernet LINK Inactive high (LED off) Output XBee /RTS Output Ethernet ACT Inactive high (LED off) BUFEN Output /CS (A/D converter) Inactive high Output CLK to Rabbit RIO CPU clock BL4S100 User’s Manual...
  • Page 122: Appendix B. Power Supply

    The input voltage range is from 9 V to 36 V. A switching power regulator is used to provide +5 V for the BL4S100 logic circuits. In turn, the regulated +5 V DC power supply is used to drive regulated +1.8 V and +3.3 V power supplies.
  • Page 123: Batteries And External Battery Connections

    SRAM and the real-time clock (VRAM) is provided by two different sources, depending on whether the main part of the BL4S100 is powered or not. When the BL4S100 is powered normally, and the +3.3 V supply is within operating limits, the SRAM and the real-time clock are powered from the +3.3 V supply.
  • Page 124: Appendix C. Demonstration Board

    C. D PPENDIX EMONSTRATION OARD Appendix C explains how to use the Demonstration Board with the BL4S100 sample programs. BL4S100 User’s Manual...
  • Page 125: Connecting Demonstration Board

    1. Use wires to connect screw-terminal header J3 on the Demonstration Board to header J4 on the BL4S100. The connections are shown in Figure C-1, with the green wire to GND and the blue wire to +V. 2. Make sure that your BL4S100 is connected to your PC via the programming cable and that the power supply is connected to the BL4S100 and plugged in as described in Chapter 2, “Getting Started.”...
  • Page 126: Demonstration Board Features

    Figure C-2. Demonstration Board Pinout C.2.2 Configuration The pushbutton switches may be configured active high or active low via jumper settings on header JP15. ACTIVE LOW JP15 3.3 kW SW1–SW4 ACTIVE HIGH JP15 3.3 kW SW1–SW4 Figure C-3. Pushbutton Switch Configuration BL4S100 User’s Manual...
  • Page 127 +V_ALT location to allow you to vary the voltage at +V_ALT from 0 V to +V. Figure C-5 shows the location of the adjustable output voltage and the potentiometer. Figure C-5. Location of Adjustable Output Voltage BL4S100 User’s Manual...
  • Page 128: Appendix D. Rabbit Rio Resource Allocation

    LLOCATION Appendix D provides the pin and block associations on the Rabbit RIO chip with their corresponding I/O on the BL4S100 boards. The main shared resource within the RIO chips are the counter/timer blocks — the RIO chip has eight counter/timer blocks. A given block is defined by the block number.
  • Page 129: Digital I/O Pin Associations

    D.1 Digital I/O Pin Associations Table D-1. Digital I/O Pin Associations I/O Pin Block OUT0 OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 OUT7 IN10 IN11 BL4S100 User’s Manual...
  • Page 130: Interpreting Error Codes

    D.2 Interpreting Error Codes Some BL4S100 function calls may return a Mode Conflict error code. This error code is a 4-bit value that identifies other pins using the same counter/timer block on a RIO chip that require this block to be in a mode that conflicts with the functionality that has already been requested —...
  • Page 131 # — I/O can generally share the timer, but will be affected by settings of the limit value (value at which the timer rolls over) or resetting of the counter, either directly or through synch signals. BL4S100 User’s Manual...
  • Page 132: Appendix E. Plastic Enclosure

    NCLOSURE The plastic enclosure provides a secure way to protect your BL4S100. The enclosure itself may be mounted on any flat surface. The complete plastic enclosure consists of a base and a cover. The base alone is a convenient surface on which to mount the BL4S100, and also provides a means to mount the BL4S100 on any flat surface.
  • Page 133: Assembly Instructions

    1. Attach the BL4S100 board to the plastic enclosure base. Position the BL4S100 board over the plastic enclosure base as shown below in Figure E-1. Attach the BL4S100 to the base using the four 4-40 × ¼ screws supplied with the enclo- sure base.
  • Page 134 4-40 × ½ screws supplied. R1 1 R26 R34 AIN2 AIN3 R94 R91 C113 C100 R95 R96 C112 ADC PROGRAMMER AIN0 AIN1 R115 AIN0 AIN1 AIN2 AIN3 AIN4 AIN5 AIN6 AIN7 AGND IN11 IN10 Figure E-2. Attach Enclosure Top BL4S100 User’s Manual...
  • Page 135: Dimensions

    When fully assembled, the total height of the plastic enclosure will be 1.5" (38 mm). NOTE: All measurements are in inches followed by millimeters enclosed in parentheses. All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm). BL4S100 User’s Manual...
  • Page 136: Appendix F. Additional Configuration Instructions

    F.1 XBee Module Firmware Downloads By default, the BL4S100/BL4S150 is shipped from the factory with firmware to operate as a router in a mesh network. You will need to run the MODEMFWLOAD.C sample program in the Dynamic C SAMPLES\XBEE folder to download the firmware needed to operate the BL4S100/BL4S150 as a coordinator or as an end device.
  • Page 137: Digi Xbee Usb Configuration

    #define XBEE_PROTOCOL XBEE_PROTOCOL_ZB F.2 Digi XBee USB Configuration The Digi XBee USB device is an optional accessory and is available as a part of the Mesh Networking Add on Kit (101-1272), or for separate purchase (101-1286). It is not a part of the standard BL4S200 Tool Kit.
  • Page 138: Additional Reference Information

    6. Finish by clicking the “Write” button. F.2.1 Additional Reference Information Check digi.com for the latest information and documentation on the XBee Series 2 mod- ule, the XCTU utility, and the Digi XBee USB. Note that the XBee™ and the XBee BL4S100 User’s Manual...
  • Page 139 PRO™ RF modules are presently not compatible with the XBee Series 2 module used with the BL4S100/BL4S150, but the general documentation about ZigBee and the use of AT commands for the XBee and the XBee PRO RF modules is relevant.
  • Page 140: Update Digi Xbee Usb Firmware

    BL4S100/BL4S150. If you have updated the BL4S100/BL4S150 firm- ware (or you have a need to re-install the firmware on the Digi XBee USB), the corre- sponding firmware for the Digi XBee USB is in the Dynamic C Utilities\X-CTU\ folder.
  • Page 141: Index

    ... 22 anaInConfig() ....80 configuration ....135 dimensions anaInDiff() ....87 uploading new firmware . 138 BL4S100 main board ..113 anaInDriver() ....92 digital I/O plastic enclosure ....133 anaInmAmps() ....89 function calls Dynamic C ....7, 33, 34 anaInRdCalib() ....
  • Page 142 ........4 models ........5 RS-232 ........25 firmware download BL4S100 ......5 Run Mode ......30 Digi® XBee USB ... 138 BL4S110 ......5 firmware updates ..138 BL4S150 ......5 XBee module ....134 BL4S160 ......5 sample programs ...
  • Page 143 Ethernet port ..... 26 setup ........11 VBAT RAM memory ... 32 power supply connections . 11 software ........7 libraries ......47 BL4S100 ....... 47 XBee module BL4S1xx.LIB ....47 additional resources ..111 PACKET.LIB ....79 firmware download ..134 RS232.LIB ....
  • Page 144: Schematics

    CHEMATICS The schematics for 090-0265 BL4S100, 090-0252 USB Programming Cable, and 090 Rab- www.digi.com/products/embedded-sys- bit Demonstration Board are available at: tems/single-board-computers/bl4s100#productsupport. BL4S100 User’s Manual...

Table of Contents