I/O232-A User s Guide

Similar documents
ST400C-NT USER S GUIDE. Table of Contents

USB-Based 14-Channel Data-Acquisition Module

Mounting Dimensions / Viewing 2 Mounting Options 3. Wiring Configuration 4. Quick Set up Procedure 5. Changing Intensity 6.

RS 232 Interface. RS 232 is the Serial interface on the PC. Three major wires for the Serial interface: Transmit Pin 2 Receive Pin 3

RMV ELECTRONICS INC. Application Note

BV4626 General Purpose I/O. Product specification. Mar 2010 V0.a. ByVac Page 1 of 13

Vorne Industries. Model 77/232 Serial Input Numeric 3" Display User's Manual

melabs Serial LCD Firmware Version 1.1 3/5/07

NetMedia 2x16 Serial LCD Display Module V1.5

Vorne Industries. 2000S Series Serial Input Alphanumeric Display User's Manual

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

RFID: Read and Display V2010. Version 1.1. Sept Cytron Technologies Sdn. Bhd.

icex-cmtm General specs and Installation guide

CLCD1 Serial 1 wire RS232 LCD development board

I/O SIGNAL CONDITIONER

DIGITAL COMPASS SOLUTION

CDN503 HIGH DENSITY I/O ADAPTER USER GUIDE

CEIBO FE-5111 Development System

R325P Single Axis Driver

CEIBO FE-51RD2 Development System

CDN502 HIGH DENSITY I/O ADAPTER USER GUIDE

DEV-1 HamStack Development Board

PIM Presco Interface Module

ADR7700. RS232 / Data Acquisition Interface USER MANUAL V 1.0

Manual 601: : USB/RS232. Specifications. Contents. Options

EWAVE Inc Gracefield Ln. Dallas, Texas (972)

ED1021 I/O Expander with UART interface & analog inputs

Mega128-DEVelopment Board Progressive Resources LLC 4105 Vincennes Road Indianapolis, IN (317) (317) FAX

ED1021 I/O Expander with UART interface & analog inputs

8051 Intermidiate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

Dual Serial Shield User Manual

Microcontroller. BV523 32bit Microcontroller. Product specification. Jun 2011 V0.a. ByVac Page 1 of 8

VINCULUM-BASED TEMPERATURE / HUMIDITY / VOLTAGE DATA LOGGER FEATURES:

Beijer Electronics AB 2000, MA00453,

USB-BASED 8-CHANNEL DATA ACQUISITION MODULE

Hybrid AC Driver [GCNC-1110]

melabs Serial LCD Firmware Version 1.0 2/7/07

SLCD1-IC Serial LCD Processor

MD9 MULTIDROP INTERFACE INSTRUCTION MANUAL

Preliminary. PACKAGE - 28-pin MLP (5mm X 5mm) Example Circuit Diagram CP V. 48MHz Oscillator. USB Function Controller 512B EEPROM

DVK kHz RFID Development Kit User Manual

Instruction Manual for BE-SP3 Circuit. 10/21/07

Product Specification for SAB-S-MODBUS

Ready-Set-Go (RSG) Controller: Getting Starter

CAUTION: TTL Only, Do Not Use ± 12 V RS-232

S125 Multi-Purpose 125 KHz RFID Reader USER MANUAL. 9V/24V DC Operating Voltage, AC (optional) KHz RFID EM4100/2 Cards & Tags

BV511 Hardware Guide ByVac ByVac Revision 1.0

EDE700 Serial LCD Interface IC

USB485. USB to RS485 Converter Card. User Manual for connecting with Windows Vista Version 1.01

BASIC Stamp Activity Board: Features and Specifications

DS1306. Serial Alarm Real Time Clock (RTC)

Acu-Trac Ultrasonic Level Sensors

LT900SERIES. 1xN Multi-Channel Switch Operation Manual

Weeder Technologies. 90-A Beal Pkwy NW, Fort Walton Beach, FL

CHAPTER 5. Voltage Regulator

HMC1022 Digital Compass

PRELIMINARY Prototyping Platform for the DLP-RF2 Transceiver

MRUC-20 Modul-R CAN Bus Network

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

Features: Analog to Digital: 12 bit resolution TTL outputs, RS-232 tolerant inputs 4.096V reference (1mV/count) 115K max speed

ARDUINO MEGA ADK REV3 Code: A000069

Exclusive 2.5 GHz Frequency Counter

Hints and tips when using RC1xx0 RF Modules

RS-422 Code-Operated Switches

CEIBO FE-W7 Development System

ADR2200 RS232/RS485 RELAY I/O INTERFACE USER MANUAL V 3.0

Amarjeet Singh. January 30, 2012

CF-850/F1KM-176-S Hardware Manual

USB485 USB to RS485 Converter Card

User's Guide. Programmable DC Power Supply 200 Watt (40 Volts / 5 Amps) Model Introduction

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

ANC Series RS-422 Serial Communications Adapter

Development System Rev. 0014A

QSB Command List. Document Version /15/2017

RS-232 Digital Relay I/O

F2MC MB90385 series Evaluation Board Documentation. Revision Date Comment V New document

MSOC Communication Commonality with DPU/TPU/GPU 2000R Protective Relays

A GUIDE TO RS-232 COMMUNICATION WITH FX PLCS

IO64 User's Manual. Rev C. Document

716/718 Converter User's Guide V 1.96

BV4615. Dual Interface Zero Keypad. Product specification. Dec 2009 V0.a. ByVac Page 1 of 11

Able Systems Limited Northwich, Cheshire, England

TP80301 Data Sheet Copyright SIGMATONE Version 1.0

Home Security System with Remote Home Automation Control

AD-8923-BCD. Remote Controller (BCD) INSTRUCTION MANUAL 1WMPD

I2C Interface for QL Emulators Part 1 Originally Published in QL Today, Vol 15, Issue 4, May-June 2011

ARDUINO MEGA 2560 REV3 Code: A000067

NetMedia 2x16 Serial LCD Display Module V1.2

HYDRA-X23/X23S. Power Application Controllers. PAC HYDRA-X User s Guide. Copyright 2014 Active-Semi, Inc.

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

LBI-38599F Maintenance Manual

Introduction 1. Liquid crystal display (16 characters by 2 rows) Contrast dial: turn the dial to adjust the contrast of the display (see page 5)

Designer Systems. LCD Micro Serial Interface Module for Alpha LCD panels. Technical Data

CB-1 Peripheral Board Technical Manual

Introduction Page 1. Power Supply Requirements & Hardware Options Page 2. External Connectors (Functions & Pinouts) Page 2

CF-850/F1K-144-S Hardware Manual

Device: DSP-7S04H. This document Version: 1. Date: 23 March Description: 2.3 4x 7 segment display module with decimals

School of Computer Science Faculty of Engineering and Computer Science Student ID Number. Lab Cover Page. Lab Date and Time:

Easy Kit Board Manual

ARDUINO LEONARDO WITH HEADERS Code: A000057

Transcription:

rmv electronics I/O232-A User s Guide DISCLAIMER: RMV ELECTRONICS INC. does not assume any liability arising from the application and/or use of the product/s described herein, nor does it convey any license. RMV ELECTRONICS INC. products are not authorized for use as components in medical, life support or military devices without written permission from RMV ELECTRONICS INC. The material enclosed in this package may not be copied, reproduced or imitated in any way, shape or form without the written consent of RMV ELECTRONICS INC. This limitation also applies to the firmware that the Integrated Circuits in this package might contain. WARRANTY: RMV ELECTRONICS INC. will replace, free of charge, faulty components in this package with the exception of the Integrated Circuits it might contain, for a period of 6 months after the date of purchase. Chapter 1 GETTING STARTED Connecting the I/O-232 Board to a Computer Due to the variety of connectors used from one computer manufacturer to another, the serial port connector and cable are not provided. The I/O-232A only requires 3 wires to communicate with your computer. These go from the RS- 232 header on the I/O-232 board to three pins on the connector required by your computer. Refer to the pin out diagram in Figure 1. The RX line on the I/O-232 board goes to the TX line on the computer and the TX line on the board goes to the RX line on the computer ("modem cable" or crossed wire configuration). GND on the board goes to digital ground on the computer. ITC232-A Wiring Diagram 1

Figure 1 Typical Connections 1. Wiring a DB25 connector to the RS232 header on the I/O- 232 board : Connect GND to pin 7 on the DB25, RX to pin 2 and TX to pin 3. Pin numbers are printed on the connector. 2. Using a DB9 pin connector: Connect GND to pin 5, RX to pin 3 and TX to pin 2. Pin numbers are printed on the connector. 3. Using a Macintosh connector: See the corresponding figure. To Macintosh phone connector Ground To TX (on board) To RX (on board) View looking from inside the computer Figure 2. Another way to proceed, if you already have a cable connected to your serial port, is to measure the voltage in the lines. First, find with an Ohm meter, the GND line (the computer MUST be OFF). Then turn the computer ON and measure the voltages on the lines. The one carrying -9 to -12 V goes to the RX line on the board. The third one goes to TX on the board. Power Supply Apply power to the board. In order to do this you need at least 7.5VDC. This can be provided through a wall AC/DC transformer (300 ma is standard for most applications), a battery (at least 9V), any other DC power supply (of at least 7.5VDC). Caution: Be sure to check the polarity before connecting the power supply. If they are reversed the regulator will burn out. If you are using an on-board 7805 regulator, make sure it does not heat up. This would indicate a short somewhere in the circuit. Upon applying power or pressing the reset button, the following message should appear on your screen: Welcome to the ITC232-A? or h for help > and you should hear a beep resulting from the printing of an ASCII(#7) character. If you do not get this message consult the trouble-shooting section. 2

Communications The normal procedure is to develop and test the commands you want to send to the peripheral using a terminal emulation program, such as the ones listed below. Once the program has been outlined, the user can write an application code in a higher level language (C, Pascal, QBASIC, Visual BASIC, etc.) for the task(s) to be performed You can operate the I/O-232 board from a custom written program or you can do it from any commercial communications software (PROCOMM, Terminal for Windows, MAC240, etc). Make sure that the COM port you select in your program corresponds to the one to which the I/O-232 is connected. Choose 300 or 9,600 Bauds on the terminal according to the BAUD pin Baud level (According to the speed selected by JP1. High = 9600, Low = 300). The other parameters are always N,8,1 (no parity, 8 bits and 1 stop bit). The Baud rate can be changed later to any standard value between 300 and 115200 Bauds. When using a commercial communications software package select no CR translation to CR/LF (Carriage Return/Line Feed). LF is ignored by the ITC232-A but it still takes some time to be sent. Enable the local echo if you are using a communications package. Important: Make sure the Backspace key on your terminal sends out ASCII(#8), otherwise you will not be able to correct a command without retyping it entirely (in some terminal emulator programs, such as the one included in Windows, a backspace is generated with a Ctrl key (e.g. under VT-100 terminal emulation, backspace is Ctrl- H)). While with commercial software packages the CRAB (Bin), CRAD (Dec) or CRAH (Hex) configurations work best, the CRAP (Program) configuration is optimized for controlling the ITC232-A from within your own programs. Chapter 2 OPERATING THE I/O232 BOARD Using the A/D Converter: 8 Bit ADC The I/O 232-8A board contains an 11 channel, 8 bit A/D converter the MC145041. For practical reasons, only 10 of the 11 channels are used in this board even though the 11 th channel is available, if needed, directly on pin 12 of U3. The following diagram shows the interface between the ITC232-A and the MC145041: Figure 3 The reference voltage for all channels is 10K multi-turn potentiometer (TRIM) and it appears on TP1 so that you can easily measure it. The reference voltage determines the maximal value 3

(decimal 255) measurable on any channel. Voltages above this threshold will yield 255 and below GND will yield 0. The maximal voltage that can be directly read is close to VCC (~+5V). It is recommended that the impedance of the circuit being read be <10K. The MC145041 interfaces with the ITC232-A via a 3 line synchronic serial interface (PD/PS pins on the ITC232-A). One of these lines (PD1/PS_TX) carries data into the MC145041 to select the analog channel to be read. Only the 4 most significant bits of the value received by the MC145041 are used. Since the ITC232-A sends out 8 bit words, here is a table to simplify the channel selection task: CHANNEL BINARY DEC HEX AN0 00000000 0 $00 AN1 00010000 16 $10 AN2 00100000 32 $20 AN3 00110000 48 $30 AN5 01010000 80 $50 AN6 01100000 96 $60 AN7 01110000 112 $70 AN8 10000000 128 $80 AN9 10010000 144 $90 AN10 10100000 160 $A0 Another line, PD0/PS_RX, is used to read the result of the last conversion into the ITC232-A. Finally, PD2/PS_CK carries the clock signal necessary to move data between the ICs. The ITC232-A's Serial Peripheral Interface must be configured to the MC154041 requirements prior to use. To achieve this, send only once, at the beginning of a session, the command PCSA128 (<P>ort <S>erial <C>onfigure <A>ll 128 (see under PORT COMMANDS to configure the SPI). The MC145041 operates as follows: The analog channel is selected by the value sent from the ITC232-A (see Table above). Once the channel is selected, the conversion takes place immediately and the result is stored in an internal shift register. This value needs to be clocked back into the ITC232-A. IMPORTANT: You should read the result of the conversion immediately after selecting the analog channel. Otherwise, the obtained result is historical! In order to write and read to the MC145041 you will use the PWSn and PRS commands (n represents the number used to select the analog channel as per the Table above). You do not need to write the channel number every time, if you are always reading from the same one. The reason for this is that every time a value is clocked into the ITC232-A with a PRS command, a value is automatically and simultaneously clocked out the PD1/PS_TX pin. This value is either the last value written to the SPI (with the last PWSn command) or 0 if none has yet been written following a reset. Thus, when you issue PWSn followed by PRS this is what actually happens: (1) the analog channel is selected and a conversion takes place, (2) n is now stored in the ITC232-A as the last value written to the SPI, (3) the result of the conversion is waiting in the MC145041 serial register, (4) the PRS command clocks that result into the ITC232-A while n is sent again to the MC145041 thus starting a new conversion, the result of which is now in turn waiting to be clocked out the MC145041 shift register. Should you issue a new PRS without sending PWSn first, the last result for that analog channel would be clocked into the ITC232-A while the same channel number is clocked out thus generating a new conversion. Please note that an initial PWSn MUST be sent in order to select the channel. A fast rate of conversion can be attained by using the @ command after a PRS. 4

Examples: We assume the PCSA128 command has already been issued in order to configure the SPI. (a) To read channels AN0, AN1 and AN2 successively: PWS0 (for AN0), PRS (reads AN0), PWS16 (selects AN1), PRS (reads AN1), PWS32 (selects AN2), PRS (reads AN2). (b) Reading channel AN5 multiple times: PWS80 (selects AN5 and makes the first conversion), PRS,..any other commands not related to the SPI..., PRS, PRS... Should you wish to read AN5 after an interval following the last conversion, send PRS twice and discard the 1st result because it corresponds to the last conversion before the interval. (c) Reading channel AN8 in a continuous loop. This is the fastest way of reading successive values from the SPI: PWS128 (selects AN8), PRS (yields the first result), @, @, @... Note that no other command can be issued between @'s. Otherwise, that command would be the one repeated using @. On the computer side you will receive, along with the conversion results the @PRS legend. For more details about the @ command refer to LIST OF COMMANDS, Again command. 10 and 12 Bit ADC Our I/O-232-10 boards use either an MC154051 or a TLC1543 instead of the MC145041 used in the I/O-232-8 series. The I/O 232-12 boards use a TLC2543, 12 bit ADC. All these ADC's have 10 channels and 8, 10 or 12 bits of resolution. The 8 bit IC and the 10 or 12 bit ICs are very similar in the way they operate. The only difference is that the latter two return the result in two bytes instead of one. Thus, the SPI has to be read twice to pull out the result and since the manufacturers have built these IC's in such a way that there is a 6 bit shift in the result, once the two bytes have been assembled, the result must be divided by 64 to obtain the actual value. Although the 10 and 12 bit ADCs are similar in the way they operate, some important differences exist in the way the data flows. Thus, we will first address the 10 bit ADC then the 12 bit one. To operate a 10 bit ADC within an I/O-232 board, proceed as follows: (Remember, send only the characters within <> and an [Enter] at the end of each command). 1. Configure the SPI by sending from the computer <P>ort <C>onfigure <S>erial <A>ll <128>. 2. Select the analog channel with <P>ort <W>rite <S>erial $n where $n, in hexadecimal corresponds to: $00 = AN0 pin 1 $10 = AN1 pin 2 $20 = AN2 pin 3 $30 = AN3 pin 4 $40 = AN4 pin 5 $50 = AN5 pin 6 $60 = AN6 pin 7 $70 = AN7 pin 8 $80 = AN8 pin 9 $90 = AN9 pin 11 $A0 = AN10 pin 12 (Not connected in the I/O-232 board) $B0 = AN11 Half scale test channel, returns $8000 $C0 = AN12 Zero test channel, return $0000 $D0 = AN13 Full scale test channel, returns $FFC0 (Note: Some chips return $FF80 instead 5

of $FFC0 (equal to max - 1 LSB after bit shiftwing). 3. Send <P>ort <R>ead <S>erial. The Least Significant Byte of the previous conversion is returned. Send PRS again (or @) and the Most Significant Byte of the previous conversion is returned. Note: After changing the AN channel, discard the result from the next 2 PRS commands since they correspond to the LSByte and MSByte respectively of the last conversion from the former AN channel. Keep track of the number of PRS commands sent in order to know whether you are reading the LSByte (always first) or the MSByte. 4. The result returned by the MC145051 is shifted 6 bits to the left. Thus, the result must be divided by 64. Should you wish to assemble the result in one variable V, use V = (LSByte + MSByte * 256)/64 in decimal or $V = (LSByte + MSByte * $FF)/$40 in hexadecimal. Example: For practical reasons, let us use test channel AN11 which always returns the half scale value (512 or $200). a. Working from a terminal program, configure the results in ASCII Hexadecimal with CRAH [Enter]. b. Configure the SPI with PCSA128 [Enter]. c. Select channel AN11 by typing PWS$B0 [Enter]. d. Get a reading with PRS [Enter] followed by @. You should get $00 and $80 which corresponds to $8000 (32768 decimal). Divide by $40 or 64 decimal to obtain 512, the value of half the scale. e. Configure results in decimals with CRAD [Enter]. Then type PRS [Enter] followed by @. You get 000 and 128. To compute the result as shown in 4 do: R = (000 + 128 * 256) / 64 = 512. The description above works best when only one channel is been used. However, if channels are changed you should insert a third "PRS" command. This is because when you change channels with "PWSxx" the last conversion is sent out. This of course corresponds to the last channel and should be discarded. For an example in QBasic showing how to perform the 3 tests (Zero, Full scale and half scale) the MC145041 provides see Appendix A. Some Considerations When using the I/O 232 Board remember the following: 1. The IRQL and IRQH interrupt lines are each brought to CONNECTOR 1 via a capacitor with a bleeding resistor in parallel. This allows the use of as many interrupt lines in parallel as needed (the interrupt is only generated by a voltage edge and not by the voltage level). The source of the interrupt can be later determined through an input port. The values of C4,R7 & R6 might not be the optimal ones for your particular application (e.g. to measure a frequency by counting the number of interrupts arriving to the computer per second, you might need different capacitor and resistor values). Change them accordingly. 2. The -9 Volt appearing on CONNECTOR 6 is generated by the MAX232. Thus, keep the current within this IC s specifications. 3. Do not drain more than 10 ma per output on ports A, B & C or the PWM pin. In order to activate heavier loads use a transistor driver. 6

Chapter 3 TROUBLE SHOOTING If the message: Welcome to the ITC232-A? or h for help > does not appear on your screen upon resetting the I/O-232, proceed as follows: (1) Check that there is power on the board (~5 V). (2) Check that the serial link is working. The most frequent problems here are: (2.a) The COM port in use is not the selected one in the program. (2.b) The communication parameters are incorrect. (2.c) The RX and TX lines are inverted. Serial drivers are sturdy and normally stand some electrical abuse. You could just invert the cables going to RX and TX and try again. NOTE THAT EVEN THOUGH IT IS UNLIKELY THAT YOU WILL INFLICT ANY DAMAGE TO YOUR COMPUTER OR THE I/O-232 BOARD, YOU ARE WORKING AT YOUR OWN RISK AND RMV ELECTRONICS INC. WILL NOT BE HELD RESPONSIBLE FOR ANY DAMAGE. If you want to test the cables before connecting them again, send any file out the serial port. With a tester on the AC voltage scale you should read a variable voltage between 0 and -12 volts coming into the RX line on the board. Conversely, testing the TX line on the board should result in a brief AC voltage appearing after releasing the RESET button (resulting from the Welcome... message). If the latter does not happen then there is a problem in the I/O- 232 board (see below). (3) Verify the board again and in particular the positioning of the ICs. To determine whether the problem is in U1 (a MAX232 used to generate the voltages required for the RS232C standard) or in U2 (the ITC232-A IC), repeat the last test for an AC voltage on U2, pin 29 (when sending from the computer) and U2, pin 30 after releasing the RESET button. A failure of the latter means: (3.a) The ITC232-A has no power (measure supply voltages on the chip pins). (3.b) The ITC232-A has not been properly reset (or the RST pin is always Low). Check the reset circuit. (3.c) The IC is not oscillating (check pins 39 and 38 with an oscilloscope). (3.d) The IC is gone... In that case, call RMV ELECTRONICS INC. for a replacement. 7

APPENDIX A Zero, Full Scale and Half Scale Tests in QBasic The example below in QBasic shows how to perform the 3 tests (Zero, Full scale and half scale) the MC145041 provides. Other channels are read identically: CLS START: PRINT "CONNECT BOARD AND PRESS A KEY WHEN READY" START1: DO UNTIL INKEY$ <> "": LOOP CLEAR TRUE = 1: FALSE = 0 REM Open COM port OPEN "Com1: 9600,N,8,1,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" FOR RANDOM AS #1 PRINT "PLEASE RESET THE ITC232-A or ESC TO ABORT" PRINT RES: IF INKEY$ = CHR$(27) THEN END IF LOC(1) = 0 THEN GOTO RES GOSUB READSERIAL W$ = "CRAP": GOSUB WRITESERIAL W$ = "PCSA128": GOSUB WRITESERIAL FOR number = 1 TO 8 PRINT number, W$ = "$B0": PRINT W$; " "; : GOSUB READ10BITS: ' Half scale test W$ = "$D0": PRINT W$; " "; : GOSUB READ10BITS: ' Full scale test W$ = "$C0": PRINT W$; " "; : GOSUB READ10BITS: ' Zero test PRINT NEXT number END REM Subroutines REM Writing to serial port WRITESERIAL: PRINT #1, W$ GOSUB READSERIAL RETURN REM Reading serial port READSERIAL: S$ = "" IF LOC(1) = 0 THEN GOTO READSERIAL REM Get received string into S$ Lp1: C$ = INPUT$(1, #1) S$ = S$ + C$ IF C$ <> ">" THEN GOTO Lp1 REM decode string (V$) and value (V) 8

VALIDERROR = TRUE ERRORCODE$ = "" V$ = "" FOR H = 1 TO LEN(S$) IF MID$(S$, H, 1) = CHR$(7) THEN VALIDERROR = FALSE IF MID$(S$, H, 1) = "?" THEN ERRORCODE$ = MID$(S$, H + 1, 1) NEXT H IF (VALIDERROR = TRUE AND ERRORCODE$ <> "") THEN GOSUB ERRORSUB: RETURN V$ = "" FOR n = 1 TO LEN(S$) x$ = MID$(S$, n, 1) IF x$ <> CHR$(13) THEN IF x$ >= "0" AND x$ <= "9" THEN V$ = V$ + x$ V = VAL(V$) NEXT n RETURN ERRORSUB: PRINT PRINT "Error #"; ERRORCODE$ RETURN READ10BITS: W$ = "PWS" + W$: GOSUB WRITESERIAL W$ = "PRS": GOSUB WRITESERIAL: ' dummy read W$ = "PRS": GOSUB WRITESERIAL: ' Get MSByte MSB = V W$ = "PRS": GOSUB WRITESERIAL: ' Get LSByte LSB = V RESULT = LSB + 256 * MSB RESULT = RESULT / 64 PRINT RESULT, RETURN 9