Rabbit BL4S200 User Manual

Rabbit BL4S200 User Manual

C-programmable single-board computer with networking
Hide thumbs Also See for BL4S200:
Table of Contents

Advertisement

Quick Links

BL4S200
C-Programmable Single-Board Computer with Networking
User's Manual
019–0171_E

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Rabbit BL4S200

  • Page 1 BL4S200 C-Programmable Single-Board Computer with Networking User’s Manual 019–0171_E...
  • 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 Rabbit Web site, www.rabbit.com, for free, unregistered download. Digi International Inc.
  • Page 3: Table Of Contents

    1.3.3 Optional Add-Ons .........................9 1.4 RabbitNet Peripheral Cards ........................10 1.5 CE Compliance ...........................11 1.5.1 Design Guidelines ........................12 1.5.2 Interfacing the BL4S200 to Other Devices.................12 1.6 Wi-Fi Certifications (BL5S220 Model only)..................13 1.6.1 FCC Part 15 Class B ........................13 1.6.2 Industry Canada Labeling ......................14 1.6.3 Europe ............................15...
  • Page 4 4.2.1 Digital I/O ...........................55 4.2.2 Serial Communication.........................60 4.2.3 A/D Converter Inputs........................62 4.2.4 D/A Converter Outputs .......................64 4.2.5 Use of microSD™ Cards with BL4S200 Model .................66 4.2.6 Real-Time Clock .........................66 4.2.7 TCP/IP Sample Programs ......................66 4.3 BL4S200 Libraries..........................67 4.4 BL4S200 Function Calls........................68 4.4.1 Board Initialization ........................68...
  • Page 5 A.1 Electrical and Mechanical Specifications ..................169 A.1.1 Exclusion Zone.........................173 A.1.2 Headers.............................173 A.2 Conformal Coating...........................174 A.3 Jumper Configurations........................175 A.4 Use of Rabbit Microprocessor Parallel Ports...................177 Appendix B. Power Supply B.1 Power Supplies..........................178 B.1.1 Power for Analog Circuits......................179 B.2 Batteries and External Battery Connections ..................179 B.2.1 Replacing the Backup Battery ....................180...
  • Page 6: Chapter 1. Introduction

    1.1 BL4S200 Description Throughout this manual, the term BL4S200 refers to the complete series of BL4S200 single- board computers unless other production models are referred to specifically. The BL4S200 is an advanced single-board computer that incorporates the powerful Rabbit...
  • Page 7 RCM4010 RCM5400W RCM4510W (ZB) Note that the BL5S220 model is named as such to reflect that it uses a Rabbit 5000 micro- processor. BL4S200 single-board computers consist of a main board with a RabbitCore module. Refer to the RabbitCore module manuals, available on the site, for more information on the RabbitCore modules, including their schematics.
  • Page 8: Development And Evaluation Tools

    ZigBee network connectivity, configurable I/O, high-current outputs, RS-232 and RS-485 serial I/O, and an A/D converter. These Getting Started instructions included with the Tool Kit will help you get your BL4S200 up and running so that you can run the sample programs to explore its capabilities and develop your own applications.
  • Page 9: Software

    Rabbit sales representative or authorized distributor 1.3.3 Optional Add-Ons Rabbit has available a Mesh Network Add-On Kit and additional tools and parts to help you to make your own wiring assemblies with the friction-lock connectors. • Mesh Network Add-On Kit (Part No. 101-1272) ®...
  • Page 10: Rabbitnet Peripheral Cards

    (twisted-pair differential signaling) to run at a fast 1 Megabit per second serial rate. BL4S200 single-board computers have two RabbitNet ports, each of which can sup- port one peripheral card. Distances between a master processor unit and peripheral cards can be up to 10 m or 33 ft.
  • Page 11: Ce Compliance

    These limits apply over the range of 30–230 MHz. The limits are 7 dB higher for frequen- cies above 230 MHz. Although the test range goes to 1 GHz, the emissions from Rabbit- based systems at frequencies above 300 MHz are generally well below background noise levels.
  • Page 12: Design Guidelines

    • When connecting the BL4S200 single-board computer to outdoor cables, the customer is responsible for providing CE-approved surge/lighting protection. • Rabbit recommends placing digital I/O or analog cables that are 3 m or longer in a metal conduit to assist in maintaining CE compliance and to conform to good cable design practices.
  • Page 13: Wi-Fi Certifications (Bl5S220 Model Only)

    • Increase the separation between the equipment and the receiver. • Connect the equipment into an outlet on a circuit different from that to which the receiver is connected. • Consult the dealer or an experienced radio/TV technician for help. BL4S200 User’s Manual...
  • Page 14: Industry Canada Labeling

    This device must not be co-located or operating in conjunction with any other antenna or transmitter. 1.6.2 Industry Canada Labeling 7143A-E59C4472 This Class B digital apparatus complies with Canadian standard ICES-003. Cet appareil numérique de la classe B est conforme à la norme NMB-003 du Canada. BL4S200 User’s Manual...
  • Page 15: Europe

    The equipment shall be marked, where applicable, in accordance with CEPT/ERC Rec- ommendation 70-03 or Directive 1999/5/EC, whichever is applicable. Where this is not applicable, the equipment shall be marked in accordance with the National Regulatory requirements. BL4S200 User’s Manual...
  • Page 16: Chapter 2. Getting Started

    BL4S200. NOTE: If you ever need to remove the RabbitCore module, take care to keep the BL4S200 main boards and their corresponding RabbitCore modules paired since the RabbitCore modules store calibration constants specific to the BL4S200 main board to which they are plugged in.
  • Page 17: Bl4S200 Connections

    J1 on the PROG BL4S200’s RabbitCore module (the programming header is labeled J2 on the BL5S220 and BL4S230 models). Ensure that the colored edge lines up with pin 1 as shown. (Do not use the connector, which is used for monitoring only.) Connect the other end of the...
  • Page 18: Hardware Reset

    2. Connect the power supply to header J5 on the BL4S200 as shown in Figure 4. Be sure to match the latch mechanism with the top of the connector to header J5 on the BL4S200 as shown. The Micro-Fit connector will only fit one way.
  • Page 19: Installing Dynamic C

    If you have not yet installed Dynamic C version 10.42 (or a later version), do so now by inserting the Dynamic C CD from the BL4S200 Tool Kit in your PC’s CD-ROM drive. If autorun is enabled, the CD installation will begin automatically.
  • Page 20: 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 BL4S200 with the marked (col- ored) edge of the programming cable towards pin 1 of the programming header. Ensure that the module is firmly and correctly installed in its connectors on the BL4S200 board.
  • Page 21: Run A Wi-Fi Sample Program (Bl5S220 Only)

    STDIO • Channel—the channel the access point is on (1–11). • Signal—the signal strength of the access point. • MAC—the hardware (MAC) address of access point. • Access Point SSID—the SSID the access point is using. BL4S200 User’s Manual...
  • Page 22: Run A Zigbee Sample Program (Bl4S230 Only)

    [AT]NI "Node ID String" (where quotes contain string data) Enter AT Command: Appendix F provides additional configuration information if you experience conflicts while doing development simultaneously with more than one ZigBee coordinator, or if you wish to upload new firmware. BL4S200 User’s Manual...
  • Page 23: Where Do I Go From Here

    • Use the Technical Support e-mail form at www.rabbit.com/support/. If the sample program ran fine, you are now ready to go on to explore other BL4S200 features and develop your own applications. When you start to develop your application, run in the USERBLOCK_READ_WRITE.C...
  • Page 24: Chapter 3. Subsystems

    Chapter 3 describes the principal subsystems for the BL4S200. • Digital I/O • Serial Communication • A/D Converter Inputs • D/A Converter Outputs • Analog Reference Voltages Circuit • Memory Figure 5 shows these Rabbit-based subsystems designed into the BL4S200. RS-232 Data Configurable 32 kHz 58.98 MHz Network...
  • Page 25: Bl4S200 Pinouts

    3.1 BL4S200 Pinouts The BL4S200 pinouts are shown in Figure 6. RabbitNet Serial Ports E and F are Power not available on BL4S210 Supply BL4S210 RabbitNet RabbitNet Power Supply Analog Battery High- Current Outputs RS-485 RS-232 High- Current Outputs General-...
  • Page 26: Connectors

    3.1.1 Connectors Standard BL4S200 models are equipped with seven polarized 2 × 5 Micro-Fit connectors ® (J1–J4 and J9–J11), one polarized 2 × 7 Micro-Fit connector (J12), and one polarized ® 2 × 3 connector at J7 to supply power (DCIN and +5 V) to up to two RabbitNet periph- eral expansion boards.
  • Page 27: Digital I/O

    3.2.1 Configurable I/O 3.2.1.1 Digital Inputs The BL4S200 has 32 configurable I/O, DIO0–DIO31, each of which may be configured individually in software as either digital inputs or as sinking digital outputs. By default, a configurable I/O channel is a digital input, but may be set as a sinking digital output by using the function call.
  • Page 28 Table 3 lists the banks of configurable I/O and summarizes the jumper settings. Table 3. Banks of BL4S200 Digital Inputs Configuration Digital Inputs Pins Jumpered Pulled Up/Pulled Down Header DIO0–DIO7 1–2 Inputs pulled up to +Kx DIO8–DIO15 3–4 Inputs pulled up to +5 V DIO16–DIO23...
  • Page 29 Sinking Output setting Table 4 lists the banks of configurable Figure 9. Load and +K Power Supply Connections for Sinking Digital Output I/O and the corresponding +Kx. Table 4. BL4S200 Sinking Outputs Configuration Pins Digital Inputs Pulled Up/Pulled Down Jumpered Header DIO0–DIO7...
  • Page 30 PWM outputs. The use of these channels for PWM, interrupts, input cap- ture, and as quadrature decoders is described in the Rabbit RIO User’s Manual. Blocks of configurable I/O pins are associated with counters/timers on the three Rabbit RIO chips that support them. Table 5 provides complete details for these associations.
  • Page 31 I/O. High-current outputs have their own function calls that end with See Appendix D for additional information about the Rabbit RIO pin associations and how to select which special functionality to best apply to a particular pin.
  • Page 32 Interrupt, Counter, and Event Capture Setup External interrupts on the BL4S200 configurable I/O pins are configured using the function call. The interrupt can be set up to occur on a rising edge, setExtInterrupt() a falling edge, or either edge. An input channel may be set up to count...
  • Page 33 Shifted Offset outputs are on the same block of a particu- lar Rabbit RIO chip PWM and PPM outputs on the BL4S200 configurable I/O are configured using the set- function calls. PWM and PPM outputs on the BL4S200 high-cur- PWM()
  • Page 34: High-Current Digital Outputs

    All the digital outputs sink and source actively. They can be used as high-side drivers, low- side drivers, or as an H-bridge driver. When the BL4S200 is first powered up or reset, all the outputs are disabled, that is, at a high-impedance tristate.
  • Page 35 I/O counterparts. The function call configures the digOutConfig_H() high-current outputs as two state outputs with either sinking or sourcing drivers. The function call configures the high-current outputs as digOutTriStateConfig_H() tristate drivers with both sinking and sourcing capability. BL4S200 User’s Manual...
  • Page 36: Serial Communication

    In this mode, a clock line synchronously clocks the data in or out. Either of the two communicating devices can supply the clock. The BL4S200 boards supports standard asynchronous baud rates from 3.7 Mbps to 9.2 Mbps, depending on the frequency the Rabbit microprocessor on a particular model is operating at.
  • Page 37 The BL4S200 can be used in an RS-485 multidrop network. Connect the 485+ to 485+ and 485– to 485– using single twisted-pair wires (nonstranded, tinned) as shown in Figure 12. Note that a common ground is recommended. Figure 12. BL4S200 Multidrop Network The BL4S200 comes with a 220 ...
  • Page 38: Programming Port

    • Programming/debugging • Cloning The programming port is used to start the BL4S200 in a mode where the BL4S200 will download a program from the port and then execute the program. The programming port transmits information to and from a PC while a program is being debugged.
  • Page 39: Ethernet Port

    3.3.4 Ethernet Port Figure 14 shows the pinout for the Ethernet port (J2 on the BL4S200 modules that support Ethernet networking). Note that there are two standards for numbering the pins on this con- nector—the convention used here, and numbering in reverse to that shown. Regardless of...
  • Page 40: A/D Converter Inputs

    3.4 A/D Converter Inputs The single A/D converter chip used in the BL4S200 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 ampli- fier. 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 41 The A/D converter inputs are factory-calibrated, and the calibration constants are stored in the user block. When you start to develop your application, run USERBLOCK_READ_WRITE.C in the SAMPLES\UserBlock folder to save the factory calibration constants in case you inad- vertently write over them while running the sample programs. BL4S200 User’s Manual...
  • Page 42: A/D Converter Calibration

    Single-Ended, bipolar AD_RD_SE_BIPOLAR.C ADC_CAL_SE_BIPOLAR.C Differential, bipolar AD_RD_DIFF.C ADC_CAL_DIFF.C Milli-Amp AD_RD_MA.C ADC_CAL_MA.C These sample programs are found in the subdirectory in . See SAMPLES\BLxS2xx Section 4.2.3 for more information on these sample programs and how to use them. BL4S200 User’s Manual...
  • Page 43: D/A Converter Outputs

    0 to +10 V (default) 1–3 — 3–4 AOUT0 ±10 V 5–6 1–3 — 4–20 mA — 3–5 — 1–2 0 to +10 V (default) — 2–4 3–4 AOUT1 ±10 V — 2–4 5–6 4–20 mA — 4–6 — BL4S200 User’s Manual...
  • Page 44: D/A Converter Calibration

    Sample programs are provided to illustrate how to calibrate the various D/A outputs for the three operating modes. Mode Calibrate Voltage DAC_CAL_VOLTS.C Current DAC_CAL_MA.C These sample programs are found in the subdirectory in . See SAMPLES\BLxS2xx Section 4.2.4 for more information on these sample programs and how to use them. BL4S200 User’s Manual...
  • Page 45: Analog Reference Voltages Circuit

    BL4S200 User’s Manual...
  • Page 46: Usb Programming Cable

    The USB programming cable is used to connect the serial programming port of the BL4S200 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 47: Other Hardware

    The clock doubler on the BL4S230 is disabled by default. The clock doubler may be disabled on the BL4S200 Ethernet models (BL4S200 and BL4S210)if the higher clock speeds are not required. Disabling the clock doubler will reduce power consumption and further reduce radiated emissions.
  • Page 48: Spectrum Spreader

    OK to save the macro. value whenever a program is compiled using this project file . NOTE: Refer to the Rabbit 4000 Microprocessor User’s Manual and the Rabbit 5000 Microprocessor User’s Manual for more information on the spectrum-spreading set- tings and the maximum clock speed.
  • Page 49: Memory

    To remove it, gently press the card towards the middle of the RabbitCore module on the BL4S200 model — you will sense a soft click and the card will be ready to be removed. Do not attempt to pull the card from the socket before pressing it in — otherwise the ejection mechanism will get damaged.
  • Page 50 Standard Windows SD Card readers may be used to read the microSD™ Card formatted by the Dynamic C FAT file system with the BL4S200 as long as it has not been parti- tioned. SD Card adapters have a sliding switch along the left side that may be moved down to write-protect the microSD™...
  • Page 51: Chapter 4. Software

    4.1 Running Dynamic C You have a choice of doing your software development in the flash memory or in the static RAM included on the BL4S200. The flash memory and SRAM options are selected with menu. Options > Project Options > Compiler The advantage of working in RAM is to save wear on the flash memory, which is limited to about 100,000 write cycles.
  • Page 52  LCD display and keypad drivers. • Powerful language extensions for cooperative or preemptive multitasking • Loader utility program to load binary images into Rabbit targets in the absence of Dynamic C. • Provision for customers to create their own source code libraries and augment on-line help by creating “function description”...
  • Page 53: Upgrading Dynamic C

    The default installation of a patch or update is to install the file in a directory (folder) different from that of the original Dynamic C installation. Rabbit recommends using a different directory so that you can verify the operation of the patch or update without over- writing the existing Dynamic C installation.
  • Page 54: Sample Programs

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

    Using • DIGIN_BANK.C digInBank() the 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. BL4S200 User’s Manual...
  • Page 56 Demonstration Board, you can see an LED toggle on/off via a sinking output. —Demonstrates the use of to control the configurable • DIGOUT_BANK.C digOutBank() I/O sinking outputs. Using the Demonstration Board, you can see an LED toggle on/off via a sinking output. BL4S200 User’s Manual...
  • Page 57 LEDs on the Demonstra- tion Board. Output HOUT3 is configured as a sinking output to toggle an LED on the Demonstration Board. —Demonstrates the use of the Rabbit RIO interrupt service capabilities. • INTERRUPTS.C Set up the Demonstration Board as shown in Figure 21 with DIO0 connected to SW1.
  • Page 58 We take advantage of the counter synchronization feature of the underlying Rabbit RIO chip to create capture windows and pulse modulation windows that are synchronized.
  • Page 59 —Demonstrates the use of quadrature decoders on the • QUADRATURE_DECODER.C BL4S200. See Figure 24 for hookup instructions of configurable I/O pins DIO0–DIO6 on connector J10 with the Demonstration Board. JP15 DIGITAL I/O DIO0–DIO3 CONNECTOR J10 BL4S200 DIO0 DIO1 DIO6 DIO2...
  • Page 60: Serial Communication

    Follow these instructions before running this STDIO sample program. BL4S200, BL5S220, BL4S230 models—Connect TxE (pin 1 on connector J11) to RxF (pin 7 on connector J11), then connect TxF (pin 2 on connector J11) to RxE (pin 6 on connector J11) before compiling and running this sample program.
  • Page 61 BL4S200 and display them in the window. Use to program STDIO MASTER.C the master BL4S200. Make the following connections between the master and slave: 485+ to 485+ (pin 9 on connector J11) MASTER SLAVE 485- to 485- (pin 4 on connector J11) GND to GND (pin 5 on connector J11) BL4S200 User’s Manual...
  • Page 62: A/D Converter Inputs

    AGND, then compile and run the sample program, and follow the instructions in the Dynamic C window. STDIO —Demonstrates how to display the two calibration coefficients, • ADC_RD_CALDATA.C gain and offset, in the Dynamic C window for each channel and mode of STDIO operation. BL4S200 User’s Manual...
  • Page 63 Before you compile and run this sample program, connect the power supply (which should be OFF) between a pin (AIN0–AIN7) and AGND, then compile and run the sample program, and follow the instructions in the Dynamic C window. STDIO BL4S200 User’s Manual...
  • Page 64: D/A Converter Outputs

    Before you compile and run this sample program, connect pins 3–5 and 4–6 on header JP5, and verify that jumpers are in place across pins 1–2 and 3–4 on both headers JP3 (AOUT0) and JP6 (AOUT1). Now set up an ammeter in series with the D/A converter BL4S200 User’s Manual...
  • Page 65 5–6 on both headers JP3 and JP6 (bipolar). Now connect a voltmeter across one of the D/A converter outputs, then compile and run the sample program, and follow the instructions in the Dynamic C window. STDIO BL4S200 User’s Manual...
  • Page 66: Use Of Microsd™ Cards With Bl4S200 Model

    4.2.5 Use of microSD™ Cards with BL4S200 Model The following sample program can be found in the SAMPLES\BLxS2xx\SD_Flash folder. —This program is a utility for inspecting the contents of a • SDFLASH_INSPECT.c microSD™ Card. It provides examples of both reading and writing pages or sectors to the a microSD™...
  • Page 67: Bl4S200 Libraries

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

    4.4 BL4S200 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 the system I/O ports. The ports are initialized according to Table A-3 in Appendix A.
  • Page 69: Digital I/O

    The logic state of the specified channel. 0 — logic low 1 — logic high — channel value is out of range. -EINVAL :— pin functionality does not permit this operation. -EPERM SEE ALSO brdInit, setDigIn, digInBank BL4S200 User’s Manual...
  • Page 70 DIO19 DIO27 DIO4 DIO12 DIO20 DIO28 DIO5 DIO13 DIO21 DIO29 DIO6 DIO14 DIO22 DIO30 DIO7 DIO15 DIO23 DIO31 — invalid parameter value. -EINVAL — pin functionality does not permit this operation. -EPERM SEE ALSO brdInit, digIn, setDigIn BL4S200 User’s Manual...
  • Page 71 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 BL4S200 User’s Manual...
  • Page 72 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 BL4S200 User’s Manual...
  • Page 73 The low 5 bits are the channel number for the down count input If the stop on match mode is selected, has the match options count to stop at (other match registers on the block are set to max.). BL4S200 User’s Manual...
  • Page 74 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 BL4S200 User’s Manual...
  • Page 75 — begin event on falling edge BL_EVENT_FALL — begin event on any edge BL_EVENT_BOTH The following two settings are only for the mode: ON_BEGIN — begin active while signal is high BL_BEGIN_HIGH — begin active while signal is low BL_BEGIN_LOW BL4S200 User’s Manual...
  • Page 76 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, setLimit BL4S200 User’s Manual...
  • Page 77 Reads the current value of the begin register within the counter block hosting the given channel. PARAMETERS a channel that uses the desired counter block channel pointer to word variable to place begin register reading begin RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, setCapture, resetCounter BL4S200 User’s Manual...
  • Page 78 The active block is determined by the function the configurable I/O channel is set up to perform. PARAMETER a channel that uses the desired counter block channel RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, getCounter, setDecoder BL4S200 User’s Manual...
  • Page 79 PARAMETERS a channel that uses the desired counter block channel new value for the limit register limit RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, setCapture, resetCounter BL4S200 User’s Manual...
  • Page 80 RETURN VALUE 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 BL4S200 User’s Manual...
  • Page 81 0 — connects the load to GND 1 — puts the output in a high-impedance tristate RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, digOut, digOutBank BL4S200 User’s Manual...
  • Page 82 0 — connects the load to GND 1 — puts the output in a high-impedance tristate. RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — pin function was not set up as a digital output -EPERM SEE ALSO brdInit, setDigOut, digOutBank BL4S200 User’s Manual...
  • Page 83 Bitwise value: 0 — connects the load to GND 1 — puts the output in a high-impedance tristate. RETURN VALUE 0 — success. — invalid parameter value or board not initialized. -EINVAL SEE ALSO brdInit, digOut, setDigOut BL4S200 User’s Manual...
  • Page 84 PWM output on this channel to another PWM or PPM output on a channel hosted by same RIO chip and block. Bindings allow PWM and PPM outputs to align their leading and trailing edges. BL4S200 User’s Manual...
  • Page 85 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, setToggle, setSync, pulseDisable BL4S200 User’s Manual...
  • Page 86 BL_BIND_LEAD BL_BIND_TRAIL leading edge of the PPM signal to another PWM or PPM output on a channel hosted by same RIO chip and block. Bindings allow PWM and PPM outputs to align their leading and trailing edges. BL4S200 User’s Manual...
  • Page 87 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, setToggle, setSync, pulseDisable BL4S200 User’s Manual...
  • Page 88 PWM and PPM outputs frequency (should be from 2 Hz to 50 kHz) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, setPWM, setPPM, setOffset, setDuty, setToggle, setSync BL4S200 User’s Manual...
  • Page 89 100.0% will be set to 100.0%) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM, setPPM, setOffset, setFreq, setToggle, setSync BL4S200 User’s Manual...
  • Page 90 RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM, setPPM, setFreq, setDuty, setToggle, setSync BL4S200 User’s Manual...
  • Page 91 PARAMETER channel that is getting its PWM/PPM enabled, channel 0–29 (DIO0–DIO29) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM, setPPM, pulseDisable BL4S200 User’s Manual...
  • Page 92: High-Current Outputs

    = 0x26; // 0 0 1 0 0 1 1 0 // HOUT7–HOUT6 = Sinking // HOUT5 = Sourcing // HOUT4–HOUT3 = Sinking // HOUT2–HOUT1 = Sourcing // HOUT0 = Sinking RETURN VALUE 0 — success. — board initialization not performed. -EINVAL SEE ALSO brdInit, digOut_H, digOutTriStateConfig_H BL4S200 User’s Manual...
  • Page 93 0 — connects the load in a high-impedance tristate 1 — connects the load to +K1 or + K2. RETURN VALUE 0 — success. — if not configured correctly or invalid parameter. -EINVAL SEE ALSO brdInit, digOutConfig_H BL4S200 User’s Manual...
  • Page 94 // HOUT6 = Tristate enabled // HOUT5 = Tristate disabled // HOUT4–HOUT3 = Tristate enabledg // HOUT2–HOUT1 = Tristate disabled // HOUT0 = Tristate enabled RETURN VALUE 0 — success. — board initialization not performed. -EINVAL SEE ALSO brdInit, digOutTriState_H, digOutConfig_H BL4S200 User’s Manual...
  • Page 95 1 — connects the load to +K1 or + K2. 2 — puts the output in a high-impedance tristate RETURN VALUE 0 — success. — invalid parameter or channel not configured for tristate. -EINVAL SEE ALSO brdInit, digOutTriStateConfig_H BL4S200 User’s Manual...
  • Page 96 PWM output on this channel to another PWM or PPM output on a channel hosted by same RIO chip and block. Bindings allow PWM and PPM outputs to align their leading and trailing edges. BL4S200 User’s Manual...
  • Page 97 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_H, setDuty_H, setToggle_H, setSync_H BL4S200 User’s Manual...
  • Page 98 BL_BIND_LEAD BL_BIND_TRAIL leading edge of the PPM signal to another PWM or PPM output on a channel hosted by same RIO chip and block. Bindings allow PWM and PPM outputs to align their leading and trailing edges. BL4S200 User’s Manual...
  • Page 99 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_H, setOffset_H, setDuty_H, setToggle_H, setSync_H BL4S200 User’s Manual...
  • Page 100 PWM and PPM outputs frequency (should be from 2 Hz to 50 kHz) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, setPWM_H, setPPM_H, setOffset_H, setDuty_H, setToggle_H, setSync_H BL4S200 User’s Manual...
  • Page 101 100.0% will be set to 100.0%) RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM_H, setPPM_H, setOffset_H, setFreq_H, setToggle_H, setSync_H BL4S200 User’s Manual...
  • Page 102 RETURN VALUE 0 — success. — invalid parameter value. -EINVAL — channel function does not permit this operation. -EPERM SEE ALSO brdInit, setPWM_H, setPPM_H, setFreq_H, setDuty_H, setToggle_H, setSync_H BL4S200 User’s Manual...
  • Page 103 — synchronize event on rising edge BL_EDGE_RISE — synchronize event on falling edge BL_EDGE_FALL — synchronize events on both edges BL_EDGE_BOTH RETURN VALUE 0 — success. — invalid parameter value. -EINVAL SEE ALSO brdInit, setPWM_H, setPPM_H BL4S200 User’s Manual...
  • Page 104: Rabbit Rio Interrupt Handlers

    4.4.4 Rabbit RIO Interrupt Handlers addISR int addISR(int channel, int io, int ier, void (*handler)()); FUNCTION DESCRIPTION Adds an interrupt handler for the interrupts specified in the parameter for the given RIO block hosting the given configurable I/O pin. The interrupt service routine (ISR) is always disabled when created.
  • Page 105 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 addISR, tickISR, enableISR, setIER BL4S200 User’s Manual...
  • Page 106 (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 addISR, addISR_H, enableISR, tickISR BL4S200 User’s Manual...
  • Page 107 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 addISR, addISR_H, enableISR, setIER BL4S200 User’s Manual...
  • Page 108: 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 BL4S200. serMode int serMode(int mode);...
  • Page 109 Disables the RS-485 transmitter. This puts you in listen mode, which allows you to receive data from the RS-485 interface. must be executed before running serMode() this function call. RETURN VALUE None. SEE ALSO brdInit, serMode, ser485Tx BL4S200 User’s Manual...
  • Page 110: A/D Converter Inputs

    NOTE: If you plan to configure the D/A converter chip using , you must anaOutConfig call before executing . This is because the A/D anaOutConfig() anaInConfig() converter uses internal channels 2–7 on the D/A converter chip to bias the A/D converter input circuit. BL4S200 User’s Manual...
  • Page 111 — single-ended bipolar (±10 V) SE1_MODE — differential bipolar (±20 V) DIFF_MODE — 4–20 mA operation mAMP_MODE RETURN VALUE: 0 — success. — SPI port busy. BL_SPIBUSY — invalid parameter. -EINVAL SEE ALSO brdInit, anaInCalib, anaIn, anaInVolts, anaInmAmps, anaInDiff BL4S200 User’s Manual...
  • Page 112 Use one of the opmode following macros to set the mode for the channel being configured. = single-ended unipolar (0–20 V) SE0_mode = single-ended bipolar (±10 V) SE1_mode = differential bipolar (±20 V) DIFF_MODE = 4–20 mA mAMP_mode BL4S200 User’s Manual...
  • Page 113 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 BL4S200 User’s Manual...
  • Page 114 0–4 V ±2 V ± 4 V GAIN_X5 0–2.5 V ±1.25 V ± 2.5 V GAIN_X8 0–2 V ±1 V ± 2 V GAIN_X10 0–1.25 V — ± 1.25 V GAIN_X16 0–1 V — ± 1 V GAIN_X20 BL4S200 User’s Manual...
  • Page 115 BL_ERRCODESTART A/D converter operation errors (will not create run-time error): BL_SPIBUSY BL_TIMEOUT BL_OVERFLOW BL_WRONG_MODE System errors (can create run-time error unless disabled): — invalid parameter value. -ERR_ANA_INVAL SEE ALSO brdInit, anaInConfig, anaInCalib, anaInmAmps, anaInDiff, anaInVolts BL4S200 User’s Manual...
  • Page 116 0–20 V ±10 V GAIN_X1 0–10 V ±5 V GAIN_X2 0–5 V ±2.5 V GAIN_X4 0–4 V ±2 V GAIN_X5 0–2.5 V ±1.25 V GAIN_X8 0–2 V ±1 V GAIN_X10 0–1.25 V — GAIN_X16 0–1 V — GAIN_X20 BL4S200 User’s Manual...
  • Page 117 — 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 BL4S200 User’s Manual...
  • Page 118 ± 4 V ± 2 V GAIN_X5 ×8 ± 2.5 V ± 1.25 V GAIN_X8 ×10 ± 2 V ± 1 V GAIN_X10 ×16 ± 1.25 V ± 0.625 V GAIN_X16 ×20 ± 1 V ± 0,5 V GAIN_X20 BL4S200 User’s Manual...
  • Page 119 — 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 BL4S200 User’s Manual...
  • Page 120 — 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 BL4S200 User’s Manual...
  • Page 121 Single-Ended channel_code channel_code Input Lines Input Lines Input Lines +AIN0 -AIN1 +AIN0 +AIN0 +AIN2 -AIN3 +AIN1 +AIN1 +AIN4 -AIN5 +AIN2 +AIN2 +AIN6 -AIN7 +AIN3 +AIN3 Reserved +AIN4 Reserved Reserved +AIN5 Reserved Reserved +AIN6 Reserved Reserved +AIN7 Reserved BL4S200 User’s Manual...
  • Page 122 (continued) The BL4S200 boards were designed to extend the A/D converter input circuit configu- rations, which is done by the function call. The following table maps anaInConfig() the BL4S200 A/D converter configurations to the A/D converter listed channel_code above:...
  • Page 123: D/A Converter Outputs

    1 = synchronous—all outputs are updated with data previously written when the function is executed. anaOutStrobe() RETURN VALUE 0 — success. — SPI port busy. BL_SPIBUSY — invalid configuration parameter. -EINVAL — error reading calibration constants. -ERR_ANA_CALIB SEE ALSO brdInit, anaOut, anaOutmAmps, anaOutStrobe, anaOutConfig, anaOutCalib BL4S200 User’s Manual...
  • Page 124 1 — Channel 0 2 — Channel 1 3 — Channels 0 and 1 RETURN VALUE 0 — success. — SPI port busy. BL_SPIBUSY SEE ALSO brdInit, anaOut, anaOutmAmps, anaOutConfig, anaOutCalib BL4S200 User’s Manual...
  • Page 125 FUNCTION DESCRIPTION This function enables or disables the BL4S200 power supply that is used to power the D/A converter voltage or current output circuits. CAUTION: Do not call this function until you have configured both D/A converter channels to the desired voltage or current operation.
  • Page 126 D/A converter value volts2 (0–10 V, ±10 V or 4– 20 mA) RETURN VALUE 0 — success. — invalid parameter. -EINVAL -ERR_ANA_CALIB — error writing calibration constants. SEE ALSO brdInit, anaOut, anaOutVolts, anaOutmAmps, anaOutStrobe, anaOutConfig BL4S200 User’s Manual...
  • Page 127 (0–4095). If a value larger than 4095 is given, the channel will be set to maximum (4095). RETURN VALUE 0 — success. — SPI port busy. BL_SPIBUSY SEE ALSO anaOutDriver, anaOutVolts, anaOutCalib BL4S200 User’s Manual...
  • Page 128 AOUT0–AOUT1 the voltage desired on the output channel voltage RETURN VALUE 0 — success. — SPI port busy. BL_SPIBUSY — invalid config parameter. -ERR_ANA_INVAL — error reading calibration data. -ERR_ANA_CALIB SEE ALSO brdInit, anaOut, anaOutStrobe, anaOutConfig, anaOutCalib BL4S200 User’s Manual...
  • Page 129 (valid range is 4–20 mA) current RETURN VALUE 0 — success. BL_SPIBUSY — SPI port busy. — error reading calibration data. -ERR_ANA_CALIB SEE ALSO brdInit, anaOut, anaOutVolts, anaOutStrobe, anaOutConfig, anaOutCalib BL4S200 User’s Manual...
  • Page 130 PARAMETER parameter format is as follows: D15–D12 D11–D0 channel rawdata value (0–7) (0–4095) Use the following calculation and tables to determine cmd = (channel<<12) | rawdata value RETURN VALUE 0 — success. — SPI port busy. BL_SPIBUSY BL4S200 User’s Manual...
  • Page 131: Sram Use

    4.4.8 SRAM Use The BL4S200 model and some memory variations described in Table 1 have a battery- backed data SRAM and a program-execution SRAM. Dynamic C provides the keyword to identify variables that are to be placed into the battery-backed protected SRAM.
  • Page 132: Chapter 5. Using The Ethernet Tcp/Ip Features

    • Two RJ-45 straight-through CAT 5/6 Ethernet cables and a hub, or an RJ-45 crossover CAT 5/6 Ethernet cable. The CAT 5/6 Ethernet cables and Ethernet hub are available from Rabbit in a TCP/IP tool kit. More information is available at www.rabbit.com.
  • Page 133 Direct Connection Using a Hub (network of 2 computers) Figure 25. Ethernet Connections The PC running Dynamic C through the serial programming port on the BL4S200 does not need to be the PC with the Ethernet card. 3. Apply Power Plug in the AC adapter.
  • Page 134: Tcp/Ip Sample Programs

    These programs require that you connect your PC and the BL4S200 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 135: 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> BL4S200 Board IP 10.10.6.101 Netmask 255.255.255.0 User’s PC crossover CAT 5/6 Ethernet cable Direct Connection PC to BL4S200 BL4S200 User’s Manual...
  • Page 136: Run The 5.2.4 Running More Demo Programs With A Direct Connection

    5.2.3 Run the PINGME.C Demo Connect the crossover cable from your computer’s Ethernet port to the BL4S200’s RJ-45 Ethernet connector. Open this sample program from the folder, SAMPLES\TCPIP\ICMP compile the program, and start it running under Dynamic C. When the program starts run-...
  • Page 137: Where Do I Go From Here

    BL4S200 using the Telnet protocol. This program takes anything that comes in on a port and sends it out Serial Port E (BL4S200) or Serial Port B (BL4S210). It uses a digital input to indicate that the TCP/IP connection should be closed and a digital output to toggle an LED to indicate that there is an active connection.
  • Page 138: Chapter 6. Using The Wi-Fi Features

    Chapter 6 discusses using the TCP/IP Wi-Fi features on the BL5S220 board. This networking feature is not available on other BL4S200 models, which have other network interfaces. 6.1 Introduction to Wi-Fi Wi-Fi, a popular name for 802.11b/g, refers to the underlying technology for wireless local area networks (WLAN) based on the IEEE 802.11 suite of specifications conforming to...
  • Page 139: Ad-Hoc Mode

    LAN such as an Ethernet. This works fine for a few devices that are statically configured to talk to each other, and no access point is needed. 6.1.3 Additional Information 802.11 Wireless Networking; published by O'Reilly Media, provides further information about 802.11b wireless networks. BL4S200 User’s Manual...
  • Page 140: Running Wi-Fi Sample Programs

    Each sample program has comments that describe the purpose and function of the pro- gram. Follow the instructions at the beginning of the sample program. Complete information on Dynamic C is provided in the Dynamic C User’s Manual. BL4S200 User’s Manual...
  • Page 141: Wi-Fi Setup

    RX43 UX14 RX97 RX59 RX75 RX49 RX55 RX57 RX73 CX27 VREF AGND CX25 CX23 RX77 RX79 UX16 JP25 Infrastructure Mode (via Ethernet connection) Ethernet Ethernet Infrastructure Mode (via wireless connection) Ad-Hoc Mode Figure 26. Wi-Fi Host Setup BL4S200 User’s Manual...
  • Page 142: What Else You Will Need

    6.2.2 What Else You Will Need Besides what is supplied with the BL4S200 Tool Kit, you will need a PC with an available USB port to program the BL5S220. You will need either an access point for an existing Wi-Fi network that you are allowed to access and have a PC or notebook connected to that network (infrastructure mode), or you will need at least a PDA or PC with Wi-Fi to use the ad-hoc mode.
  • Page 143: Configuration Information

    NOTE: TCPCONFIG 0 is not supported for Wi-Fi applications. There are some other “standard” configurations for . Their values are docu- TCPCONFIG mented in the library. More information LIB\Rabbit4000\TCPIP\TCP_CONFIG.LIB is available in the Dynamic C TCP/IP User’s Manual. BL4S200 User’s Manual...
  • Page 144 The IP address and netmask need to be set regardless of whether you will be using the ad-hoc mode or the infrastructure mode. 3. Click to exit the various dialog boxes. <OK> <Close> BL4S200 User’s Manual...
  • Page 145 You will have set your wireless network name with the Wi-Fi channel macros for the ad- hoc mode as explained in Section 6.3, “Dynamic C Wi-Fi Configurations.” BL4S200 User’s Manual...
  • Page 146: Wi-Fi Sample Programs

    The country or region you select will automatically set the power and channel require- ments to operate the BL5S220. Rabbit recommends that you check the regulations for the country where your system incorporating the BL5S220 will be deployed for any...
  • Page 147 The country or region you select will automatically set the power and channel require- ments to operate the BL5S220. Rabbit recommends that you check the regulations for the country where your system incorporating the BL5S220 will be deployed for any other requirements.
  • Page 148 Before you compile and run this sample program, check the TCP/IP configuration parameters, the IP address, and the SSID in the macros, which are reproduced below. #define TCPCONFIG 1 #define IFC_WIFI_ENCRYPTION IFPARAM_WIFI_ENCR_WEP BL4S200 User’s Manual...
  • Page 149 You may set up a Wi-Fi enabled laptop with the IP address in to get the pings. IPADDR_2 If you have two BL5S220 boards, they will ping each other, and the Dynamic C STDIO window will display the pings. BL4S200 User’s Manual...
  • Page 150 IFS_WIFI_SCAN the scan takes a fair amount of time. Instead, callback functions are used. The callback function is passed to as the only parameter to ifconfig() IFS_WIFI_SCAN ifconfig(IF_WIFI0, IFS_WIFI_SCAN, scan_callback, IFS_END); BL4S200 User’s Manual...
  • Page 151: Rcm5400W Sample Programs

    The sample program uses macros to configure the access point for WPA PSK, specify the TKIP cypher suite, assign the access point SSID, and set the passphrase. #define WIFI_USE_WPA // Bring in WPA support #define IFC_WIFI_ENCRYPTION IFPARAM_WIFI_ENCR_TKIP // Define cypher suite #define IFC_WIFI_SSID "parvati" #define IFC_WIFI_WPA_PSK_PASSPHRASE "now is the time" BL4S200 User’s Manual...
  • Page 152 VERBOSE Once you have compiled the sample program and it is running, LED DS2 will flash when a ping is sent, and LED DS3 will flash when a ping is received. BL4S200 User’s Manual...
  • Page 153 Uncomment the VERBOSE define to see the incoming ping replies. Finally, compile and run this sample program. LED DS2 will flash when a ping is sent. LED DS3 will flash when a ping is received. BL4S200 User’s Manual...
  • Page 154: Dynamic C Wi-Fi Configurations

    6.3 Dynamic C Wi-Fi Configurations Rabbit has implemented a packet driver for the BL5S220 that functions much like an Eth- ernet driver for the Dynamic C implementation of the TCP/IP protocol stack. In addition to functioning like an Ethernet packet driver, this driver implements a function call to access the functions implemented on the 802.11b/g interface, and to mask channels that...
  • Page 155 ) associated with the IFC_WIFI_WEP_KEYNUM macro (default ). One or more of the following additional macros must be defined as well. The default is for the keys to remain undefined. IFC_WIFI_WEP_KEY0_BIN IFC_WIFI_WEP_KEY0_HEXSTR IFC_WIFI_WEP_KEY1_BIN IFC_WIFI_WEP_KEY1_HEXSTR IFC_WIFI_WEP_KEY2_BIN IFC_WIFI_WEP_KEY2_HEXSTR IFC_WIFI_WEP_KEY3_BIN IFC_WIFI_WEP_KEY3_HEXSTR BL4S200 User’s Manual...
  • Page 156 "rabbitTest" "now is the time" Using a passphrase is rather slow. It takes a Rabbit 5000 more than 20 seconds to gen- erate the actual 256-bit key from the passphrase. If you use a passphrase and #define...
  • Page 157 It is also possible to redefine any of the above parameters dynamically using the ifcon- function call. Macros for alternative Wi-Fi configurations are provided with the fig() function call, and may be used to change the above default macros or ifconfig() configurations. BL4S200 User’s Manual...
  • Page 158: Configuring Tcp/Ip At Run Time

    Instead of executing the above sequence based on , you could use sock_init() sock_ as a debugging tool to transmit packets (ARP, DHCP, association, init_or_exit(1) and authentication) while bringing up the interface and to get the IP address. BL4S200 User’s Manual...
  • Page 159: Where Do I Go From Here

    6.4 Where Do I Go From Here? NOTE: If you purchased your BL5S220 through a distributor or through a 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 160: Chapter 7. Using The Zigbee Features

    Chapter 7 discusses using the ZigBee features on the BL4S230 board. This networking feature is not available on other BL4S200 models, which have other network interfaces. 7.1 Introduction to the ZigBee Protocol The ZigBee PRO specification was ratified in April, 2007, and covers high-level commu- nication protocols for small, low-power digital modems based on the IEEE 802.15.4 stan-...
  • Page 161: 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 information on the Digi XBee USB device.
  • Page 162: Setting Up The Digi Xbee Usb Coordinator

    — if you have problems launching the ZigBee Utilities\XBee GPIO GUI Utility, install a .Net Framework by double-clicking in the Dynamic C dotnetfx.exe folder. You may add a shortcut to the ZigBee Utility on your Utilities\dotnetfx desktop. BL4S200 User’s Manual...
  • Page 163 XBee USB and recompile the sample program once you make sure the ® BL4S230 is powered up. The timeout may occur if you are doing development simulta- neously with more than one ZigBee coordinator. Appendix F explains the steps to reconfigure the Digi XBee USB. ® BL4S200 User’s Manual...
  • Page 164: Setting Up Sample Programs

    There are several macros that may be changed to facilitate your setup. The macros can be included as part of the program code, or they may be put into the Program Options “Defines” on the “Defines” tab in the menu. Options > Program Options BL4S200 User’s Manual...
  • Page 165 AT commands. Several commands can either set a parameter or read it. This sample program simply reads the parameters and displays the results. Compile and run this sample program. The program will display the results in the Dynamic C window. STDIO BL4S200 User’s Manual...
  • Page 166 RF module, set the PAN IDs to match between the client and the server sample programs. Now select the GPIO server and use the GUI interface on the PC, or the command-line client on another XBee-equipped board to view the server's inputs and change its outputs. BL4S200 User’s Manual...
  • Page 167: Dynamic C Function Calls

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

    A. S PPENDIX PECIFICATIONS Appendix A provides the specifications for the BL4S200 and describes the conformal coating. BL4S200 User’s Manual...
  • Page 169: Electrical And Mechanical Specifications

    A.1 Electrical and Mechanical Specifications Figures A-1(a) and A-1(b) show the mechanical dimensions for the BL4S200. 5.00 0.375 0.375 (9.5) (9.5) (127) 0.734 0.734 0.734 0.734 0.416 0.380 0.171 (10.6) (9.7) 0.125 dia (18.6) (18.6) (18.6) (18.6) (4.3) × 4 (3.2)
  • Page 170 (127) 5.75 (146) 0.66 0.47 0.29 (12) (17) (7.4) 3.75 (96) Figure A-1(b). BL5S220/BL4S230 Dimensions NOTE: All measurements are in inches followed by millimeters enclosed in parentheses. All dimensions have a manufacturing tolerance of ±0.01" (0.25 mm). BL4S200 User’s Manual...
  • Page 171 Table A-1 lists the electrical, mechanical, and environmental specifications for the BL4S200. Table A-1. BL4S200 Specifications Feature BL4S200 BL4S210 BL5S220 BL4S230 ® ® Rabbit 5000 at Rabbit 4000 ® Microprocessor Rabbit 4000 at 58.98 MHz 73.73 MHz 29.49 MHz 10/100Base-T,...
  • Page 172 Table A-1. BL4S200 Specifications (continued) Feature BL4S200 BL4S210 BL5S220 BL4S230 5 serial ports: 4 serial ports: 5 serial ports: • • • one RS-485 one RS-485 one RS-485 • • • two RS-232 one RS-232 two RS-232 or one RS-232...
  • Page 173: Exclusion Zone

    It is recommended that you allow for an “exclusion zone” of 0.25" (6 mm) around the BL4S200 in all directions when the BL4S200 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 174: Conformal Coating

    A.2 Conformal Coating The areas around the crystal oscillator and the battery backup circuit on the BL4S200 modules based on the Rabbit 4000 microprocessor have had the Dow Corning silicone- based 1-2620 conformal coating applied. The conformal coating protects these high- impedance circuits from the effects of moisture and contaminants over time.
  • Page 175: Jumper Configurations

    A.3 Jumper Configurations Figure A-3 shows the header locations used to configure the various BL4S200 options via jumpers. LINK JP12 SPEED JP13 JP14 JP10 JP11 Battery C15 C16 R28 R27 R26 Figure A-3. Location of BL4S200 Configurable Positions Table A-2 lists the configuration options.
  • Page 176 Table A-2. BL4S200 Jumper Configurations Factory Header Description Pins Connected Default 1–2 × 0 to +10 V D/A converter output 3–4 AOUT0 5–6 ±10 V D/A convert output × None Voltage Option 1–2 AIN0 4–20 mA option A/D Converter Voltage/Current 3–4 AIN1 4–20 mA option...
  • Page 177: Use Of Rabbit Microprocessor Parallel Ports

    A.4 Use of Rabbit Microprocessor Parallel Ports Table A-3 lists the Rabbit microprocessor parallel ports and their use in the BL4S200 boards. Table A-3. Use of Rabbit Microprocessor Parallel Ports Port Signal Initial State PA0–PA7 ID0–ID7 Pulled up Input ADC busy (BL4S210)
  • Page 178: 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 BL4S200 logic circuits. In turn, the regulated +5 V DC power supply is used to drive two regulated +3.3 V power supplies and ±12 V power supplies used by the op- amps driving the outputs.
  • Page 179: Power For Analog Circuits

    The drain on the battery is typi- cally less than 10 µA when there is no external power applied to the BL4S200, and so the expected shelf life of the battery is 235 mA·h...
  • Page 180: Replacing The Backup Battery

    + side facing up. NOTE: The SRAM contents and the real-time clock settings will be lost if the battery is replaced with no power applied to the BL4S200. Exercise care if you replace the battery while external power is applied to the BL4S200.
  • Page 181: Power To Peripheral Cards

    ® boards that may be used with the BL4S200. Keep in mind that the BL4S200 draws 377 mA from the Vcc supply, and that the diode at D10 (shown in Figure B-1) can handle at most 2 A at V...
  • Page 182: Appendix C. Demonstration Board

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

    BL4S200. 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 BL4S200 is connected to your PC via the programming cable and that the power supply is connected to the BL4S200 and plugged in as described in Chapter 2, “Getting Started.”...
  • Page 184: 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 BL4S200 User’s Manual...
  • Page 185 J1. There is a potentiometer immediately above the +V_ALT location to allow you to reduce the voltage from the +V originally input. Figure C-5 shows the location of the adjustable output voltage and the potentiometer. Figure C-5. Location of Adjustable Output Voltage BL4S200 User’s Manual...
  • Page 186: Appendix D. Rabbit Rio Resource Allocation

    The main shared resource within the RIO chips are the counter/timer blocks — each RIO chip has eight counter/timer blocks. The BL4S200 boards have three RIO chips, which gives a total of 24 blocks. A given block is defined by both the RIO number and the block number.
  • Page 187: Configurable I/O Pin Associations

    DIO1 DIO2 DIO3 DIO4 DIO5 DIO6 DIO7 DIO8 DIO9 DIO10 DIO11 DIO12 DIO13 DIO14 DIO15 DIO16 DIO17 DIO18 DIO19 DIO20 DIO21 DIO22 DIO23 DIO24 DIO25 DIO26 DIO27 DIO28 DIO29 DIO30 Not controlled by any RIO chip DIO31 BL4S200 User’s Manual...
  • Page 188: High-Current Output Pin Associations

    HOUT7 D.3 Interpreting Error Codes Some BL4S200 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 particular RIO chip that require this block to be in a mode that conflicts with the functionality that has already been requested —...
  • Page 189 # — 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. BL4S200 User’s Manual...
  • Page 190: Appendix E. Rabbitnet

    PPENDIX ABBIT E.1 General RabbitNet Description RabbitNet is a high-speed synchronous protocol developed by Rabbit to connect periph- eral cards to a master and to allow them to communicate with each other. E.1.1 RabbitNet Connections All RabbitNet connections are made point to point. A RabbitNet master port can only be connected directly to a peripheral card, and the number of peripheral cards is limited by the number of available RabbitNet ports on the master.
  • Page 191: Rabbitnet Peripheral Cards

    Power = 0.156" friction-lock connectors RabbitNet = RJ-45 connector Visit our Web site for up-to-date information about additional cards and features as they become available. The Web site also has the latest revision of this user’s manual. BL4S200 User’s Manual...
  • Page 192: Physical Implementation

    Although a peripheral card could theoretically be up to 45 m (150 ft) from the master for a data rate of 1 MHz, Rabbit recommends a practical limit of 10 m (33 ft). Connections between peripheral cards and masters are done using standard 8-conductor CAT 5/6 Ethernet cables.
  • Page 193: Function Calls

    = 0x03, both RabbitNet ports 0 and portflag 1 will need to be serviced. enables or disables each RabbitNet port as set by the port flags. servicetype 0 = disable port 1 = enable port RETURN VALUE BL4S200 User’s Manual...
  • Page 194 7,6— 2-bit binary representation of the port number on the master 5,4,3—Level 1 router downstream port 2,1,0—Level 2 router downstream port RETURN VALUE Pointer to device information. -1 indicates that the peripheral card either cannot be identified or is not connected to the master. SEE ALSO rn_find BL4S200 User’s Manual...
  • Page 195 = RN_MATCH_PORT|RN_MATCH_SN; newdev.ports = 0x03; //search ports 0 and 1 newdev.serialnum = E3446C01L; handle = rn_find(&newdev); RETURN VALUE Returns the handle of the first device matching the criteria. 0 indicates no such devices were found. SEE ALSO rn_device BL4S200 User’s Manual...
  • Page 196 RETURN VALUE The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master, and -2 means that the data length was greater than 15. SEE ALSO rn_read BL4S200 User’s Manual...
  • Page 197 RETURN VALUE The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master, and -2 means that the data length was greater than 15. SEE ALSO rn_write BL4S200 User’s Manual...
  • Page 198 0.025 to 6.375 seconds in increments of 0.025 timeout seconds. Entering a zero value will disable the software watchdog timer. RETURN VALUE The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master. BL4S200 User’s Manual...
  • Page 199 1 enables hardware watchdog timer 2 enables software watchdog timer RETURN VALUE The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master. SEE ALSO rn_hitwd, rn_sw_wdt BL4S200 User’s Manual...
  • Page 200 The equivalent time left in seconds can be determined from count × 0.025 seconds. RETURN VALUE The status byte from the previous command. -1 means that device information indicates the peripheral card is not connected to the master. SEE ALSO rn_enable_wdt, rn_sw_wdt BL4S200 User’s Manual...
  • Page 201 A set bit retdata indicates which error occurred. This register is cleared when read. 7—HW reset has occurred 6—SW reset has occurred 5—HW watchdog enabled 4—SW watchdog enabled 3,2,1,0—Reserved RETURN VALUE The status byte from the previous command. BL4S200 User’s Manual...
  • Page 202 6—Write collision MISO (master in, slave out) 5—Overrun MOSI (master out, slave in) 4—Mode fault, device detected hardware fault 3—Data compare error detected by device 2,1,0—Reserved RETURN VALUE The status byte from the previous command. BL4S200 User’s Manual...
  • Page 203: Status Byte

    1 = Last command unexecuted 0 = Not expired 1 = HW or SW watchdog timer × † expired * Use the function rn_comm_status() to determine which error occurred. † Use the function rn_rst_status() to determine which timer expired. BL4S200 User’s Manual...
  • Page 204: Appendix F. Additional Configuration Instructions

    CAUTION: Different firmware versions are likely to interact with the Dynamic C librar- ies in different ways. Rabbit has tested the firmware associated with a particular version of Dynamic C for correct operation, and only this version is included on the Dynamic C CD-ROM —...
  • Page 205: Digi ® Xbee Usb Configuration

    • Select the XBee role macro according to whether the BL4S230 is being used as a coor- dinator or a router. #define XBEE_ROLE NODE_TYPE_COORD #define XBEE_ROLE NODE_TYPE_ROUTER • Some Rabbit boards use the ZNet 2.5 protocol. The BL4S230 uses the ZB protocol. Make sure the statement calls for the ZB protocol. #define #define XBEE_PROTOCOL XBEE_PROTOCOL_ZB ®...
  • Page 206: Additional Reference Information

    XBee Series 2 module, the X-CTU utility, and the Digi XBee USB. Note that the XBee™ and the XBee ® PRO™ RF modules are presently not compatible with the XBee Series 2 module used BL4S200 User’s Manual...
  • Page 207 BL4S230, but the general documentation about ZigBee and the use of AT com- mands for the XBee™ and the XBee PRO™ RF modules is relevant. BL4S200 User’s Manual...
  • Page 208: Update Digi ® Xbee Usb Firmware

    CAUTION: Different firmware versions are likely to interact with the Dynamic C libraries in different ways. Rabbit has tested the firmware associated with a particular version of Dynamic C for correct operation, and only this version is included on the Dynamic C CD-ROM —...
  • Page 209: Index

    ....... 86 anaOutConfig ....123 Industry Canada ....14 setPWM() ...... 84 anaOutDriver() .... 130 labeling requirements ..14 setSync() ....... 80 anaOutmAmps() ..129 clock doubler ......47 digital inputs anaOutPwrOff() ..125 configurable I/O BL4S200 User’s Manual...
  • Page 210 ....100 memory ......... 49 dimensions setOffset_H() ....102 flash memory configurations BL4S200 main board ..169 setPPM_H() ..... 33, 98 Dynamic C ....9, 51, 52 setPWM_H() ... 33, 96 SRAM configuration for dif- add-on modules ... 19, 53 setSync_H() ....
  • Page 211 HIGH_CURRENT_IO.C .. REGION_COMPILE- RabbitNet peripheral cards ... 10 TIME.C ....146 connection to master 190, 191 INTERRUPTS.C ... 57 REGION_MULTI_DO- power from BL4S200 ..181 PPM.C ......58 MAIN.C ....147 power-supply connections ..PULSE_CAPTURE.C .. 58 REGION_RUNTIME_ PWM.C ......58 PING.C .....
  • Page 212 ....161 software ........9 10Base-T Ethernet card .. 132 router ....... 160 libraries ......67 additional resources ..137 BL4S200 ....... 67 Ethernet hub ....132 BLxS2xx.LIB ....67 steps ........ 132 PACKET.LIB ....108 Tool Kit ........8 RN_CFG_BLS2xx.LIB 67...
  • Page 213: Schematics

    CHEMATICS 090-0267 BL4S200 Schematic www.rabbit.com/documentation/schemat/090-0267.pdf 090-0227 RCM4000 Schematic www.rabbit.com/documentation/schemat/090-0227.pdf 090-0229 RCM4300 Schematic www.rabbit.com/documentation/schemat/090-0229.pdf 090-0266 RCM5400W Schematic www.rabbit.com/documentation/schemat/090-0266.pdf 090-0246 RCM4500W Schematic www.rabbit.com/documentation/schemat/090-0246.pdf 090-0252 USB Programming Cable Schematic www.rabbit.com/documentation/schemat/090-0252.pdf 090-0272 Rabbit Demonstration Board www.rabbit.com/documentation/schemat/090-0272.pdf You may use the URL information provided above to access the latest schematics directly.

Table of Contents