Remote Processing Coorporation RPC-320 User Manual Download Page 29

DIGITAL AND OPTO PORTS

SECTION 6

Page 6-7  RPC -320

COMMANDS

The following tables shows the RPBASIC-52 comm ands
used for digital I/O.

Comm and

Function

C O N F I G   L IN E

Configu res I/ O por ts

C O U N T

Returns number of pulses at a line.

L I N E

Function  retur ns status of an opto
module as a 0 or 1.

L I N E

Statemen t turns on or  off an opto
module.

LINE B

Function returns 8 data bits from any
I/O type device.

LINE B

S ta te m en t  w r it es   8  d a ta   b it s  t o  a n y  I / O
type device.

LINE #

Function re turns status of line at J3
connector as a 0 or 1.

LINE #

Statement wr ites data to a line at J3
connector as a 0 or 1.

O N   C O U N T

Counts pulses and optional generates an
interr upt.

O N   L I N E

Generates an interrupt when a line
changes.

P W M

Sets PWM param eters for any line.

Summary of Contents for RPC-320

Page 1: ...ever Remote Pr ocessing assumes no responsibility for any of the circuits described herein conveys no license under any patent or other right and make no repre sentations that the circuits are free from patent infringement Rem ote Processing makes no representation or warr anty that such applications will be suitable for the use specified without further testing or modification The user must make ...

Page 2: ... IN RAM 5 2 BLOCK DATA TRANSFER 5 3 ASSEMBLY LANGUAGE INTERFACE 5 3 COMMANDS 5 3 SECTION 6 DIGITAL AND OPTO PORTS INTRODUCTION 6 1 DIGITAL I O PORTS 6 1 Digital Port J3 6 1 Digital Port P6 6 2 High Current Port L8 6 2 Optically Isolated Input 6 2 Digital I O Com mands 6 2 High Curr ent Output 6 3 Interfac ing Digital I O to an opto module rack 6 4 Interfacing to switches and other devices 6 4 Digi...

Page 3: ...1 SECT ION 12 EXTERNAL INTERRUPT DESCRIPTION 12 1 PROGRAMMING 12 1 Program exam ples 12 1 COMMANDS 12 2 SECT ION 13 MULTI MODE COUNTER DESCRIPTION 13 1 SECT ION 14 POWER REDUCTION FURTHER POWER REDUCTION 14 1 Prog ram Exam ple 14 2 SECT ION 15 TECHNICAL INFORMATION ELECTRICAL SPECIFICATIONS 15 1 MEMORY AND I O BANK MAP 15 2 MECHANICAL SPECIFICATIONS 15 2 JUMPER DESCRIPTIONS 15 2 ...

Page 4: ... causing longer strings to be printed V1 10 Initial release for RPC 330 Added AOT command 330 only Added COUNT ON COM ON COUNT ON LINE and ON KEYPAD V1 11 11 29 95 Added day of week to DAT E comm and and function V1 12 12 01 95 Added code to use Atmel 29C040A flash V1 13 01 12 96 Added code to support IEE centry series display 3602 100 05420 Includes PRINT port V1 14 03 28 96 Fixed bug in ON C OUN...

Page 5: ...digital terminal strips RPBA SIC 52 p rogr amm ing language is standard T his language is a version of the original Intel BASIC 52 It was m odified for the RPC 320 for c ontrol data acquisition applications and on board har dware fea tures Program development can take place on your PC using your word processor or on the RPC 320 Programs from your PC are downloaded using a serial communication prog...

Page 6: ... hexadecimal notation is mo re convenient to use Notation use d in this manual and BASIC 52 is the H character after the number 8CH stands for 8 C hexadecimal TECHNICAL SUPPORT If you have a question about the RPC 320 or RPBASIC 52 and can t find it in this manual call us and ask for technical supp ort Technical support hours ar e 9 AM to 4 PM mountain time When you call please have your R PC 320 ...

Page 7: ...OVERVIEW SECTION 1 Page 1 3 RPC 320 Figure 1 1 System layout ...

Page 8: ...e characteristics requir e using CM OS com ponents CM OS is static sensitive T o avoid damaging these c omponents observe the following precautions before handling the RPC 320 1 Ground yourself before handling the RPC 320 or plugging in cables Static electricity can easily arc through cables and to the card Simply touching your PC before you touch the card can greatly reduce the amount of static 2...

Page 9: ...on program Set comm unication par ameter s to 9600 baud 8 da ta bits no parity 1 stop Using a Terminal Follow your term inal instructions to set the baud rate to 9600 baud 8 data bits no parity and 1 stop You may need a 9 pin male to 25 pin male adapter to connect the VTC 9F 3 Power up Turn on your pow er supply On pow er up a copyright message is printed RPBASIC 52 V1 09 RPC 320 Copyright Remote ...

Page 10: ...you could have the following in a file written on your editor REM Check position REM Read output from the pot and REM calculate the position 2200 a ain 0 REM Get position The first 3 comments downloaded to the RPC 320 are ignored Similarly the empty lines between comm ents are a lso ignored L ine 2200 with its comment is a part of the program and could be listed The m ajor pena lty by writing a pr...

Page 11: ...heck U7 pin 8 If it is high about 5 volts then the car d is in reset T his line should be low about 0 volts 2 Check the COM 0 port J3 Rem ove the connector from COM 0 R efer to the outline drawing ear lier in this chapter Connect an oscilloscope preferred or a voltmeter to pin 3 T xd and gr ound Pin 3 should be 6 volts or more negative Pin 1 is designated by the v symbol on the connector Pin 3 is ...

Page 12: ...rogram calls another the old program is completely replaced All variables and arrays are clear ed set to 0 To keep variables you m ust save them before calling the new progr am When the new program is running these variables are restored Use PEEK and P OKE to read and save numbers and strings See Chapter 5 STORING VARIABLES IN RAM for more inform ation Binary data is saved and read from the EPR OM...

Page 13: ...ake appr oximately 0 25 seconds in a very small program up to 1 second in a very large program AUTORUNNING To autorun a program 1 Make sure there is a program in EP ROM from above When using a 128K or 512K size EPROM make sure the star t up progr am was saved to segment 0 2 Remove jumper W9 Push the reset button The program will run If there are any error s the progr am will stop assuming you have...

Page 14: ...a m to duplicate progr ams Jumper W2 is normally configured for flash EPROM W2 3 5 and W2 4 6 For non flash E PRO Ms W2 is configured for 1 3 and 2 4 Large volume OEM s should contact Remote Processing regarding pre configuring W2 and W3 for your application COMMANDS The following is a list of RPBASIC 52 commands used for saving loading and executing programs and data These comm ands and functions...

Page 15: ...n with the original BASIC 52 COM0 SERIAL PORT This port uses a VTC 9F serial cable to connect external serial devices to the por t T he cable con sists of a 10 pin IDC connector wired one to one to a DB 9 connector Line 10 is sim ply cut off The pin out is designed so it plugs directly into the 9 pin serial port connector on a PC CTS is a output and is set to high on power up Norm ally this tells ...

Page 16: ...22 485 OPERATING INFORMATION RS 422 485 Termination network When the RPC 320 is the last physical unit on a network RS 485 or it is the only unit RS 422 the receiver must be terminated to prevent ringing Jumper block W5 6 installs or removes this network Insert a jumper in W5 and W6 to install the network terminator Only one slave device on a RS 485 network should have a terminator installed The h...

Page 17: ...com munication protoco ls F or this example a protocol might look som ething like this 22M B1 The pr otocol starts w ith the cr charac ter This character synchronizes all units and alerts them that the next few characters coming down are address and data In this case 22 is the units address M is the comm and and B1 is the checksum T he comm and is terminated with a cr character The response depend...

Page 18: ...how how UIn and U On work 100 UI0 Set to COM0 110 INPUT A Get data from COM0 port 520 UI1 Switch to COM1 port 530 INPUT B Get data from COM1 port 800 REM Print to COM0 810 PRINT Temperature T 900 REM Print to COM 1 910 PRINT 1 Set pressure at CA Power up default is set to COM 0 DISABLING CONTROL C Program execution is terminated by entering a Cntl C To disable Cntl C so program execution is not te...

Page 19: ...L PORTS SECTION 4 Page 4 5 RPC 320 5 RXD In 6 CTS Out 9 Ground 10 5 RTS input not in COM0 A seria l cable is made by simp ly taking a 10 pin fe male IDC connector and crim ping a 9 wir e ribbon c able to it ...

Page 20: ... with either 32K or 128K of RAM installed Maximum is 512K To change a mem ory chip you need to rem ove the original chip install the new one and set jumper W 1 To install a new memory chip 1 Turn off power to the RPC 320 2 Remove the mem ory chip from U 5 3 Orient the chip so pin 1 is towards the inside If installing a 32K RAM place the chip at the bottom of the socket m emor y chip pin 1 goes int...

Page 21: ...r iables reside in segment 0 D ata is generally stored in segment 1 and higher a segment is 64K of memory See memor y map figure 5 2 Data Area is segment 1 or higher PEEK and PO KE commands store and retrieve values from memor y For example 20 POKEB1 12 A puts the 8 bit value of A into segment 1 addr ess 12 Use the PEEK statement to retrieve the variable 50 B PEEKB 1 12 Accessing reser ved mem ory...

Page 22: ...esponse s to ONT ICK or ONIT R are d elayed by the time it takes to transfer data W hen ONTIC K or ONIT R must be serviced faster transfer data in sm aller blocks Refer to BLOAD and BSAVE in Appendix A for more information ASSEMBLY LANGUAGE INTERFACE Assembly language program s must be placed in the RPBASIC 52 E PROM W hen using RPBASIC 52 progr ams should start at addr ess 6000H or higher up to 7...

Page 23: ...N C OUN T counts the number of high to low transitions at a digital line Maxim um coun ting rate is about 95 Hz T hese commands simplify design and greatly speed up execution See Appendix A for more information DIGITAL I O PORTS All ports use an 82C55 for I O Lines are accessed using LINE or LINEB commands Lines at J3 and P6 are configured for inputs or outputs using the CONF IG LINE comm and See ...

Page 24: ...basis How m uch and for how long depend s upon your application A quick w ay to check for excessive current is to touch VERY CARE FUL LY Q2 next to P2 It can be warm to hot to the touch Consider the maxim um ambient temper ature the b oard w ill operate at A t 70 C warm to the touch at room temperature m ay be too much Consider adding a heat sink The PW M com mand m ay be used with this port Use t...

Page 25: ...unwieldy to check lines frequently Another multitasking command ON C OUN T causes the operating system to ch eck the specified line every 5 m s Up to 8 lines are monitored If the line changed from a high to low state a counter is incremented M aximum counting rate is effectively 95 Hz This command has two variations One causes a software interr upt when a specified num ber of co unts is reached An...

Page 26: ...rogram line 110 sets J3 pin 3 to a logical 0 level Program line 120 returns the status of externa l opto modu le rack po sition 0 If the modu le is off a 1 is returned assuming it is an output module Program line 130 returns the status of J3 pin 3 as a 0 or 1 Example To turn on opto module in slot position 8 the following command is executed LINE 108 1 A 1 turns on a module while a 0 turns it off ...

Page 27: ...xecuting LINE 7 ON sets the line high LINEB is used to read and write a byte at a time LINEB 3 1 128 sets port B bit 7 high and bits 0 6 are low Pulse Width Modulation PWM Any line accessible by the L INE com mand m ay be pulse width modulated PW M comm and parameters determ ine high and low time to 5 ms resolution and optionally number of pulses Use PW M to control the brightness of a display via...

Page 28: ... 14 18 Port A line 7 15 10 Port B line 0 High current 16 8 Port B line 1 High current 17 4 Port B line 2 High current 18 6 Port B line 3 High current 19 1 Port B line 4 High current 20 3 Port B line 5 High current 21 5 Port B line 6 High current 22 7 Port B line 7 High current 23 13 Port C line 0 Lower C 0 16 Port C line 1 Lower C 1 15 Port C line 2 Lower C 2 17 Port C line 3 Lower C 3 14 Port C l...

Page 29: ...module as a 0 or 1 LINE Statemen t turns on or off an opto module LINE B Function returns 8 data bits from any I O type device LINE B Statement writes 8 data bits to any I O type device LINE Function re turns status of line at J3 connector as a 0 or 1 LINE Statement wr ites data to a line at J3 connector as a 0 or 1 ON COUNT Counts pulses and optional generates an interrupt ON LINE Generates an in...

Page 30: ...tery backed RAM and jumper setting when installing a 512K RAM WARNING An additional modification to the DS1216DM is necessary when installing a 512K RAM C ontact Remote P rocessing for de tails SETTING DATE AND TIME Set the date to turn on the clock module Date and time are set w hile running a progr am or in the imm ediate mode Date and time are treated as number s and not strings To set the date...

Page 31: ...CALENDAR CLOCK SECTION 7 Page 7 2 RPC 320 Figure 7 1 Calendar Clock ...

Page 32: ...cable You simply connect the 20 pin connector to the RPC 320 L CD display port and the other end into the display Additional power wiring is usually required for LCD graphic and VF charac ter displays This infor mation is included with the display Information content is display dependent Below is general information on both Graphic displays require additional voltages not generated on the RPC 320 ...

Page 33: ...oltage 5 A 6 D6 6 A 5 D5 7 B 4 Reset from invertor 8 B 3 Write 9 B 2 Read 10 A 7 D7 11 A 1 D1 12 A 0 D0 13 A 3 D3 14 A 2 D2 15 B 7 CS from invertor 16 B 6 Com mand data 17 B 5 Halt 18 Contrast adjust 19 Alternate power 20 Power gr ound J4 is available for additional I O if a display is not used Port A is configured as an input or output P ort B must be configur ed as an outpu t if a 17 key or larg...

Page 34: ...ed when a key is pressed Press the D key to enter 10 STRING 200 20 20 0 123A456B789C 0 D 30 P 1 40 PF 0 50 PRINT Enter a number from the keypad REM Rest of program continues REM Scan keypad and update display 200 GOSUB 500 210 IF PF 0 THEN 200 220 PRINT 230 PRINT Entered string is 2 240 PF 0 250 GOTO 50 500 A KEYPAD 0 510 IF A 0 THEN 500 520 IF A 12 THEN 600 REM Process clear 530 IF A 16 then 700 ...

Page 35: ... the key pad position pressed Elements of the pr evious program can be com bined with this one to produce keypad strings KEYPAD PORT PIN OUT J5 The keypad port uses ports B and C from an 82C55 Lowe r por t C is configured as an input Upper port C and port B bits 0 and 1 are ou tputs The table b elow lists J5 s pin out 82C55 p ort and bit and its intended function Pin 82C55 Function Port bit 1 C 0 ...

Page 36: ...lts M aximum voltage for 2 to 4 channels is 12 volts Total input current m ay not exceed 16 ma on all channels Each channels input current is computed by the following formula Iin Vin 5 4700 When Vin 5 volts no curr ent flows into the channel NOTE An over voltage condition on one channel usually affects readings on other channels Grounding Analog ground is somewhat isolated from digital ground Whi...

Page 37: ...uts channels 2 7 may be single ended Examples u sing CON FIG AIN Below are sample syntaxes for CO NFIG AIN Differential 0 to 5V input CON FIG AIN 0 0 1 CON FIG AIN 1 0 1 Perform a conver sion as normal A AIN 0 The difference between channel 0 and 1 is returned When channel 1 is more positive than channel 0 the result is zero The differenc e is read on channel 1 by performing A AIN 1 Single ended 2...

Page 38: ... more samples would in theory cancel out any effects of noise A problem with this is noise tends to group together Ta king 6 readings at one time might show no change fr om the norm Another 6 reading s might be all high If possible try to spread out readings over a period of time several seconds if possible Another way is place a capacitor 0 1 to 1 mfd between the input terminal and ground This is...

Page 39: ...ANALOG INPUT SECTION 10 Page 10 4 RPC 320 The outpu t from the temperatur e sensor v aries fr om unit to unit Self heating effects as well as supply voltage will change the output ...

Page 40: ...0 530 RETI MEASURING HIGHER VOLTAGES Voltages higher than 5V are measur ed by inserting a series r esistor to the inp ut The table below shows resistor values for some input voltages using the 0 5V range Maximum Input Voltage Resistor 6 20K 12 5 150K 24 380K Use the following formula to determine the series resistance necessar y for a m aximum voltage input Rs Vi 20000 100000 0 5V range Rs Vi 4000...

Page 41: ... line should break a 0 volt or nearly so is returned A 4 20 ma curr ent loop is converted to 1 5V by placing a 250 ohm resistor across the input of the chan nel to ground Cur rent loop r eadings ar e conver ted to engineer ing units by performing scaling as described earlier Since the measur ement r ange is 1 to 5V the count ran ge is reduced by 20 to 3276 If pressure were measured K 200 3276 K 06...

Page 42: ...You can adjust the range to 5 12V This is useful when the input is 0 5V and you want to know when the input is over range To calibrate or adjust the voltage reference 1 Connect the voltmeter ground to a GN D point on the Analog IN terminal strip Make sure there are no other connections to the analog ground 2 Connect the voltmeter lead to U14 pin 6 3 Adjust R5 for 5 00 VDC or other voltage as desir...

Page 43: ...port condition to change The timer is set by executing a WDOG n command n is 0 1 or 2 0 turns off the timer 1 sets the watch dog time to 380 ms while 2 sets it to 2 8 seconds Executing WDO G by itself resets the timer WD OG must be executed pe riodically to prevent a reset When the watchdog times out a softwar e reset is perfor med The effect is lines at J3 do not ch ange as in a power up or har d...

Page 44: ...al voltage of at least 3 5 volts any polarity will generate an interrupt Higher voltages may be used provided a ser ies resistor is in line to the supply Use the following formula to determine the series resistor needed Rs Vi 6 005 Where Vi input voltage No series resistor is needed when Rs is negative INTERRUPT CHARACTERISTICS Interrupts are negative going edge sensitive This means an interrupt i...

Page 45: ...EXTERNAL INTERRUPT SECTION 12 Page 12 2 RPC 320 Figure 12 1 Optically isolated and TTL interrupts enable interrup ts ...

Page 46: ...for this chips operating modes W hat are shown are exam ples of how to program this chip NOTE Be sure to initialize the counter chip before using COU NT com mands Failure to do so returns m eaningless results The COU NT function returns the current counter value Specifically RPBASIC w rites a 2 to the MCR M aster Control Register reads the 3 counter bytes from the OL Output latch and converts it t...

Page 47: ...is periodically a large negative number is returned This is because the multimode counter has rolled over This is corrected by periodica lly reseting the CNTR or transfer ring PR to CN TR Refer to the data sheet Appendix A for counter operating mo des This program sets up the LS7166 to cause an interrupt when a pr eset numb er of cou nts is reached W8 7 8 is jumpered to interrupt on a borrow 10 LI...

Page 48: ...e RPC 320 IDLE 2 also has a number of operating restr ictions This mode shuts dow n the RS 232 rece iver dr iver IC so no character s can come in or go out T his IC also supplies current for the amplifiers and analog to digital converter Do not apply negative voltages to the analog input in this mode The tick timer is shut off However the real tim e clock m odule if installed continues to operate ...

Page 49: ...t Board current consumption may be affected by the setting of jump er W 7 T his jumper determ ines if inputs at J3 are pulled up or down When set to pull up inputs each line forced low increases current consumption by 50 uA If all inputs are tied to 5V or ground rem oving jump er W 7 may dr aw less cur rent The application program IC in U6 may be changed to a 29C040 This 512K byte memory draws 200...

Page 50: ...d voltage s to 250 volts peak may be a pplied to this input A series resistor is necessary for voltages above 12V Keypad input 10 lines accept a 16 position matrix keypad Scanning and debounce performe d in RPBASIC 52 Display output 14 digital and 6 power and ground lines used to control LCD VF and LC D graphics displays D isplays supported in RPBASIC 52 Serial ports Two RS 232D serial ports All h...

Page 51: ... m aterial FR 4 JUMPER DESCRIPTIONS A after a jumper position indicates fa ctory def ault is jumpered Jumper Description W1 1 2 RAM size 32K 128K W1 2 3 RAM size 128K W3 1 3 2 4 29C040 F lash W3 3 5 2 4 29C010 Flash W3 3 5 4 6 29C256 F lash W2 1 3 2 4 EPROM selected W2 3 5 4 6 Flash EPROM selected W4 1 2 COM 1 RS 485 input W4 2 3 COM 1 RS 232 input W5 1 2 RS 485 terminator W6 1 2 RS 485 terminator...

Reviews: