20-151-0178 Rabbit Semiconductor, 20-151-0178 Datasheet

CABLE CONVERTER RS-232 TO USB

20-151-0178

Manufacturer Part Number
20-151-0178
Description
CABLE CONVERTER RS-232 TO USB
Manufacturer
Rabbit Semiconductor
Datasheet

Specifications of 20-151-0178

Accessory Type
USB to RS232 Adapter
Product
Microcontroller Accessories
For Use With/related Products
Rabbit-based Boards
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Other names
20-151-0178
316-1181
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.

Related parts for 20-151-0178

20-151-0178 Summary of contents

Page 1

... 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. ...

Page 2

... RabbitFLEX BL300F User’s Manual Part Number 019-0155 • 070720–D • Printed in U.S.A. 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 ...

Page 3

... User Block ......................................................................................................................................... 18 3.2 Cells and Circuits.............................................................................................................................................. 18 3.2.1 Cell Definition ........................................................................................................................................... 18 3.2.2 Cell Descriptions ....................................................................................................................................... 18 3.2.2.1 One-Transistor Cells ......................................................................................................................... 19 3.2.2.2 Two-Transistor Cells ......................................................................................................................... 19 3.2.3 Board Map ................................................................................................................................................. 20 Chapter 4: RabbitFLEX BL300F Options 4.1 Overview of Options......................................................................................................................................... 23 4.2 Overview of Connector and Cell Association .................................................................................................. 24 RabbitFLEX User’s Manual Table of Contents www ...

Page 4

... DAC 0-10 V .....................................................................................................................................50 4.3.12.3 Speaker ............................................................................................................................................51 4.3.13 Analog-to-Digital Converters ..................................................................................................................52 4.3.13.1 Analog Input 0-3 V ..........................................................................................................................53 4.3.13.2 Analog Input 0-10 V ........................................................................................................................54 4.3.13.3 Analog Input 4-20 mA .....................................................................................................................55 4.3.14 Power Routing .........................................................................................................................................56 Chapter 5: More Information on RabbitFLEX BL300F Options 5.1 PowerCore Module Options.............................................................................................................................. 57 5.1.1 Ethernet ......................................................................................................................................................57 5.1.2 Serial Flash ................................................................................................................................................57 5 ...

Page 5

... B.3 Reset Generator .............................................................................................................................................. 134 B.4 Power On / Reset State................................................................................................................................... 135 Appendix C. Demonstration Board C.1 Demonstration Board Connections ................................................................................................................ 137 Appendix D. RabbitFLEX Keypad/Display Kit D.1 Keypad ........................................................................................................................................................... 141 D.4 LCD Module .................................................................................................................................................. 144 Schematics Index RabbitFLEX User’s Manual www.rabbit.com 129 133 137 141 151 153 iii ...

Page 6

Table of Contents ...

Page 7

... 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. Now, you can design your own perfect-fit controller board using Rabbit’s new online design and order sys- tem, the RabbitFLEX Configurator. Because the controller board is customized during surface mount assembly, a custom solution can be obtained more quickly and at a lower price than previously possible ...

Page 8

... From the above location you can order a customized board, check previous orders, or peruse the site for ideas and tips for your design. All information entered at the website is secure and confidential—nobody but you or those whom you authorize will be able to see the board designs you have saved or ordered. You will be asked to log in to your account with a user name and password when you save, order or reload a board design ...

Page 9

... V AC, 800 mA center-tapped transformer. A transformer compatible with power outlets in con- tinental Europe is included with kits sold overseas. • CD, containing Dynamic C 9.41 (or later) with complete product documentation, including this manual: the RabbitFLEX BL300F User’s Manual. • Demonstration board with pushbutton switches and LEDs. • ...

Page 10

... CE requirements. 1.4.3.1 General Design Requirements • The power supply provided with the Tool Kit is for development purposes only the customer’s responsibility to provide a CE-compliant power supply for the end-product application. • The LCD/keypad module was tested with the RabbitFlex, but no ESD testing was done the customer’ ...

Page 11

... Contains the electrical, mechanical and environmental specifications of the RabbitFLEX BL300F. Appendix B - Contains information on power and ground. Appendix C - Contains information on the demonstration board that comes with the RabbitFLEX BL300F Tool Kit. Appendix D - Contains information on the RabbitFLEX Keypad/Display Kit RabbitFLEX User’s Manual www.rabbit.com 5 ...

Page 12

RabbitFLEX BL300F Introduction ...

Page 13

... This section physically prepares the RabbitFLEX board for use in developing and debugging applications way to place the board in a more convenient position for development, the first thing screw on the hex standoffs that came in the RabbitFLEX as shown in Figure 2.1 Connecting Standoffs to the RabbitFLEX BL300F RabbitFLEX User’s Manual ETTING Figure 2 ...

Page 14

... PCs now come equipped with a USB port and no COM port. In this case, you can connect the program- ming cable’s DB9 connector to a RS-232/USB converter (Rabbit Part No. 540-0070), and then plug the other end of the converter into the USB port of the host PC. ...

Page 15

... XXXX is the Dynamic C version number. Dynamic C uses the serial port on the host PC that you specified during installation. If you are using a USB port, you must select “Use USB to Serial Converter” from the Communications tab of the Options | Project Options menu before downloading a program to the RabbitFLEX BL300F. ...

Page 16

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 short- ...

Page 17

... Before proceeding you will need to have two straight through Ethernet cables and a hub crossover Ethernet cable. The Ethernet cables and a 10Base-T Ethernet hub are available from Rabbit in the TCP/IP 10Base-T Accessory Kit. More information is available at: RabbitFLEX User’s Manual Figure 2.4. ...

Page 18

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 ...

Page 19

... Figure 2.6 shows the points to probe with a multimeter. They are located in the lower right- hand side of the module and are labeled “A” through “F.” and the voltages you should expect to see. RabbitFLEX User’s Manual Figure 2.5 Output from ping.c Table 2-6 www ...

Page 20

... COM port Dynamic C will use, choose Options > Project Options and click the Communications tab. Select another COM port from the Serial Port pull-down menu. If you see the message “Timeout while waiting for response from target” Check the programming and power cable connections. • ...

Page 21

... 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 the Communications tab of Project Options. If that does not work, slow the baud rate to 57,600 and try the compilation again. ...

Page 22

Getting Started ...

Page 23

... This section describes the RabbitFLEX BL300F base board and provides a high-level diagram of the sub- system options. 3.1.1 Base Board Layout The base board for a RabbitFLEX BL300F is pictured in Figure 3.1 Base Board for RabbitFLEX BL300F RabbitFLEX User’s Manual I ESIGN MPLEMENTATION AND Figure 3 ...

Page 24

... For example if you look at the circuit diagram for the 1.4 V trigger threshold digital input, you will see that the 100 ohm resistor is labeled “R6.” Looking at the one-transistor cell layout, “R6” is located in the lower-right corner of the cell. The physical placement of “R6” is different when a two-transistor cell is used to implement the 1 ...

Page 25

... A two-transistor cell is required for all sourcing outputs and the 1 A sinking output. The two-transistor cells on connector J3 can also be used as analog inputs. You can use any circuit that can be placed in a one- transistor cell, but not vice-versa. RabbitFLEX User’s Manual Figure 3.2 One-Transistor Cell Figure 3.3 Two-Transistor Cell www ...

Page 26

... Board Map The board map shown in Figure 3.4 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.4 Map of Cells Supporting I/O Pins on Connectors J1–J5 Digital I/O is routed to a digital interface cell, which is routed to the core module. Analog inputs are routed to an analog input interface cell, which is also routed to the core module ...

Page 27

... Figure 3.5 shows the locations of the digital and analog interface cells corresponding to connectors J1–J5. Figure 3.5 Map of Digital and Analog Input Interface Cells RabbitFLEX User’s Manual www.rabbit.com 21 ...

Page 28

Design Implementation and Information ...

Page 29

... Connector options affect one pin on a connector, like digital or analog I/O. 4.1 Overview of Options This section gives a visual overview of all available options and the connector/pins used. Figure 4-1 RabbitFLEX BL300F Block Diagram RabbitFLEX User’s Manual FLEX BL300F O ABBIT www.rabbit.com PTIONS ...

Page 30

... For obvious reasons, a board-specific pinout diagram is impossible to include in a generally applicable user’s manual such as this one. The following diagrams give the pinouts of the user-configurable connec- tors and the options available for each of the pins. To review the option/pin combinations that exist on your particular board, look in the generated library FAxxxxxxx ...

Page 31

... If the LCD option is selected, it will populate the 8 available pins of J1. 4.2.1.2 Connector 2 The two DAC channels and the PWM outputs are available on J2. The 0-10 V option requires an external +12 V power supply connected J2. RabbitFLEX User’s Manual Figure 4-3 Pinout Options for J1 Figure 4-4 Pinout Options for J2 www.rabbit.com ...

Page 32

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 one- transistor cells and J3 is made up of two-transistor cells. This difference means ...

Page 33

... There are a number of companies that offer custom harness assemblies that could be mated with these connectors. Molex has a list of recommended cable assembly manufacturers on their website: www.molex.com/product/harness/stars.html Rabbit recommends both Blaylock's, Inc. and Mann Organization for custom cable assembly. www.blaylocksinc.com/ www.mannorganization.com/index.html RabbitFLEX User’s Manual Figure 4-7 Pinout Options for J6 www.rabbit.com 27 ...

Page 34

... 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. PowerCore Module Differences ...

Page 35

... V. The RS-232 transceiver also provides the proper line loading for reliable communication. The following table lists the different capabilities of the serial ports D and E. More information on these serial ports can be found in the Rabbit 3000 Microprocessor User’s Manual. Serial Port D Asynchronous mode up to the baud ...

Page 36

... Disabled For more information on termination see The RS-485 lines come out on connector J6 (see (485-). The RS-485 protocol is a packet driver implemented by the library packet.lib, which can be found in the folder named “lib” where you installed Dynamic C. 30 Figure 4-8. Jumpered Pins ...

Page 37

... Hitachi HD44780 chipset, but we cannot guarantee compatibility will all LCD modules based on this chipset. To ensure compatibility, use the LCD module provided for the Rabbit- FLEX BL300F in the RabbitFLEX Keypad/Display Kit. For more information on the character dis- play in the kit, see Appendix D ...

Page 38

... 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. (The “RabbitFLEX_BL300F” folder was formerly named “RabbitFLEX_SBC40.”) Symbol ...

Page 39

... 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 func- tions. (The “RabbitFLEX_BL300F” folder was formerly named “RabbitFLEX_SBC40.”) Figure 4-10 Keypad Driver Circuit Schematic Power On/Reset State: Off, High impedance Table 4-6 ...

Page 40

... The external interrupt can be configured to use J1, pin 7 on the RabbitFLEX BL300F. The external inter- rupt 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 ...

Page 41

... V • 4.4 V • Bidirectional Logic • Contact Input 4.3.10.1 Digital Input 1.4 V Threshold This section presents the circuit schematic and the characteristics for the 1.4 V threshold digital input. Figure 4-11 Digital Input 1.4 V Threshold Circuit RabbitFLEX User’s Manual W www.rabbit.com 35 ...

Page 42

Table 4-8. Digital Input 1.4 V Threshold Characteristics Symbol Parameter V Working Input Voltage IW V Maximum Input Voltage IM V High Level Input Voltage IH V Low Level Input Voltage IL V Trigger Threshold Voltage T I High Level ...

Page 43

... Note Note 4: Over Maximum Input Voltage range Note 5: From PowerCore Supply5 Note 6: Time delay from a cell pin input voltage change from Volts to see V Note 7: Time delay from a cell pin input voltage change from Volts to see V RabbitFLEX User’s Manual Note Min ...

Page 44

... Note 4: Over Maximum Input Voltage range Note 5: From PowerCore Supply5 Note 6: Time delay from a cell pin input voltage change from Volts to see V Note 7: Time delay from a cell pin input voltage change from Volts to see Note Min Typical DC 0 -40 6.4 1 4.45 2 200 117 www.rabbit.com Max Unit ...

Page 45

... Note 4: Over Maximum Input Voltage range Note 5: From PowerCore Supply5 Note (( 2.13) mA over Working Input Voltage Range Q IW Note 7: Time delay from contact opening to see V Note 8: Time delay from contact closing to see V RabbitFLEX User’s Manual Figure 4-14 Contact Input Circuit W W Note Min Typical ...

Page 46

Bidirectional Logic This section presents the circuit schematic and the characteristics for the bidirectional logic. A birdirec- tional logic circuit is useful when talking to an offboard device that communicates using the same line for transmit and receive, such ...

Page 47

... Note 8: Time delay from a cell pin input voltage change from Volts to see V Note 9: Time delay from a cell input voltage change from logical see V Note 10: Time delay from a cell input voltage change from logical see V RabbitFLEX User’s Manual Note Min Typical ...

Page 48

Digital Outputs There are several digital output options on a RabbitFLEX BL300F.They are listed in not all options are available on all five connectors. Table 4-13. Digital Output Specifications RabbitFLEX BL300F Option Sinking Driver Sinking Driver, 100 ...

Page 49

... Low Level Quiescent Current QL t Turn On Time ON t Turn Off Time OFF Note Max O Note 2: From V Max to 10 Max Note 3: From 90 Max with resistive load S Note 4: From PowerCore Supply5 RabbitFLEX User’s Manual Note Min Typical 14.5 Max with resistive load O www.rabbit.com Max ...

Page 50

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 ...

Page 51

... Turn Off Time OFF Note Max O Note 2: From 90 Max Note 3: From V Max to 10 Max with resistive load S S Note 4: From PowerCore Supply5 Note 5: External +K source supplies additional 10 mA quiescent current RabbitFLEX User’s Manual W W Note Min 0 Max with resistive load www ...

Page 52

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 ...

Page 53

... Line Driver, 100 , 5 V This section presents the circuit schematic and the characteristics for the line driver. Line drivers are avail- able on J1 through J5, pins 1 through 8. Figure 4-20 Line Driver 100 Power On/Reset State: Off Table 4-18. Line Driver Characteristics Symbol ...

Page 54

... 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 22). First, the 0-10 V DAC channel uses the op amp to increase the PWM voltage to the desired range. ...

Page 55

... Note 1: Uses Supply5 when 10V DAC not present. Uses the 10V DAC external supply otherwise. Note 2: At Maximum V FS Note 3: Best Fit Method Note 4: Based on V Settling Time. Higher rates possible with reduced voltage changes FS Note 5: Full Scale Change to ½ LSB RabbitFLEX User’s Manual Note Min Typical DC ...

Page 56

... Note 2: At Maximum V FS Note 3: Best Fit Method Note 4: Based on V Settling Time. Higher rates possible with reduced voltage changes FS Note 5: Full Scale Change to ½ LSB 50 Figure 4-22 DAC 0-10 V Circuit Schematic Table 4-20. DAC 0-10 V Characteristics Note Min 900 5 www.rabbit.com ...

Page 57

... The output to the speaker is on J6. Figure 4-23 Loudspeaker Circuit Schematic NOTE: The operating temperature range for the speaker differs from the operating tempera- ture range (–40°C to +70°C) of the rest of the RabbitFLEX BL300F components. A sample WAV files is provided in /Samples/RabbitFlex_BL300F/audio /Samples/RabbitFlex_SBC40/audio/ depending on your version of Dynamic C. ...

Page 58

... V • 4-20 mA The ADCs work with single-ended unipolar voltage inputs and industry standard 4-20 mA current loops. The digital result has an 8-bit resolution and the sampling frequency is determined by the following equa- tion. Sampling Frequency for ADCs The ADC channels are sampled round-robin, so the sampling frequency depends on the number of analog- to-digital channels that exist on the RabbitFLEX BL300F ...

Page 59

... 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 Table 4-21. ADC 0-3 V Characteristics RabbitFLEX User’s Manual W www.rabbit.com 53 ...

Page 60

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 Table 4-22. ADC 0-10 V Characteristics www.rabbit.com RabbitFLEX ...

Page 61

... 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 passive input and the device must either supply the loop current or be wired in series with a supply to operate correctly. ...

Page 62

Power Routing You can bring power supply pins out on any of the pin-configurable connectors (J1-J5). All five connec- tors accommodate 5 V pins, but only J1-J3 have 3.45 V. Keep in mind that no matter how many power ...

Page 63

... Unix or DOS style paths. The standard directory structure allows for monitoring, logging, Web browsing, and FTP updates of files. For more information, see: • FAT File System User’s Manual - Describes the FAT structure, operations and functions available. RabbitFLEX User’s Manual ...

Page 64

... Serial Communication Dynamic C provides drivers for RS-232 and RS-485. For a full discussion of these drivers, see the Techni- cal 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 ...

Page 65

... RabbitFLEX BL300F: a sinking output that can sink and one that can sink up to 100 mA. Another advantage of a sinking output driver is that it can control large voltage—up to the rating of the transistor used. The 1 A sinking driver can control ...

Page 66

... It must go somewhere. The protection diode provides a path for that current to go around in a loop until the coil’s resistance eventually stops the current (typically takes less than 5 ms). A very high voltage would develop at the transistor’s collector without the protection diode, which could zap and destroy the transistor ...

Page 67

... V to achieve any desired voltage between 0 V and 5 V. The quality of the analog signal is determined largely by the settling time, the slew rate and the output res- olution of the DAC channel. Settling Time – This is the time it takes for the analog signal to achieve a full-scale change in volt- • age. ...

Page 68

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 ...

Page 69

... The input capture timer starts counting when the ramping up starts. When the ramp voltage matches the analog input signal, a comparator fires, and the timer's value is recorded. The RAMP_OUT pin is the output from the core module’s ramp generator. The calibration of the ramp is tied to an onboard 2.5 V voltage reference. The 400 Hz ramp has a linear rise time from ...

Page 70

More Information on RabbitFLEX BL300F ...

Page 71

... Continuously samples one user-specified analog input pin, displaying in the Stdio window both the raw data from the analog signal and also “averaged” raw data, meaning that noise and error are removed using a weighted value. Both the raw data and the averaged raw data are converted to volts ...

Page 72

... Demonstrates the use of a 5-wire (hardware handshaking) serial port. You must have 2 serial ports available to use this driver—one port will be used for the hardware handshaking lines. This program demonstrates the use of a serial flash by writing a pattern to the first 100 pages which then can be inspected or cleared by the user ...

Page 73

... RabbitFLEX BL300F Design File The design number is also used as the name of an .xml file and an html file, both of which summarize the board’s connector and pin assignments. The html file is provided as a convenient way for you to review the RabbitFLEX User’s Manual ...

Page 74

... So, if you have a digital output with a software name of “flex_led1”, then this will correspond to a Flex_IOPin data structure named “flex_led1”. To change the state of this digital output, you might do the following: flexDigOut(& ...

Page 75

... A digital input group works similarly: flexDigInGroup16(switches, &result); In this case, the state of the first pin in the pin group is placed in the least significant bit of result; the state of the second pin is placed in the next least significant bit of the result; etc. RabbitFLEX User’s Manual www.rabbit.com 69 ...

Page 76

... X represents the particular serial port you are using. 6.3.6 Keypad All keypad functions begin with “flexKey.” To use the keypad software support, you must first initialize the keypad. Use the flexKeyInit() func- tion. Here is an example: flexKeyInit(& ...

Page 77

... To drive the keypad driver, you must continuously call the flexKeyProcess() function. 6.3.7 LCD All LCD functions begin with “flexDisp.” To use the LCD software support, you must first initialize the LCD. Use the flexDispInit() function. Here is an example: flexDispInit(&flex_lcd, NULL); ...

Page 78

... See the speaker_tone.c and speaker_audio.c for examples on using these drivers. 6.3.9 Thermistor This is a PowerCoreFLEX feature—please see the PowerCoreFLEX User’s Manual for information on using the thermistor. 6.3.10 Serial Flash This is a PowerCoreFLEX feature—please see the PowerCoreFLEX User’s Manual ...

Page 79

... PWM channel. Note that instead of passing the data structure itself, we pass a pointer to the data structure. We will see this again and again in other RabbitFLEX functions. RabbitFLEX User’s Manual // Holds the user command // Indicates whether or not the tone should repeat // Indicates if user has requested to exit the program www ...

Page 80

... The “repeat” parameter is used to indicate how many times the tone will be repeated ( 128 means to repeat indefinitely). Following the above section are a number of other “case” statements that load other tones and implement other com- mands. We will skip them. ...

Page 81

... If you designed your RabbitFLEX board to have a digital output attach to an LED, then you might want to call that output “flex_led”. It the case above, we used a different naming scheme. “digout” indicates that this is a digital output. “32” indicates that this digital output is located on connector J3, pin 2 ...

Page 82

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 conve- nience, here is ...

Page 83

... 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 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 ...

Page 84

... We have now accepted the switch press. Recall that led is also already a pointer, and thus it is also not preceded by an “&.” This line simply turns on the LED to indicate that the switch has been pressed. // Play the tone flexToneLoad(tones[switchnum], tone_len[switchnum], REPEAT_TONE); ...

Page 85

... This last section implements debouncing on switch release. We wait until the switch is released, and then check the switch again 200 ms later. If the switch is still released, then we turn off the corresponding LED and we break out of the while loop. The costatement starts over again, which means that we again monitor all of the switches ...

Page 86

... Initialize the output LEDs to turn off flexDigOutGroup16(leds, 0x0f); Remember how we individually initialized each of the LEDs in the previous section? With the “leds” I/O group, we can initialize the LEDs in a single statement. Both the flexDigOutGroup16() and flexDigInGroup16() functions expect an array of Flex_IOPin pointers as the first argument. The second parameter in flexDigOutGroup16 unsigned integer ...

Page 87

... Light the corresponding output LED flexDigOut(*led, 0); // Play the tone flexToneLoad(tones[switchnum], tone_len[switchnum], while ( 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 Turn the LED back off flexDigOut(*led, 1); break; ...

Page 88

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 ...

Page 89

... Now we begin switch debouncing. We wait 50 ms, and then check if the switch has been pressed again. Note that switch_pressed indicates which pin has been pressed—this is one of the results from the loop above. However, switch_pressed is a double pointer (Flex_IOPin **), whereas flexDigIn() expects a single pointer (Flex_IOPin *) ...

Page 90

... API Functions This section describes the programming interface for the RabbitFLEX BL300F. tions by category. Each function name is a link to the function’s full description. Function Category Board Initialization brdInit Pin Names flexPinName flexDigIn Digital Inputs flexDigOutGroup16 flexDigOut Digital Outputs flexDigShadow ...

Page 91

... Returns the character string that represents the name of the given I/O pin. Note that the returned string cannot be modified. PARAMETER Pointer to the information structure for the selected I/O pin. pin RETURN VALUE A string representing the name of the selected I/O pin. RabbitFLEX User’s Manual brdInit flexPinName www.rabbit.com 85 ...

Page 92

Digital Inputs int flexDigIn(Flex_IOPin *pin); DESCRIPTION Reads the state of a digital input channel. This function is non-reentrant. PARAMETER Pointer to the information structure for the selected I/O pin. pin RETURN VALUE 0: logic low 1: logic high <0: ...

Page 93

... The values for each of the inputs will be placed into the variable pointed to by this pointer. The values are placed in the following manner — the input reading from the first pin in the pin group is placed in the first bit (lsb) of the result; the second pin is placed in the second bit ...

Page 94

Digital Outputs 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 ...

Page 95

... Pointer to the information structure for the selected I/O pin. 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 flexDigShadow www.rabbit.com 89 ...

Page 96

... Array of pointers to Flex_IOPin structures (the information structure for digout_pins each I/O pin), terminated by FLEX_GROUP_END. These are the output pins. The values with which to set the digital outputs. The i’th bit in the values values field will be used to set the i’th pin in the digout_pins array. RETURN VALUE 0: success < ...

Page 97

... The voltage corresponding to the first A/D converter value. volts1 The second A/D converter value. value2 The voltage corresponding to the second A/D converter value. volts2 RETURN VALUE 0: success <0: error (not an analog input?) SEE ALSO flexAnaIn flexAnaInVolts , RabbitFLEX User’s Manual flexAnaInCalib www.rabbit.com 91 ...

Page 98

... This function is non-reentrant. PARAMETER Pointer to the information structure for the selected pin. pin RETURN VALUE 0: a value corresponding to the voltage on the analog input channel (0–4095) -1: overflow or out of range -2: error (not an analog input?) SEE ALSO flexAnaInVolts , ...

Page 99

... PARAMETER Pointer to the information structure for the selected pin. pin RETURN VALUE 0: a voltage value corresponding to the voltage on the analog input channel FLEX_ANAIN_ERROR: overflow, out-of-range, or not an analog input SEE ALSO flexAnaIn flexAnaInmAmps , RabbitFLEX User’s Manual flexAnaInVolts flexAnaInCalib , www.rabbit.com 93 ...

Page 100

DESCRIPTION Reads the state of the external analog input channel and uses the previously set calibration con- stants to convert it to milliamps. This function is non-reentrant. Also note that the value retrieved here is not read ...

Page 101

... 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 ...

Page 102

... This function is non-reentrant. PARAMETER Pointer to the information structure for the selected analog input pin. pin RETURN VALUE 0: A value corresponding to the raw voltage (0–4095) on the analog input channel -1: overflow or out of range -2: error (not an analog input?) SEE ALSO flexAnaInAverageSetting flexAnaInmAmpsAverage ...

Page 103

... This function is non-reentrant. PARAMETER Pointer to the information structure for the selected analog input pin. pin RETURN VALUE 0: A value corresponding to the voltage on the analog input channel FLEX_ANAIN_ERROR: overflow, out of range, or not an analog input SEE ALSO flexAnaInAverageSetting flexAnaInmAmpsAverage RabbitFLEX User’s Manual flexAnaInAverage , , www.rabbit.com 97 ...

Page 104

DESCRIPTION This function is like flexAnaInmAmps(), except that it reports the most recent discount av- eraged current reading instead of the raw current reading. To set the discount average alpha value, execute flexAnaInAverageSetting() before calling this function. ...

Page 105

... RETURN VALUE >0: a new value is available for this analog input 0: this analog input has not been updated <0: error (not an analog output?) RabbitFLEX User’s Manual flexAnaInNewValue www.rabbit.com 99 ...

Page 106

... Pointer to the information structure for this I/O pin. pin The first D/A converter value (0–1024). value1 The voltage corresponding to the first D/A converter value. volts1 The second D/A converter value (0–1024). value2 The voltage corresponding to the second D/A converter value. volts2 RETURN VALUE 0: success < ...

Page 107

... 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 Pointer to the information structure for the selected analog output pin. pin Value corresponding to the voltage on the analog output (valid range is 0– rawvalue 1024) RETURN VALUE 0: success ...

Page 108

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 Pointer to the information structure for the ...

Page 109

... RETURN VALUE None. SEE ALSO flexDispCursor flexDispGoto , flexDispPrintf flexDispOnoff , flexDispContrast RabbitFLEX User’s Manual flexDispInit char num_cols; char num_rows; //Start address of each row ( rows) char row_addresses[4]; // Minimum voltage for contrast control float anaout_contrast_min; // Maximum voltage for contrast control float anaout_contrast_max; // Minimum duty cycle for contrast control int pwm_contrast_min ...

Page 110

DESCRIPTION Sets the cursor type to be on, off, or blink. PARAMETERS Pointer to an LCD data structure. lcd One of the following cursor macros: style DISP_CUROFF DISP_CURON DISP_CURBLINK RETURN VALUE None. SEE ALSO ...

Page 111

... Column position from top left corner. col Row position from top left corner. row RETURN VALUE 0: success -1: error (column or row not in allowed range for this display?) SEE ALSO flexDispInit flexDispCursor , flexDispPrintf flexDispOnoff , flexDispContrast RabbitFLEX User’s Manual flexDispGoto flexDispClear , , flexDispBacklight , www.rabbit.com flexDispPutc , , 105 ...

Page 112

DESCRIPTION Gets the current cursor position based on the column and row parameters. PARAMETERS Pointer to an LCD data structure. lcd Pointer to an unsigned int (used to store column position). ...

Page 113

... Gets the number of columns and rows for the given display. PARAMETERS Pointer to an LCD data structure. lcd Pointer to an unsigned int (used to store number of columns). col Pointer to an unsigned int (used to store number of rows). row RETURN VALUE None. SEE ALSO flexDispGetPosition RabbitFLEX User’s Manual flexDispGetContrast , www.rabbit.com 107 ...

Page 114

DESCRIPTION Clears the display and returns the cursor to the home position. PARAMETER Pointer to an LCD data structure. lcd RETURN VALUE None. SEE ALSO flexDispInit flexDispCursor , flexDispPrintf , flexDispContrast 108 flexDispClear flexDispGoto , flexDispOnoff flexDispBacklight ...

Page 115

... Puts the given character on the display at the current cursor position. PARAMETERS Pointer to an LCD data structure. lcd The character to write to the display. ch RETURN VALUE None. SEE ALSO flexDispInit flexDispCursor , flexDispPrintf flexDispOnoff , flexDispContrast RabbitFLEX User’s Manual flexDispPutc flexDispGoto , , flexDispBacklight , www.rabbit.com flexDispClear , , 109 ...

Page 116

DESCRIPTION Prints the formatted string to the display starting at the current cursor position. The format speci- fier and additional parameters are specified just like in printf(). PARAMETERS Pointer to an LCD data structure. ...

Page 117

... DESCRIPTION Turns the display on or off. PARAMETERS Pointer to an LCD data structure. lcd 1 = turn the display on, onOff 0 = turn the display off. RETURN VALUE None. SEE ALSO flexDispInit flexDispCursor , flexDispPutc flexDispPrintf , flexDispContrast RabbitFLEX User’s Manual flexDispOnoff flexDispGoto , , flexDispBacklight , www.rabbit.com flexDispClear , , 111 ...

Page 118

DESCRIPTION Turns the display's backlight on or off. PARAMETERS Pointer to an LCD data structure. lcd 1 = turn the backlight on, onOff 0 = turn the backlight off. RETURN VALUE 0: success -1: error ...

Page 119

... DESCRIPTION Sets the contrast for the display. The vcontrast value range is from 0–255, and is scaled to a contrast-control voltage. PARAMETERS Pointer to an LCD data structure. lcd Contrast setting (0–255) that is scaled to produce a contrast-control voltage vcontrast (lower values produce higher contrast). ...

Page 120

... DESCRIPTION Returns the current contrast setting (0–255). PARAMETER Pointer to an LCD data structure. lcd RETURN VALUE The current contrast setting (0–255). SEE ALSO flexDispContrast 114 flexDispGetContrast flexDispGetDimensions , www.rabbit.com flexDispGetPosition , Applications Programming ...

Page 121

... Initializes the given keypad. The flexKeyInit() function must be called before any other keypad function for this particular keypad. PARAMETER Pointer to the keypad to initialize. keypad RETURN VALUE None. SEE ALSO flexKeyConfig flexKeyProcess , RabbitFLEX User’s Manual flexKeyProcess flexKeyGet flexKeyUnget , , flexKeyInit flexKeyGet , , www.rabbit.com ...

Page 122

DESCRIPTION Assigns each key with key press and release codes, hold and repeat ticks for auto repeat, and de- bouncing for a specific ...

Page 123

... Pointer to the keypad to use. keypad Key code to put back onto the top of the queue. cKey RETURN VALUE >0: key code successfully put back onto the queue 0: failure (keypad queue full?) SEE ALSO flexKeyInit flexKeyConfig , RabbitFLEX User’s Manual flexKeyUnget flexKeyProcess , , www.rabbit.com flexKeyGet 117 ...

Page 124

DESCRIPTION Gets the next key press for the selected kepad from the keypad input queue. PARAMETER Pointer to the keypad to use. keypad RETURN VALUE >0: next key press 0: no key presses available SEE ALSO flexKeyInit ...

Page 125

... DESCRIPTION Enables the tone driver so that samples can be loaded and played. The tone driver consumes 10–20% of the processor's time while it is running. Use flexToneShutdown() to disable the tone driver while not in use. Do not use the tone and audio drivers simultaneously. You may switch between them within the same program ...

Page 126

... SEE ALSO flexSpeakerPWM , flexToneStop void flexToneStop(); DESCRIPTION Immediately stops any tone that is playing. RETURN VALUE None. SEE ALSO flexSpeakerPWM , flexToneLoad 120 flexToneLoad flexToneActivate flexToneShutdown , flexToneStop flexToneActivate flexToneShutdown , www.rabbit.com , , Applications Programming ...

Page 127

... 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. Do not use the tone and audio drivers simultaneously. You may switch between them within the same program ...

Page 128

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 , flexAudioStop flexAudioPlaying , flexAudioLoad int flexAudioPlaying(); ...

Page 129

... 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 Sampling rate of the input data (1–65,535 Hz). sample_rate RETURN VALUE None. SEE ALSO ...

Page 130

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 ...

Page 131

... 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. SEE ALSO flexSpeakerPWM flexAudioActivate , flexAudioPlay flexAudioPlaying , flexAudioLoad RabbitFLEX User’s Manual flexAudioShutdown flexAudioPlay , flexAudioSetRate , flexAudioStop flexAudioShutdown , flexAudioSetRate , www.rabbit.com ...

Page 132

... Defined serial port configuration if devices are installed mode Mode 0 1 RETURN VALUE 0: Valid mode 1: Invalid mode SEE ALSO API functions in RS232.lib. Documention available in “Function Lookup” in the Dynamic C pulldown help menu; function documentation also in the Dynamic C Function Reference Manu- al. 126 serMode Table 6-7. Serial Port F RS-232, 3-wire ...

Page 133

... Wait for Tx Data buffer to become empty while(serCwrFree() != COUTBUFSIZE); // Wait for Tx buffer and shift register become empty while(RdPortI(SCSR)&0x08 || RdPortI(SCSR)&0x04); ser485Rx(); RETURN VALUE None SEE ALSO brdInit ser485Rx , RabbitFLEX User’s Manual ser485Tx // enable transmitter // send byte // wait for echo // disable transmitter www.rabbit.com 127 ...

Page 134

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 func- tion. This function is non-reentrant. RETURN ...

Page 135

... RabbitFLEX BL300F. Figure A.1 RabbitFLEX BL300F 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). There are 6 mounting holes, each with diameter 0.187 inches (4.8 mm). RabbitFLEX User’s Manual A. R ABBIT f www.rabbit.com ...

Page 136

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 com- ponents. Figure A.2 shows this exclusion zone. Figure A.2 ...

Page 137

... RJ-45, 2 LEDs 512K program 512K data 512K 1 Mbyte 3 V lithium coin type 2032, 220 mA·h (to support RTC and data SRAM two analog outputs available, one of which can be configured to drive an 8 Max. asynchronous rate = CLK/8, Max. synchronous rate = CLK/2 RJ-45 connectors: one Ethernet and one RabbitNet™ ...

Page 138

... A new conformal coating should then be applied to offer con- tinuing protection against the effects of moisture and contaminants. The PowerCore FLEX User’s Manual contains further information and an illustration of the conformally coated area. NOTE: For more information on conformal coatings, refer to Rabbit Technical Note 303, “ ...

Page 139

... A (PowerCore 3810) and 2 A (PowerCore 3800). The + regulated down to 3. linear regulator on the PowerCore module. Figure B.1 PowerCore Module Power Supplies The PowerCore 3800 and the PowerCore 3810 are built for use with a full-wave rectifier and center-tapped AC transformer. RabbitFLEX User’s Manual PPENDIX W www ...

Page 140

... B.2.1 Replacing the Backup Battery The battery is user-replaceable, and is fitted in a battery holder. To replace the battery, slide out the old bat- tery. Use only a 2032 or equivalent replacement lithium battery, and insert it into the battery holder with the + side facing away from the PowerCore module. ...

Page 141

... Circuit Bidirectional Logic Lines Keypad Outputs Sinking Drivers Sinking Drivers, 100 Sourcing Drivers, 400 Sourcing Drivers Line Drivers, 100 RabbitFLEX User’s Manual Table B-1. Power On / Reset State Input Off, High Impedance Off, High Impedance Off, High Impedance Off, High Impedance ...

Page 142

136 www.rabbit.com ...

Page 143

... V on screw terminal header J1 on the demo board. Otherwise you will need to attach an external +5 V power supply to J1. Connect the black wire from the cable assembly to GND on screw terminal header J1. If you are using an external power supply, connect its ground to GND well. RabbitFLEX User’s Manual C. D EMONSTRATION Figure C.1 Demonstration Board · ...

Page 144

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 ...

Page 145

... RabbitFLEX SBC40 that has 100 mA sinking drivers on pins and 8. Figure C.3 Demo Board Connected to Pins Cable Assembly · · · · · · RabbitFLEX User’s Manual www.rabbit.com 139 ...

Page 146

... Make sure the programming cable and transformer are connected as described in 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.com Chapter 2, “Getting ...

Page 147

... Table D-1 lists the items in the RabbitFLEX Keypad/Display Kit along with their part num- bers. Table D-1. RabbitFLEX Keypad/Display Kit Parts Description 4 × 20 Character Display 5 , 0.5 W Current-Limiting Resistor 2 × 6 Keypad Keypad Connector Cable Assembly D.1 Keypad To make the hardware connections between the keypad and the RabbitFLEX board, you will first need: • ...

Page 148

Figure D.1 Connect Keypad to Keypad Connector J5 142 www.rabbit.com ...

Page 149

... D.3 2 × 6 Keypad Datasheet RabbitFLEX User’s Manual www.rabbit.com 143 ...

Page 150

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 ...

Page 151

... D.5 4 × 20 Character LCD Datasheet RabbitFLEX User’s Manual www.rabbit.com 145 ...

Page 152

146 www.rabbit.com ...

Page 153

... RabbitFLEX User’s Manual www.rabbit.com 147 ...

Page 154

148 www.rabbit.com ...

Page 155

... Input Voltage (low) Recommended LCD Driving Voltage (Standard Vdd - Vo Temp.) Recommended LCD Driving Voltage (Wide Vdd - Vo Temp.) Power Supply Current LED Backlight Voltage LED Backlight Current RabbitFLEX User’s Manual Electrical Characteristics Symbol Condition Vih H Level Vil L Level 0°C 25°C 50°C -20°C 0° ...

Page 156

150 www.rabbit.com ...

Page 157

... 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.pdf 090-0128 Programming Cable Schematic www.rabbit.com/documentation/schemat/090-0128.pdf RabbitFLEX User’s Manual S CHEMATICS www.rabbit.com 151 ...

Page 158

152 www.rabbit.com ...

Page 159

... D DACs ................................................................ 48–51 datasheet, 2 × 6 keypad ......................................... 143 datasheet, 4 × 20 LCD .......................................... 145 debugging ............................................................... 13 demonstration board ..................................... 137–140 digital input ............................................................. 35 RabbitFLEX User’s Manual Index flexDigIn() .......................................................... 86 flexDigInGroup16() ............................................ 87 digital output ........................................................... 42 flexDigOut() ...

Page 160

... System ID block ...................................................... 18 T tcp_config.lib .......................................................... 12 termination resistors ................................................ 58 troubleshooting ....................................................... 13 www.rabbit.com ...

Page 161

... U USB .................................................................... 8, 13 User block ............................................................... 18 W WAV files ............................................................... 51 website ...................................................................... 2 RabbitFLEX User’s Manual www.rabbit.com 155 ...

Page 162

156 www.rabbit.com ...

Related keywords