RabbitFLEX™ BL300F User’s Manual 019-0155 • 070720-D The latest revision of this manual is available on the Rabbit Web site, www.rabbit.com, for free, unregistered download.
RabbitFLEX BL300F User’s Manual Part Number 019-0155 • 070720–D • Printed in U.S.A. ©2006 Rabbit • All rights reserved. No part of the contents of this manual may be reproduced or transmitted in any form or by any means without the express written permission of Rabbit. Permission is granted to make one or more copies as long as the copyright page contained therein is included. These copies of the manuals may not be let or sold for any reason without the express written permission of Rabbit.
Table of Contents Chapter 1: RabbitFLEX BL300F Introduction 1 1.1 RabbitFLEX BL300F Options............................................................................................................................ 1 1.2 The RabbitFLEX Configurator ........................................................................................................................... 2 1.2.1 Configurator Access ............................................................................................................
.2.1 Connector Pinout Diagram ........................................................................................................................24 4.2.1.1 Connector 1 ........................................................................................................................................25 4.2.1.2 Connector 2 ........................................................................................................................................25 4.2.1.3 Connector 3 and 4 ..............
6.2 RabbitFLEX BL300F Files............................................................................................................................... 67 6.2.1 RabbitFLEX BL300F Libraries ................................................................................................................ 67 6.2.2 RabbitFLEX BL300F Design File ............................................................................................................ 67 6.3 RabbitFLEX BL300F Software Concepts ................
iv www.rabbit.
1. RABBITFLEX BL300F INTRODUCTION We all know you cannot fit a square peg into a round hole. But sometimes that is exactly what you are asked to do when forced to choose an off-the-shelf single-board computer (SBC) for your embedded system application. In the past, price and time constraints could make a custom-designed board unattainable. That has all changed with the introduction of the RabbitFLEX BL300F.
• Keypad Range of matrix keypad options: m x n, where m+n <=8 • LCD With or without backlight and/or contrast control • Power Routing 5 V available on all user-selectable connectors 3.45 V available on most connectors 1.2 The RabbitFLEX Configurator When designing and ordering a RabbitFLEX BL300F, you have the opportunity to tailor the board according to the demands of your application and not to limitations imposed by an off-the-shelf SBC.
1.3 RabbitFLEX Tool Kit The RabbitFLEX Tool Kit contains the software and the extra hardware needed to develop your application. This section lists the tool kit items. Tool Kit Items • RabbitFLEX BL300F Getting Started Instructions. • Programming cable, 10-pin header to DB9 connector with integrated level-matching circuitry. • 48 V AC, 800 mA center-tapped transformer. A transformer compatible with power outlets in continental Europe is included with kits sold overseas. • CD, containing Dynamic C 9.
1.4.1 Immunity The RabbitFlex series of single-board computers meets the following EN55024/1998 immunity standards. • EN61000-4-3 (Radiated Immunity) • EN61000-4-4 (EFT) • EN61000-4-6 (Conducted Immunity) Additional shielding or filtering may be required for a heavy industrial environment. 1.4.2 Emissions The RabbitFlex series of single-board computers meets the following emission standards.
1.4.4 Interfacing RabbitFlex to Other Devices Since the RabbitFlex series of single-board computers is designed to be connected to other devices, good EMI reduction practices should be followed to ensure compliance. CE compliance is ultimately the responsibility of the integrator. Additional information, tips, and technical assistance are available from your authorized Rabbit distributor, and are also available on our Web site at: www.rabbit.com. 1.
6 www.rabbit.
2. GETTING STARTED The information in this chapter will get you up and running. Follow the instructions given here to install, connect and verify the software and hardware components. 2.1 Hardware Preparation This section physically prepares the RabbitFLEX board for use in developing and debugging applications. As a way to place the board in a more convenient position for development, the first thing to do is screw on the hex standoffs that came in the RabbitFLEX as shown in Figure 2.1. Figure 2.
2.1.1 Hardware Connections There are two steps to readying the RabbitFLEX BL300F for use with Dynamic C: 1. Connect the programming cable between the RabbitFLEX BL300F and the host PC where you will install Dynamic C. 2. Connect the power supply. The core module comes attached to the RabbitFLEX BL300F from the factory. The core module and the board it is attached to are a matched set. They must be used together. Do not remove the core module and attach a different core module to the RabbitFLEX board. 2.1.1.
2.1.1.2 Connect Power Connect the locking plug of the AC adapter to connector J3 on the PowerCore module as shown in Figure 2.2. When the other end of the AC adapter is plugged into a power source, a small red LED labeled DS1 on the RabbitFLEX board (located in the corner by connector J5) will come on. You can cycle power to the board by unplugging and then plugging in the AC adapter. There is a reset button located on the top-right corner on your board that can be used restart the microcontroller. 2.
2.3 Verify Serial Connections Run the sample program pong.c to verify that everything is installed and connected properly. There are three ways to open a program from within Dynamic C: the File menu, the File icon or the keyboard shortcut Ctrl+O. They all open the same dialog box that allows you to browse for the file or type in its pathname. The sample program pong.c is in the Samples folder where you installed Dynamic C. Figure 2.
2.4 Ethernet Communication This section describes the additional hardware connections needed to use the RabbitFLEX BL300F Ethernet port. An Ethernet port is available on the PowerCore 3800, but not on the PowerCore 3810. You must have a core module with an Ethernet port and your host computer will need one as well. You may create a direct or an indirect network connection from the target board to the host computer.
2.4.1 Direct Connection A direct connection means that a crossover cable connects the target board to the host computer running Dynamic C. Plug one end of the crossover cable into the RJ-45 jack on the core module and the other end to the network interface card in your host PC. 2.4.2 Indirect Connection An indirect connection means that a straight-through cable connects the target board to an Ethernet network via a hub. 2.4.3 Setting IP Addresses IP addressing is necessary to communicate on networks.
2.4.4 Verify the Ethernet Connection Run the sample program ping.c to verify that everything is connected properly. The sample program ping.c is in the \Samples\tcpip folder where you installed Dynamic C. Press function key F9 to compile and run the program. Dynamic C will display a status message during compilation and download. If Dynamic C reports no errors and the Stdio window then opens and reports that ping responses were received from the remote host, as shown in the screenshot in Figure 2.
Figure 2.
Problems During and/or at the End of Compilation • A few computers have trouble handling the default 115,200 baud rate. Change the stop bits from 1 to 2 in the Communications tab of Project Options. If that does not work, slow the baud rate to 57,600 and try the compilation again. 2.7 Contact Information If there are any questions at this point: • If you purchased your RabbitFLEX BL300F through a distributor or through a Rabbit partner, contact the distributor or partner first for technical support.
16 www.rabbit.
3. DESIGN IMPLEMENTATION AND INFORMATION This chapter discusses the implementation of the RabbitFLEX™ SBC features. We start with information about the basic bare board, which is used as the foundation for all RabbitFLEX™ SBC boards. This foundation board is called the base board. Next, we discuss the physical and logical components that make up the feature set selected during the online ordering process. 3.
3.1.2 Board-Specific Information The PowerCore module and the board to which it is attached are linked by more than their physical connection. Switching the mated core module is not recommended, as the calibration and design numbers are contained in the core module and will thus no longer match the board. 3.1.2.1 System ID Block The System ID block is a reserved area in flash memory that contains identification information for the core module and the design number for the RabbitFLEX BL300F.
3.2.2.1 One-Transistor Cells Figure 3.2 shows the complete layout of a one-transistor cell. A one-transistor cell can handle dig- ital inputs, certain outputs, bidirectional logic and keypads. The one-transistor cells on connector J4 can also be used as analog inputs. Figure 3.2 One-Transistor Cell Q1B R2B R1 C1 R7 Q1A R2A RV1 R4B R4A R5 R3B R3A R6 3.2.2.2 Two-Transistor Cells A two-transistor cell is required for all sourcing outputs and the 1 A sinking output.
3.2.3 Board Map The board map shown in Figure 3.4 identifies the cell placement for each of the I/O pins. Each rectangle labeled “Jx PIN y” starts as an unconfigured cell before a circuit is selected and placed on it, causing it to become a configured cell. Figure 3.
Figure 3.5 shows the locations of the digital and analog interface cells corresponding to connectors J1–J5. Figure 3.
22 www.rabbit.
4. RABBITFLEX BL300F OPTIONS This chapter discusses the options available for customizing a RabbitFLEX BL300F. The options fall into one of three main categories: global, pin group or connector. Global Options Global options, as the name implies, have a more global effect on the board design than the options in the other two categories. Global options are things like the core module and serial communication channels.
4.2 Overview of Connector and Cell Association The table in this section summarizes the user-configurable connectors, their corresponding unconfigured cells and the available circuitry that can be used to configure the cells. (See Section 3.2 for more information about cells.) Table 4-1.
4.2.1.1 Connector 1 Connectors J1 through J5 all have digital I/O, power routing, ground and +K (external power) options. But the range of choices is greater in the digital I/O options for J1 through J3 because the pins are connected to two-transistor cells as opposed to the one-transistor cells of J4 and J5. Connectors J3 and J4 add the ability to be configured as analog inputs. If the LCD option is selected, it will populate the 8 available pins of J1.
4.2.1.3 Connector 3 and 4 The pinout diagram for J4 looks exactly like the one for J3. The difference is that J4 is made up of onetransistor cells and J3 is made up of two-transistor cells. This difference means that, for example, the pins on J4 can be configured for the 100 mA sinking driver or the 100 ohm line driver, but not the 1 A sinking driver or either of the sourcing drivers available on J1, J2, or J3. Also the 3.45 V power supply is not available on J4.
4.2.1.5 Connector 6 J6 differs from J1-J5, in that its pins can only be customized from the global options page of the RabbitFLEX Configurator. This is because J6 is used for serial communications and the speaker. Figure 4-7 Pinout Options for J6 TxD/E RxD/E 1 3 GND 2 4 GND 485- Speaker 9 7 8 GND 485+ RxF TxF J6 = Connector 6 4.2.2 Connector Mating Information The connectors J1 through J6 on the RabbitFLEX BL300F are Molex Micro-Fit 3.0 connectors, Molex part # 43045-1018.
4.3 RabbitFLEX BL300F Option Specifications This section lists all of the RabbitFLEX BL300F options, along with basic information and specifications. 4.3.1 Core Module There are currently two core modules available for the RabbitFLEX BL300F: the PowerCore 3800 and PowerCore 3810. The table in this section compares the features that differ between these modules. See the PowerCore FLEX User’s Manual for more information about these core modules. Table 4-2.
4.3.2 RS-232 You can select one of the following RS-232 channel configurations: • one 3-wire channel, or • two 3-wire channels, or • one 5-wire channel Serial port F is used for the first 3-wire channel. If you select two 3-wire channels, the second one will use serial port D or E. A 5-wire channel will use serial port F for transmit/receive and serial port D or E for the handshaking lines. Note that whether to use serial port D or E is a decision made when you are designing/ordering your board.
4.3.3 RS-485 You can select an RS-485 communications channel with or without termination or jumpered termination for the most flexibility. The header J8, between J6 and the RS-485/RabbitNet port, is the header for RS485 jumpered termination. J8 pin numbers are marked in Figure 4-8. Figure 4-8 Location of J8 for RS-485 Jumper Termination See Table 4-4 to determine jumper setting for enabling/disabling termination. Table 4-4.
4.3.4 RabbitNet RabbitNet is a high-speed synchronous protocol used to connect peripheral cards to a master and to allow them to communicate with each other. The available peripheral cards are: • • • • • Digital I/O ADC DAC Display/Keypad Interface Relay For complete information on RabbitNet see the RabbitNet Peripheral Cards User’s Manual and then any manuals specific to the peripheral card you are interested in. 4.3.
4.3.6.1 Keypad Inputs The RabbitFLEX Configurator will automatically assign pins from connector J5 as the keypad inputs and outputs. Keypad inputs and outputs are digital I/O circuits. Keypad inputs are read by the API function flexKeyProcess(). This function must be called frequently in a software application in order to poll the keypad for key presses. See sample program Samples/RabbitFLEX_BL300F/keypad.c for an example of how to use the keypad API functions.
4.3.6.2 Keypad Outputs The RabbitFLEX Configurator will automatically assign pins from connector J5 as the keypad inputs and outputs. Keypad inputs and outputs are digital I/O circuits. See sample program Samples/RabbitFLEX_BL300F/keypad.c for an example of how to use the keypad API functions. (The “RabbitFLEX_BL300F” folder was formerly named “RabbitFLEX_SBC40.”) Figure 4-10 Keypad Driver Circuit Schematic R3A Q1A Digital Interface Cell 47 W R1 I/O Pin 4.7 kW VERSION 6.
4.3.7 External Interrupt The external interrupt can be configured to use J1, pin 7 on the RabbitFLEX BL300F. The external interrupt is enabled using the Rabbit’s parallel port E, pin 0 (PE0), which is associated with interrupt vector 0, located at EIR:0x000. The following steps must be taken to prepare the external interrupt for use: 1. Write the interrupt vector to the external interrupt table. The interrupt vector is typically a call to an interrupt service routine (ISR).
The direct output has the advantage of being a push/pull driver. It has the same current capacity as a general output on the Rabbit: 6.8 mA, sinking or sourcing. A direct PWM output could be used as a control for a high impedence device. For applications that need more current than is supplied with a direct PWM output, select one of the sinking drivers or the sourcing driver option.
Table 4-8. Digital Input 1.4 V Threshold Characteristics Symbol Parameter Note Min Typical Max Unit 0 5 V 40 DC VIW Working Input Voltage VIM Maximum Input Voltage -40 VIH High Level Input Voltage 2.0 VIL Low Level Input Voltage VT Trigger Threshold Voltage 1 1.
4.3.10.2 Digital Input 2.8 V Threshold This section presents the circuit schematic and the characteristics for the 2.8 V threshold digital input. Figure 4-12 Digital Input 2.8 V Threshold Circuit I/O Pin R6 R5 22 kW 22 kW Digital Interface Cell C1 2.2 nF R7 22 kW VERSION 6.01 DIGITAL INPUT, 2.8 V threshold Table 4-9. Digital Input 2.
4.3.10.3 Digital Input 4.4 V Threshold This section presents the circuit schematic and the characteristics for the 4.4 V threshold digital input. Figure 4-13 Digital Input 4.4 V Threshold Circuit I/O Pin R6 Digital Interface Cell 22 kW R7 10 kW C1 10 nF VERSION 6.01 DIGITAL INPUT, 4.4 V threshold Table 4-10. Digital Input 4.
4.3.10.4 Contact Input This section presents the circuit schematic and the characteristics for the contact input. A contact input is designed to be connected to a switch. It has a longer time constant than the other digital inputs to quiet the noise generated by a switch closure. And it already has the pullup allowing simple wiring of the switch between the input and ground. Basically, it is a hardware switch debouncer, though it may be still be neccesary to use software to fully debounce the switch.
4.3.10.5 Bidirectional Logic This section presents the circuit schematic and the characteristics for the bidirectional logic. A birdirectional logic circuit is useful when talking to an offboard device that communicates using the same line for transmit and receive, such as an I2C device. Figure 4-15 Bidirectional Logic Circuit +5 V R4A 1 kW R5 I/O Pin Digital Interface Cell 10 kW C1 270 pF Q1A R1 1 kW Digital Interface Cell VERSION 6.01 BIDIRECTIONAL LOGIC Power On/Reset State: Input 40 www.rabbit.
Table 4-12. Bidirectional Logic Characteristics Symbol Parameter Note Min Typical Max Unit 0 5 V 13 DC INPUT VIW Working Input Voltage VIM Maximum Input Voltage -3 VIH High Level Input Voltage 2.0 VIL Low Level Input Voltage VT Trigger Threshold Voltage 1 1.4 V IIH High Level Input Current 2 -3 mA IIL Low Level Input Current 3 II Input Current 4 IQH IQL High Level Quiescent Current Low Level Quiescent Current 0.8 -4.2 3, 5, 6 OUTPUT 5 4.75 V mA -27.
4.3.11 Digital Outputs There are several digital output options on a RabbitFLEX BL300F.They are listed in Table 4-13. Note that not all options are available on all five connectors. Table 4-13. Digital Output Specifications Connector Availability Diode Protection Sinking Driver, 1 A 1-3 Yes Sinking Driver, 100 mA 1-5 No Sourcing Driver, +K V, 400 mA 1-3 No Sourcing Driver, 5 V, 50 mA (short circuit current limited) 1-3 Yes Line Driver, 100 Ohm, 5 V 1-5 RabbitFLEX BL300F Option 42 www.
4.3.11.1 Sinking Driver 1 A This section presents the circuit schematic and the characteristics for the 1 A sinking driver. See Section 5.4.3 for more information on protection diodes. Figure 4-16 Sinking Driver 1 A Circuit Schematic +K +5 V D1B (+K) Q2A R8AB Digital Interface Cell I/O Pin Q1B 220 W R11 D1B (GND) 220 W R10 4.7 kW VERSION 6.02 Sinking Driver, 1 A 40 V Power On/Reset State: Off, high impendance Table 4-14.
4.3.11.2 Sinking Driver 100 mA This section presents the circuit schematic and the characteristics for the 100 mA sinking driver. The 100 mA sinking driver does not have the protection diodes that are in the 1 A circuit. Figure 4-17 Sinking Driver 100 mA Circuit Schematic I/O Pin Q1A R1 Digital Interface Cell 1 kW VERSION 6.01 Sinking Driver, 100 mA 40 V Power On/Reset State: Off, high impendance Table 4-15.
4.3.11.3 Sourcing Driver 400 mA This section presents the circuit schematic and the characteristics for the 400 mA sourcing driver. Note that it has diode protection. This driver sources from the user-supplied +K pin and can handle up to 24 V. Figure 4-18 Sourcing Driver 400 mA Circuit Schematic +K +K Q1A D1B (+K) Q2A Digital Interface Cell R8AB I/O Pin 220 W D1B (GND) R10 470 W VERSION 6.01 Sourcing Driver, 400 mA 24 V Power On/Reset State: Off, high impendance Table 4-16.
4.3.11.4 Sourcing Driver 50 mA This section presents the circuit schematic and the characteristics for the 50 mA sourcing driver. Note that it has diode protection. This sourcing driver is short circuit current limited to about 65 mA, making it ideal for vending machine applications requiring a short circuit proof driver. Figure 4-19 Sourcing Driver 50 mA Circuit Schematic +5 V +5 V R14A 10 W +5 V Q2B Q1A Digital Interface Cell R8AD D1A (+5 V) 1 kW I/O Pin D1A (GND) VERSION 6.
4.3.11.5 Line Driver, 100 Ω, 5 V This section presents the circuit schematic and the characteristics for the line driver. Line drivers are available on J1 through J5, pins 1 through 8. Figure 4-20 Line Driver 100 Ω Circuit Schematic +5 V Q1B R2A 22 W R1 Digital Interface Cell 470 W R3B R6 47 W 47 W R5 100 W I/O Pin R7 220 W C1 47 W VERSION 6.01 Line Driver, 100 W 5 V Power On/Reset State: Off, 0 V Table 4-18. Line Driver Characteristics Symbol Parameter Note Min Typical Max Unit 4.
4.3.12 Digital-to-Analog Converters The RabbitFLEX BL300F can have up to two DAC channels. The analog output from channel #0 comes out on J2, pin 7or can be used to drive the optional speaker output (See Section 4.3.12.3). Analog output channel #1 comes out on J2, pin 8. There are two voltage output range options: • 0-3 V • 0-10 V There are two things to notice in the circuit schematics for the DAC channels (Figure 4-21 and Figure 422).
4.3.12.1 DAC 0-3 V This section presents the circuit schematic and the characteristics for the 0-3 V DAC. Figure 4-21 DAC 0-3 V Circuit Schematic +5 V C6 0.22 µF PWM Output R1 R2 R3 R4 R5 4.7 kW 10 kW 22 kW 47 kW 47 kW C1 10 nF C2 2.2 nF C3 2.2 nF C4 270 pF U1:A Analog Output + R10 2.2 kW C5 270 pF VERSION 5.04 DAC 03 V Table 4-19.
4.3.12.2 DAC 0-10 V This section presents the circuit schematic and the characteristics for the 0-10 V DAC. Figure 4-22 DAC 0-10 V Circuit Schematic +K C6 0.22 µF R7 R8 220 kW 470 kW PWM Output R1 4.7 kW R2 R3 R4 R5 10 kW 22 kW 47 kW 47 kW C1 10 nF C2 2.2 nF C3 2.2 nF C4 270 pF U1:A Analog Output + R10 2.2 kW C5 270 pF VERSION 5.03 DAC 0-10 V Table 4-20.
4.3.12.3 Speaker DAC channel #0 can be configured as an input to a speaker. A pulse width modulated (PWM) signal goes through a low-pass filter, changing the high speed digital signal from the Rabbit processor into a smoothly varying analog signal. This signal is not strong enough to drive the speaker, so it goes through a low voltage audio power amplifier before connecting to the speaker line. Figure 4-23 is a circuit schematic of the filter/amplifier. The output to the speaker is on J6.
4.3.13 Analog-to-Digital Converters The RabbitFLEX BL300F has a ramp-compare ADC. Up to 16 channels are available. The analog inputs can be on any combination of pins 1 through 8 on both J3 and J4. The design of the ADCs allow you to choose a current or voltage input on these pins. The measurement range options are: • 0-3 V • 0-10 V • 4-20 mA The ADCs work with single-ended unipolar voltage inputs and industry standard 4-20 mA current loops.
4.3.13.1 Analog Input 0-3 V This section presents the circuit schematic and the characteristics for the 0-3 V analog input. Figure 4-25 Analog Input 0-3 V Threshold Circuit I/O Pin R6 Analog Input Cell 100 kW C1 270 pF VERSION 6.02 Analog Input, 03 V Table 4-21. ADC 0-3 V Characteristics RabbitFLEX User’s Manual www.rabbit.
4.3.13.2 Analog Input 0-10 V This section presents the circuit schematic and the characteristics for the 0-10 V analog input. Figure 4-26 Analog Input 0-10 V Circuit Schematic I/O Pin R5 R6 100 kW Analog Input Cell 1 kW R7 22 kW C1 10 nF VERSION 6.04 Analog Input, 010 V Table 4-22. ADC 0-10 V Characteristics 54 www.rabbit.
4.3.13.3 Analog Input 4-20 mA This section presents the circuit schematic and the characteristics for the 4-20 mA analog input. This analog input provides a simple interface for industry standard 4-20 mA devices. It is a passive input and the device must either supply the loop current or be wired in series with a supply to operate correctly. The loop is formed by using the input pin as the SIG+ line and the ground pin as the SIG- or signal return.
4.3.14 Power Routing You can bring power supply pins out on any of the pin-configurable connectors (J1-J5). All five connectors accommodate 5 V pins, but only J1-J3 have 3.45 V. Keep in mind that no matter how many power supply pins are configured, there is a limit to their simultaneous use. The power budget for your application must stay within the parameters of the total power for the system. Table 4-24. 5 V Power Supply Characteristics Symbol Parameter Min Typical Max Unit 4.75 5.
5. MORE INFORMATION ON RABBITFLEX BL300F OPTIONS This chapter provides links, references and additional information about the RabbitFLEX BL300F options. All Rabbit documentation can be accessed online at rabbit.com or from the Dynamic C CD that came in the RabbitFLEX Tool Kit. 5.
5.2 Serial Communication Dynamic C provides drivers for RS-232 and RS-485. For a full discussion of these drivers, see the Technical Note, TN213: “Rabbit Serial Port Software.” 5.2.1 Comparison of RS-232 and RS-485 Both RS-232 and RS-485 are popular and well-established serial communication protocols that are used by many different devices. There are a number of considerations when choosing which serial protocols are right for a particular application.
5.4 Digital Outputs There are several types of options available for digital outputs. There are sinking and sourcing drivers, as well as line drivers. No matter which digital output type you have, the circuit is activated by a call to flexDigOut() or flexDigOutGroup16(). 5.4.1 Sinking and Sourcing Drivers One approach to boost the power of DC control signals is to use a sinking output.
Figure 5.2 Water Tower Analogy of Sinking and Sourcing Power Water Tower High Potential Sourcing Driver Load attached to driver Load attached to driver Sinking Driver Lake water at ground level 5.4.2 Line Drivers Line drivers are used to increase current, thereby enhancing transmission reliability. 5.4.3 Protection Diodes A protection diode gives a path for high voltages to follow when driving an inductive load.
5.5 DACs To produce an analog signal for the DAC channel outputs, the Rabbit generates precisely timed pulses using PWM (pulse width modulation). The digital signal, which is either 0 V or 5 V, is a train of pulses. This means that if the signal is taken to be usually at 0 V (or ground), there will be 5 V pulses. The voltage will be 0 V for a given time, then jump to 5 V for a given time, then back to ground for a given time, then back to 5 V, and so on. The digital signal is a value between 0 and 1024.
5.6 Speaker DAC Channel #0 can be configured as an input to a speaker. The audio hardware on the RabbitFLEX board has two sections, the filter and the amplifier. The first part, the filter, converts the high speed digital pulses that come from the Rabbit processor into a smoothly varying analog signal. It does this through low pass filtering. According to its name, low pass filtering allows low frequency signals to pass through it while blocking higher frequency signals.
The sampling precision is the number of gradations possible for each sample point. Each time a sample is taken, the sampling precision determines the digital value that is assigned. For example, if the precision is 10 the software can assign a sample one of 10 discrete numbers. By increasing the sampling precision, just like with the sampling rate, you can make the sample points more closely resemble the curved line of the analog signal.
64 www.rabbit.
6. APPLICATIONS PROGRAMMING Programming your customized RabbitFlex board has been made both adaptable and as simple as possible. The complexity of dealing with multiple hardware configurations has been hidden in the use of data structures in the Flex libraries. A number of sample programs are provided to illustrate the new data structures and supporting software as well as to use for templates for your own application development. In Section 6.
Table 6-1. RabbitFLEX BL300F Sample Programs Program Name Description digout_groups.c Demonstrates software grouping capability. Displays all digital outputs, then prompts for which inputs to group together. After the group is created, each successive digital output channel is set to “1” while the others are set to “0.” keypad.c You must have a keypad configured for your RabbitFLEX board to run this program. It will automatically configure the keys on your keypad to display to Stdio when pressed.
Table 6-1. RabbitFLEX BL300F Sample Programs Program Name Description speaker_audio.c You must have a loudspeaker configured for your RabbitFLEX board to run this program. It demonstrates the use of the RabbitFLEX audio driver. This program loads a .wav file and plays it on an attached loudspeaker. speaker_tone.c You must have a loudspeaker configured for your RabbitFLEX board to run this program. It demonstrates the use of the RabbitFLEX tone driver. It allows you to select a tone to play from a menu.
connector/pin assignments. The .xml file is more important. It is used when you want to reorder a particular design. A board design cannot be ordered without its .xml file. Although your design file may still be available through your RabbitFLEX account, it is your responsibility to maintain a copy of the design .xml file. 6.3 RabbitFLEX BL300F Software Concepts There are several concepts that must be understood to program the RabbitFLEX BL300F. This section will describe these concepts. 6.3.
If you would like to change your pin software names after you have designed your board, then it is possible to modify your design-specific generated library. You must search the library for all references to the name that you wish to change. Note, however, that if you do modify your design-specific library, you will be responsible for maintaining that library. The version in your RabbitFLEX account will no longer be synchronized with your modified version.
Some automatically generated pin groups are created in your design-specific library. These groups are listed below: Pin Group Pin Group Members _flex_pins_digin[] All digital inputs _flex_pins_digout[] All digital outputs _flex_pins_diginout[] All bidirectional pins _flex_pins_anain[] All analog inputs _flex_pins_anaout[] All analog outputs Some of these groups are used in sample programs to make them operate on any given RabbitFLEX BL300F design. 6.3.
Note that the keypad’s software name is always flex_keypad. Next, you should configure the keys on your keypad. This is what the flexKeyConfig() function does. When a key is pressed, the flexKeyGet() function will get a specific key code before returning which key was pressed. The keycode is calculated as follows: [output #] * [num outputs] + [input #] The flexKeyConfig() function takes the key code as a parameter to determine which key you are configuring.
// Number of rows on the display my_lcd.num_rows = 2; // Starting address of each row (up to 4 rows) my_lcd.row_addresses[0] = 0x80; my_lcd.row_addresses[1] = 0xc0; // Minimum duty cycle for contrast control my_lcd.pwm_contrast_min = 0; // Maximum duty cycle for contrast control my_lcd.pwm_contrast_max = 1024; // Default scaled value for contrast control (0-255) my_lcd.
6.4 Software Walk-Through In this section, we will begin with the speaker_tone.c sample program and modify it to demonstrate more RabbitFLEX functionality. Note that to make the modifications and run the sample program, you will need the speaker option, appropriate digital inputs and outputs, and the demo board that is included with the RabbitFLEX tool kit. However, even if you do not have these items, you should still be able to read along to gain more understanding of how to use the RabbitFLEX software.
// Activate the tone system flexToneActivate(); This function simply activiates the tone driver. Once enabled, it consumes about 10-20% of the system’s processor time while running. Therefore, in a real program, you might want to activate and shutdown (using flexToneShutdown()) the tone driver when needed. The next section of code simply builds the waveforms for the five different tones and then displays a menu of choices to the user. We will skip down to the next RabbitFLEX-related section of code.
Each of the changes that are shown below are made to the main() function of speaker_tone.c. Flex_IOPin *switch_pressed; Flex_IOPin *led; int switchnum; First of all, at the top of main(), we need to add a few variables. The variable *switch_pressed will point to the switch that has been pressed. The variable *led will point to the LED that we should light up. And the variable switchnum indicates the number of the switch (1-4) that was pressed. We will see how these will be used later in this walk-through.
The rest of this section will detail the main changes that have been made to this program. In fact, you should delete the entire main while loop in speaker_tone.c, since we will be replacing it. For convenience, here is the complete listing for the new while loop. while (1) { costate { switch_pressed = NULL; while (!switch_pressed) { // Check for a switch pressed.
while (1) { // Wait for the switch to be released waitfor(flexDigIn(switch_pressed) == 0); // Wait additional 200 ms waitfor(DelayMs(200)); // If the switch is still released, then break out of the while loop if (flexDigIn(switch_pressed) == 0) { // Turn the LED back off flexDigOut(led, 1); break; } // end if statement } // end while loop } // end if statement } // end costate } // end main while loop Now we will go through each part of the while loop step-by-step.
else if (flexDigIn(&flex_digin35)) { switch_pressed = &flex_digin35; led = &flex_digout36; switchnum = 3; } else if (flexDigIn(&flex_digin37)) { switch_pressed = &flex_digin37; led = &flex_digout38; switchnum = 4; } } // end while loop Similarly, we check each of the other three switches.
Since we have accepted the switch press and turned on the corresponding LED, then we might as well play the tone. We use the switchnum variable that we saved earlier to choose the tone to play.
static const Flex_IOPin *leds[] = { &flex_digout32, &flex_digout34, &flex_digout36, &flex_digout38, FLEX_GROUP_END }; To use I/O groups, we must first create the groups. The switches[] and leds[] arrays contain pointers to each of the Flex_IOPin structures for the switches and the LEDs, respectively. Note that these are arrays of Flex_IOPin pointers.
Next is the main while loop.
We will now go through each part of this new while loop in detail: while (1) { costate { // Check if a switch has been pressed do { flexDigInGroup16(switches, &switch_values); } while (switch_values == 0x00); Like before, we use a costatement to make implementing debouncing easier. Now notice the flexDigInGroup16() function call. Like flexDigOutGroup16(), this function takes an array of Flex_IOPin pointers. However, the second parameter is a pointer to an unsigned integer.
Note that as we iterate through the loop, we keep track of the switch, LED, and switch number that we are on. Incrementing the switch_pressed and led pointers will make them point to the next member in the respective group. // Wait 50 ms to make sure the switch stays pressed (debouncing) waitfor(DelayMs(50)); // Check if the switch is still pressed if (flexDigIn(*switch_pressed) == 1) { Now we begin switch debouncing. We wait 50 ms, and then check if the switch has been pressed again.
6.5 API Functions This section describes the programming interface for the RabbitFLEX BL300F. Table 6-6 lists the functions by category. Each function name is a link to the function’s full description. Table 6-6.
6.6.1 Board Initialization brdInit void brdInit(void); DESCRIPTION Call this function at the beginning of your application to initialize the controller's I/O ports. This function sets up all of the I/O available on your RabbitFLEX board, including Ethernet, digital I/O, and analog I/O. RETURN VALUE None. 6.6.2 Pin Names flexPinName char *flexPinName(Flex_IOPin *pin); DESCRIPTION Returns the character string that represents the name of the given I/O pin.
6.6.3 Digital Inputs flexDigIn int flexDigIn(Flex_IOPin *pin); DESCRIPTION Reads the state of a digital input channel. This function is non-reentrant. PARAMETER pin Pointer to the information structure for the selected I/O pin. RETURN VALUE 0: logic low 1: logic high <0: error (not a valid digital input?) SEE ALSO flexDigShadow, flexDigOut, flexDigInGroup16, flexDigOutGroup16 86 www.rabbit.
flexDigInGroup16 int flexDigInGroup16(Flex_IOPin *digin_pins[], unsigned int *result); DESCRIPTION This function reads the state of a set of digital input channels into the result parameter. The first parameter must be an array of pointers to Flex_IOPin structures. Essentially, this is an array of pins.The last entry in the array must be FLEX_GROUP_END. This indicates the end of the pins in the group. The second parameter must be a pointer to an unsigned int.
6.6.4 Digital Outputs flexDigOut int flexDigOut(Flex_IOPin *pin, int state); DESCRIPTION Sets the state of a digital output channel and is non-reentrant. Note that this function takes into account any inversion by the circuit on the given pin so that the called state is always reflected on the output pin. PARAMETERS pin Pointer to the information structure for the selected I/O pin.
flexDigShadow int flexDigShadow(Flex_IOPin *pin); DESCRIPTION Reads the shadow (last value) of the given digital output channel. PARAMETER pin Pointer to the information structure for the selected I/O pin. RETURN VALUE ≥0: value of the shadow 0xFF: no shadow value (digital channel not yet used) <0: error (not a valid digital input or output?) SEE ALSO flexDigIn, flexDigOut, flexDigInGroup16, flexDigOutGroup16 RabbitFLEX User’s Manual www.rabbit.
flexDigOutGroup16 int flexDigOutGroup16(Flex_IOPin *digout_pins[], unsigned int values); DESCRIPTION This function sets the state of a set of digital output channels based on the values parameter. The first parameter must be an array of pointers to Flex_IOPin structures. Essentially, this is an array of pins. The last entry in the array must be FLEX_GROUP_END. This indicates the end of the pins in the group. The second parameter must be an unsigned int.
6.6.5 Analog Inputs flexAnaInCalib int flexAnaInCalib(Flex_IOPin *pin, int value1, float volts1, int value2, float volts2); DESCRIPTION Calibrates the response of the selected A/D converter channel as a linear function using the two conversion points provided. Gain and offset constants are calculated and placed into a global table. This function is non-reentrant. PARAMETERS pin Pointer to the information structure for this I/O pin. value1 The first A/D converter value.
flexAnaIn int flexAnaIn( Flex_IOPin *pin ); DESCRIPTION Reads the state of the external analog channel. Note that this is a raw value that has not been converted to a voltage. The raw values are useful for calibration. Also note that the value retrieved here is not read when requested; rather, the latest value that has been calculated by the analog input interrupt service request is returned. The update rate is 2.5 ms times the number of analog input channels. This function is non-reentrant.
flexAnaInVolts float flexAnaInVolts(Flex_IOPin *pin); DESCRIPTION Reads the state of the external analog input channel and uses the previously set calibration constants to convert it to volts. This function is non-reentrant. Also note that the value retrieved here is not read when requested; rather, the latest value that has been calculated by the analog input interrupt service request is returned. The update rate is 2.5 ms times the number of analog input channels.
flexAnaInmAmps float flexAnaInmAmps(Flex_IOPin *pin); DESCRIPTION Reads the state of the external analog input channel and uses the previously set calibration constants to convert it to milliamps. This function is non-reentrant. Also note that the value retrieved here is not read when requested; rather, the latest value that has been calculated by the analog input interrupt service request is returned. The update rate is 2.5 ms times the number of analog input channels.
flexAnaInAverageSetting int flexAnaInAverageSetting(Flex_IOPin *pin, float alpha); DESCRIPTION Sets the averaging alpha value (weight value) for a given ADC channel to read averaged ADC data. To read the average ADC data use the following functions: • flexAnaInAverage() - read averaged raw data • flexAnaInVoltsAverage() - read averaged voltage • flexAnaInmAmpsAverage() - read averaged current If you set the alpha value to 1 for a given A/D channel, then you will get the actual unaltered raw data value.
flexAnaInAverage int flexAnaInAverage(Flex_IOPin *pin); DESCRIPTION This function is like flexAnaIn(), except that it reports the most recent discount averaged value instead of the raw value. To set the discount average alpha value, execute the flexAnaInAverageSetting() function before calling this function. This function is non-reentrant. PARAMETER pin Pointer to the information structure for the selected analog input pin.
flexAnaInVoltsAverage float flexAnaInVoltsAverage(Flex_IOPin *pin); DESCRIPTION This function is like flexAnaInVolts(), except that it reports the most recent discount averaged voltage value instead of the raw voltage value. To set the discount average alpha value, execute flexAnaInAverageSetting() before calling this function. This function is non-reentrant. PARAMETER pin Pointer to the information structure for the selected analog input pin.
flexAnaInmAmpsAverage float flexAnaInmAmpsAverage(Flex_IOPin *pin); DESCRIPTION This function is like flexAnaInmAmps(), except that it reports the most recent discount averaged current reading instead of the raw current reading. To set the discount average alpha value, execute flexAnaInAverageSetting() before calling this function. This function is non-reentrant. PARAMETER pin Pointer to the information structure for the selected analog input pin.
flexAnaInNewValue int flexAnaInNewValue(Flex_IOPin *pin, int clear); DESCRIPTION Reports whether an updated value is available for the given analog input pin. If the clear parameter is 1, then a call to this function will clear the result that a new value is available, i.e., assuming that another new value has been processed and made available, the flexAnaInNewValue() function will indicate that a new value is not available the next time it is called.
6.6.6 Analog Outputs flexAnaOutCalib int flexAnaOutCalib(Flex_IOPin *pin, int value1, float volts1, int value2, float volts2); DESCRIPTION Calibrates the response of the selected D/A converter channel as a linear function using the two conversion points provided. Gain and offset constants are calculated and placed into a global table. This function is non-reentrant. PARAMETERS pin Pointer to the information structure for this I/O pin. value1 The first D/A converter value (0–1024).
flexAnaOut int flexAnaOut(Flex_IOPin *pin, int rawvalue); DESCRIPTION Sets the voltage on a given analog output pin and a raw value. This function is particularly useful for calibration. This function is non-reentrant. PARAMETERS pin Pointer to the information structure for the selected analog output pin.
flexAnaOutVolts int flexAnaOutVolts(Flex_IOPin *pin, float voltage); DESCRIPTION Sets the voltage on a given analog output pin by using the previously set calibration constants to calculate the correct data values. This function is non-reentrant. PARAMETERS pin Pointer to the information structure for the selected analog output pin. voltage Voltage desired on the output pin. RETURN VALUE 0: success -1: error (not an analog output?) SEE ALSO flexAnaOut, flexAnaOutCalib 102 www.rabbit.
6.6.7 LCD flexDispInit int flexDispInit(Flex_LCD *lcd, Flex_LCDConf *user_conf); DESCRIPTION Initializes the given LCD, optionally using the given user configuration structure. This function defaults the cursor to off, the backlight to off, and the contrast control to the display's default value. PARAMETERS lcd Pointer to an LCD data structure.
flexDispCursor void flexDispCursor(Flex_LCD *lcd, unsigned int style); DESCRIPTION Sets the cursor type to be on, off, or blink. PARAMETERS lcd Pointer to an LCD data structure. style One of the following cursor macros: DISP_CUROFF: cursor off DISP_CURON: cursor on DISP_CURBLINK: cursor blink RETURN VALUE None. SEE ALSO flexDispInit, flexDispGoto, flexDispClear, flexDispPutc, flexDispPrintf, flexDispOnoff, flexDispBacklight, flexDispContrast 104 www.rabbit.
flexDispGoto int flexDispGoto(Flex_LCD *lcd, unsigned int col, unsigned int row); DESCRIPTION Places the cursor at the given column and row. PARAMETERS lcd Pointer to an LCD data structure. col Column position from top left corner. row Row position from top left corner.
flexDispGetPosition int flexDispGetPosition(Flex_LCD *lcd, unsigned int *col, unsigned int *row); DESCRIPTION Gets the current cursor position based on the column and row parameters. PARAMETERS lcd Pointer to an LCD data structure. col Pointer to an unsigned int (used to store column position). row Pointer to an unsigned int (used to store row position). RETURN VALUE None. SEE ALSO flexDispGetDimensions, flexDispGetContrast 106 www.rabbit.
flexDispGetDimensions void flexDispGetDimensions(Flex_LCD *lcd, unsigned int *num_cols, unsigned int *num_rows); DESCRIPTION Gets the number of columns and rows for the given display. PARAMETERS lcd Pointer to an LCD data structure. col Pointer to an unsigned int (used to store number of columns). row Pointer to an unsigned int (used to store number of rows). RETURN VALUE None. SEE ALSO flexDispGetPosition, flexDispGetContrast RabbitFLEX User’s Manual www.rabbit.
flexDispClear void flexDispClear(Flex_LCD *lcd); DESCRIPTION Clears the display and returns the cursor to the home position. PARAMETER lcd Pointer to an LCD data structure. RETURN VALUE None. SEE ALSO flexDispInit, flexDispCursor, flexDispGoto, flexDispPutc, flexDispPrintf, flexDispOnoff, flexDispBacklight, flexDispContrast 108 www.rabbit.
flexDispPutc void flexDispPutc(Flex_LCD *lcd, char ch); DESCRIPTION Puts the given character on the display at the current cursor position. PARAMETERS lcd Pointer to an LCD data structure. ch The character to write to the display. RETURN VALUE None. SEE ALSO flexDispInit, flexDispCursor, flexDispGoto, flexDispClear, flexDispPrintf, flexDispOnoff, flexDispBacklight, flexDispContrast RabbitFLEX User’s Manual www.rabbit.
flexDispPrintf int flexDispPrintf(Flex_LCD *lcd, char *format, ...); DESCRIPTION Prints the formatted string to the display starting at the current cursor position. The format specifier and additional parameters are specified just like in printf(). PARAMETERS lcd Pointer to an LCD data structure. format printf()-style format specifier string. RETURN VALUE The number of characters displayed.
flexDispOnoff void flexDispOnoff(Flex_LCD *lcd, int onOff); DESCRIPTION Turns the display on or off. PARAMETERS lcd Pointer to an LCD data structure. onOff 1 = turn the display on, 0 = turn the display off. RETURN VALUE None. SEE ALSO flexDispInit, flexDispCursor, flexDispGoto, flexDispClear, flexDispPutc, flexDispPrintf, flexDispBacklight, flexDispContrast RabbitFLEX User’s Manual www.rabbit.
flexDispBacklight int flexDispBacklight(Flex_LCD *lcd, int onOff); DESCRIPTION Turns the display's backlight on or off. PARAMETERS lcd Pointer to an LCD data structure. onOff 1 = turn the backlight on, 0 = turn the backlight off. RETURN VALUE 0: success -1: error (no backlight control on this display) SEE ALSO flexDispInit, flexDispCursor, flexDispGoto, flexDispClear, flexDispPutc, flexDispPrintf, flexDispOnoff, flexDispContrast 112 www.rabbit.
flexDispContrast int flexDispContrast(Flex_LCD *lcd, char vcontrast); DESCRIPTION Sets the contrast for the display. The vcontrast value range is from 0–255, and is scaled to a contrast-control voltage. PARAMETERS lcd Pointer to an LCD data structure. vcontrast Contrast setting (0–255) that is scaled to produce a contrast-control voltage (lower values produce higher contrast).
flexDispGetContrast char flexDispGetContrast(FLEX_LCD *lcd); DESCRIPTION Returns the current contrast setting (0–255). PARAMETER lcd Pointer to an LCD data structure. RETURN VALUE The current contrast setting (0–255). SEE ALSO flexDispContrast, flexDispGetDimensions, flexDispGetPosition 114 www.rabbit.
6.6.8 Keypad flexKeyProcess void flexKeyProcess(Flex_Keypad *keypad); DESCRIPTION For the given keypad, this function scans and processes keypad data for keypresses. It also handles debouncing, releases, and repeats. PARAMETER keypad Pointer to the keypad to process. RETURN VALUE None. SEE ALSO flexKeyInit, flexKeyConfig, flexKeyGet, flexKeyUnget flexKeyInit void flexKeyInit(Flex_Keypad *keypad); DESCRIPTION Initializes the given keypad.
flexKeyConfig void flexKeyConfig(Flex_Keypad *keypad, char cRaw, char cPress, char cRelease, char cCntHold, char cSpdLo, char cCntLo, char cSpdHi); DESCRIPTION Assigns each key with key press and release codes, hold and repeat ticks for auto repeat, and debouncing for a specific keypad. PARAMETERS keypad Pointer to the keypad to configure. cRaw Raw Key Code Index Each key has a raw key code. The raw key codes start from 0 and count up.
flexKeyUnget int flexKeyUnget(Flex_Keypad *keypad, char cKey); DESCRIPTION Pushes the key press (cKey) on the specified keypad back onto the top of the input queue. PARAMETERS keypad Pointer to the keypad to use. cKey Key code to put back onto the top of the queue. RETURN VALUE >0: key code successfully put back onto the queue 0: failure (keypad queue full?) SEE ALSO flexKeyInit, flexKeyConfig, flexKeyProcess, flexKeyGet RabbitFLEX User’s Manual www.rabbit.
flexKeyGet char flexKeyGet(Flex_Keypad *keypad); DESCRIPTION Gets the next key press for the selected kepad from the keypad input queue. PARAMETER keypad Pointer to the keypad to use. RETURN VALUE >0: next key press 0: no key presses available SEE ALSO flexKeyInit, flexKeyConfig, flexKeyProcess, flexKeyUnget 118 www.rabbit.
6.6.9 Speaker flexSpeakerPWM int flexSpeakerPWM(Flex_IOPin *pin); DESCRIPTION Selects the PWM channel to be used for the audio and tone speaker drivers. PARAMETER Pointer to the PWM pin to use for the speaker. pin RETURN VALUE 0: success -1: error (not a PWM pin?) SEE ALSO flexToneActivate, flexAudioActivate flexToneActivate unsigned int flexToneActivate(); DESCRIPTION Enables the tone driver so that samples can be loaded and played.
flexToneLoad int flexToneLoad(char *buffer, int bufsize, char repeat); DESCRIPTION Loads tone samples to be played into the tone driver buffer. This sample will be played repeatedly for the specified number of repeats. If the number of repeats is negative, the clip will be repeated indefinitely until flexToneStop() is called. PARAMETERS buffer Pointer to an array of bytes to be loaded. bufsize Number of bytes in the buffer. repeat Number of times the buffer contents will be repeated.
flexToneShutdown void flexToneShutdown(); DESCRIPTION Turns off the tone driver. Useful to preserve processor resources. RETURN VALUE None. SEE ALSO flexSpeakerPWM, flexToneActivate, flexToneLoad, flexToneStop flexAudioActivate unsigned int flexAudioActivate(); DESCRIPTION Enables the audio driver so that samples can be loaded and played. The audio driver consumes 10–20 of the processor's time while it is running. Use flexAudioShutdown() to disable the audio driver while not in use.
flexAudioPlay void flexAudioPlay(); DESCRIPTION Plays samples that have been loaded into the driver buffer, see flexAudioLoad(). The driver will continue to play samples until its buffer is empty. RETURN VALUE None. SEE ALSO flexSpeakerPWM, flexAudioActivate, flexAudioShutdown, flexAudioStop, flexAudioPlaying, flexAudioSetRate, flexAudioLoad flexAudioPlaying int flexAudioPlaying(); DESCRIPTION Determines whether the audio driver is currently playing samples.
flexAudioSetRate void flexAudioSetRate(unsigned int sample_rate); DESCRIPTION Tells the driver to treat the incoming data as audio sampled at this given rate. This tells the driver how fast the data should be played through. PARAMETER sample_rate Sampling rate of the input data (1–65,535 Hz). RETURN VALUE None. SEE ALSO flexSpeakerPWM, flexAudioActivate, flexAudioShutdown, flexAudioStop, flexAudioPlaying, flexAudioPlay, flexAudioLoad RabbitFLEX User’s Manual www.rabbit.
flexAudioLoad int flexAudioLoad(char *buffer, int bufsize); DESCRIPTION Loads audio samples to be played into the audio driver buffer. These samples will not actually play unless flexAudioPlay() is called. You only need to call flexAudioPlay() once when starting. Data in subsequent calls will also be played as long as the audio buffer does not become empty. PARAMETER buffer Pointer to an array of bytes to be loaded. bufsize Number of bytes in the buffer.
flexAudioShutdown void flexAudioShutdown(); DESCRIPTION Turns off the audio driver. Useful to preserve processor resources. RETURN VALUE None. SEE ALSO flexSpeakerPWM, flexAudioActivate, flexAudioPlay, flexAudioStop, flexAudioPlaying, flexAudioSetRate, flexAudioLoad flexAudioStop void flexAudioStop(); DESCRIPTION Immediately stops any sound that is playing and empties the sample buffer. Any samples loaded after calling flexAudioStop() will not play until flexAudioPlay() is called. RETURN VALUE None.
6.6.10 Serial Communication serMode int serMode(int mode); DESCRIPTION Sets up user interface for the serial communication lines. This function must be called after executing serXOpen(). Whether you are opening one or multiple serial ports, this function must be executed after executing the last serXOpen() AND before you start using any of the serial ports. This function is non-reentrant. PARAMETER Defined serial port configuration if devices are installed mode Table 6-7.
ser485Tx void ser485Tx(void); DESCRIPTION Enables the RS-485 transmitter. The brdInit() function must be executed before running this function. This function is non-reentrant. After the byte or block of data has been transmitted, the RS-485 transmitter must be idle and its transmit buffer empty before an application can disable the transmitter and thus receive data from the RS-485 interface. There are two methods for identifying when to disable the transmitter. 1.
ser485Rx void ser485Rx(void); DESCRIPTION Disables the RS-485 transmitter. This puts you in a listen mode, which allows you to receive data from the RS-485 interface. The brdInit() function must be executed before running this function. This function is non-reentrant. RETURN VALUE None SEE ALSO brdInit, ser485Tx 128 www.rabbit.
APPENDIX A. RABBITFLEX BL300F SPECIFICATIONS This appendix provides the board specifications for the RabbitFLEX BL300F. A.1 Electrical and Mechanical Characteristics Figure A.1 shows the mechanical dimensions for the RabbitFLEX BL300F. Figure A.1 RabbitFLEX BL300F Dimensions (4.5) 0.175 f = 0.187 ×6 (4.8) © 2005 RABBIT SEMICONDUCTOR, DAVIS, CA R56 R61 R51 R50 R58 R57 R60 R59 R74 R72 R71 R73 R70 TP15 TP13 R102 R202 CCNMA102 R19 R18 R21 R20 (16) 0.
Rabbit recommends an exclusion zone of 0.25" (6 mm) around the RabbitFLEX BL300F board in all directions when the RabbitFLEX BL300F board is incorporated into an assembly that includes other components. Figure A.2 shows this exclusion zone. (6) 0.25 Figure A.2 RabbitFLEX BL300F Exclusion Zone (6) 0.25 (31) 1.22 Exclusion Zone 3.725 0.25 (95) 0.25 (6) (6) 0.25 (31) 1.22 (6) 0.25 (6) 0.25 (6) 6.00 (152) 0.
Table A-1 lists the electrical, mechanical, and environmental specifications for the RabbitFLEX BL300F. Table A-1. RabbitFLEX BL300F Specifications Parameter With PowerCore 3800 With PowerCore 3810 Microprocessor Rabbit 3000® at 51.6 MHz Rabbit 3000® at 25.
Table A-1. RabbitFLEX BL300F Specifications (Continued) Parameter With PowerCore 3800 With PowerCore 3810 Unregulated 8-43 V DC (draws 13.3 W) Unregulated 8-40 V DC (draws 6.7 W) Input Power Options DC AC 24–60 V AC with center-tapped transformer (draws 13.3 W) 19–57 V AC with center-tapped transformer (draws 6.7 W) 12-36 V AC with untapped standard transformer (draws 13.3 W) 10-29 V AC with untapped standard transformer (draws 6.
APPENDIX B. POWER SUPPLY This appendix provides information for the power supplies on the PowerCore modules used on the RabbitFLEX BL300F board. Information on the reset generator used in power management is also included. B.1 Power Supplies The PowerCore module has a 6-pin locking connector on the top side at J3 designed to accept a wire harness that brings in power. The J3 label on the PowerCore module is difficult to see, but luckily the 6-pin locking connector is easy to find.
B.2 Battery-Backup Circuits The data SRAM and the real-time clock on the PowerCore module have battery backup. Power to the SRAM and the real-time clock (VRAM) is provided by two different sources, depending on whether the PowerCore module is powered or not. When the PowerCore module is powered normally, and the +5 V supply is within operating limits, the SRAM and the real-time clock are powered from the +5 V supply. If power to the board is lost or falls below 4.
B.4 Power On / Reset State The table below shows the circuits that are affected by power on or reset. Table B-1. Circuit Power On / Reset State Bidirectional Logic Lines Input Keypad Outputs Off, High Impedance Sinking Drivers, 1 A 40 V Off, High Impedance Sinking Drivers, 100 mA 40 V Off, High Impedance Sourcing Drivers, 400 mA 40 V Off, High Impedance Sourcing Drivers, 50 mA 5 V On, 5 V Line Drivers, 100 Ω 5 V Off, 0 V RabbitFLEX User’s Manual www.rabbit.
136 www.rabbit.
APPENDIX C. DEMONSTRATION BOARD The demonstration board allows you to exercise the digital I/O on a RabbitFLEX board. The demonstration board, shown in Figure C.1, has four connections for digital inputs that create logic highs while the corresponding pushbutton switches on the demonstration board are pressed. There are four connections for sinking digital outputs that light up corresponding LEDs while a digital output on the RabbitFLEX board is activated. Figure C.
C.1.2 Digital Input Connections To run the digital input sample programs, you must connect at least one demo board switch to a digital input on the RabbitFLEX board. There are four demo board switches, so you may connect up to four digital inputs. The 4.4 V threshold digital inputs may or may not work reliably since the switching threshold it so close to 5 V. The bidirectional logic must be in an input state, which is one of the things that is done during the board initialization function (brdInit()).
C.1.3 Digital Output Connections To run the digital output sample programs, you must connect at least one demo board LED to a 100 mA sinking driver on the RabbitFLEX board. There are four demo board LEDs, so you may connect up to four 100 mA sinking drivers. Connect the green wire of the cable assembly that corresponds to the selected digital output to LED1, LED2, LED3 or LED4 on screw terminal header J1 on the demo board.
C.1.4 Run Sample Programs Make sure the programming cable and transformer are connected as described in Chapter 2, “Getting Started.” Now you can run your application or a sample program. To exercise digital inputs, you can run either digin_simple.c or digin_groups.c. To exercise the digital outputs, you can run either digout_simple.c or digout_groups.c. 140 www.rabbit.
APPENDIX D. RABBITFLEX KEYPAD/DISPLAY KIT Rabbit offers a RabbitFLEX Keypad/Display Kit for the RabbitFLEX board that provides the hardware components required to run the sample programs and to demonstrate the functionality of your keypad/display design. Table D-1 lists the items in the RabbitFLEX Keypad/Display Kit along with their part numbers. Table D-1. RabbitFLEX Keypad/Display Kit Parts Description Quantity Supplier Part Number 4 × 20 Character Display 1 Rabbit 535-0026 5 Ω, 0.
Figure D.
D.3 2 × 6 Keypad Datasheet 10 9 8 7 6 5 4 3 2 1 FLEX CABLE CONTACTS 0.4 × 0.4 pocket window, 12 places 0.62 R typ. 3.725 0.550 1.495 0.525 typ. 0.525 typ. 0.485 0.200 1.500 0.250 0.31 R, 2 places exposed contact area, near side RabbitFLEX User’s Manual www.rabbit.
D.4 LCD Module The LCD supplied with the RabbitFLEX Keypad/Display Kit does not have any connectors attached. Use two cable assemblies from the RabbitFLEX BL300F Tool Kit to connect the LCD display to connectors J1 and J2 on the RabbitFLEX board as shown below in Figure D.2. Remember to add the 5 Ω, 0.5 W currentlimiting resistor. Figure D.
D.5 4 × 20 Character LCD Datasheet RabbitFLEX User’s Manual www.rabbit.
146 www.rabbit.
RabbitFLEX User’s Manual www.rabbit.
148 www.rabbit.
Electrical Characteristics Item Symbol Condition Min Typ Max Input Voltage (high) Vih H Level 2.2 V — Vdd Input Voltage (low) Vil L Level 0V — 0.6 V 0°C — 4.8 V 5.4 V 25°C 4.2 V 4.6 V — 50°C 3.9 V 4.3 V — -20°C — 6.4 V 7.2 V 0°C — 4.8 V — 50°C — 4.3 V — 70°C 3.7 V 4.2 V — Recommended LCD Driving Voltage (Standard Temp.) Recommended LCD Driving Voltage (Wide Temp.) Vdd - Vo Vdd - Vo Power Supply Current Idd Vdd = 5.0 V ν = 270 kHz — 0.5 mA 1.
150 www.rabbit.
SCHEMATICS This page consists of links to the schematics of interest to an engineer using the RabbitFLEX BL300F. 090-0219 RabbitFLEX BL300F General Schematic www.rabbit.com/documentation/schemat/090-0219.pdf 090-0193 PowerCore 3800 Module Schematic www.rabbit.com/documentation/schemat/090-0193.pdf 090-0193 PowerCore 3810 Module Schematic www.rabbit.com/documentation/schemat/090-0193.pdf 090-0042 Demonstration Board Schematic www.rabbit.com/documentation/schemat/090-0042.
152 www.rabbit.
Index A ADCs ...................................................................... 52 amplifier ............................................................ 51, 62 analog input flexAnaIn() .......................................................... 92 flexAnaInAverage() ............................................ 96 flexAnaInAverageSetting() ................................. 95 flexAnaInCalib() ................................................. 91 flexAnaInmAmps() ...........................................
flexKeyGet() ......................................................118 flexKeyInit() ......................................................115 flexKeyProcess() ...............................................115 flexKeyUnget() ..................................................117 keypad connections ...............................................142 keypad datasheet ...................................................143 L LCD .........................................................................
U USB .................................................................... 8, 13 User block ............................................................... 18 W WAV files ............................................................... 51 website ...................................................................... 2 RabbitFLEX User’s Manual www.rabbit.
156 www.rabbit.
Mouser Electronics Authorized Distributor Click to View Pricing, Inventory, Delivery & Lifecycle Information: Rabbit Semiconductor: 20-151-0178 151-0153