Stanford Research Systems SIM900 Operator Manual

Operation and Service Manual
Stanford Research Systems
Mainframe
SIM900
Revision 1.51 July 19, 2005
Certification
Stanford Research Systems certifies that this product met its published specifications at the time of shipment.
Warranty
This Stanford Research Systems product is warranted against defects in materials and workman­ship for a period of one (1) year from the date of shipment.
Service
For warranty service or repair, this product must be returned to a Stanford Research Systems authorized service facility. Contact Stanford Research Systems or an authorized representative before returning this product for repair.
Information in this document is subject to change without notice.
Copyrightc Stanford Research Systems, Inc., 2003 – 2005. All rights reserved.
Stanford Research Systems, Inc. 1290–D Reamwood Avenue Sunnyvale, CA 94089 USA Phone: (408) 744-9040 Fax: (408) 744-9049
www.thinkSRS.com e-mail: info@thinkSRS.com
Printed in U.S.A.
SIM900 Mainframe
Contents
General Information iii
Safety and Preparation for Use . . . . . . . . . . . . . . . . iii
Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv
Specifications . . . . . . . . . . . . . . . . . . . . . . . . . . vi
1 Operation 1 – 1
1.1 Introduction to the Instrument . . . . . . . . . . . . . 1 – 2
1.2 Getting Started . . . . . . . . . . . . . . . . . . . . . . 1 –3
1.3 Timebase . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 4
1.4 Configuration Switches . . . . . . . . . . . . . . . . . . 1–4
1.5 Activity Monitors . . . . . . . . . . . . . . . . . . . . . 1 – 6
1.6 SIM Interface Connector . . . . . . . . . . . . . . . . . 1 – 6
2 Remote Programming 2 – 1
2.1 Index of Commands . . . . . . . . . . . . . . . . . . . 2 – 2
2.2 Alphabetic List of Commands . . . . . . . . . . . . . . 2– 5
2.3 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 – 9
2.4 Port Communications . . . . . . . . . . . . . . . . . . 2–10
2.5 Commands . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 12
2.6 Register Model . . . . . . . . . . . . . . . . . . . . . . 2 –41
3 Communications Examples 3 – 1
3.1 Introduction to Communications . . . . . . . . . . . . 3 – 2
3.2 Streaming Example . . . . . . . . . . . . . . . . . . . . 3–4
3.3 Message-Based Example . . . . . . . . . . . . . . . . . 3 – 8
3.4 Combination Example . . . . . . . . . . . . . . . . . . 3 –16
4 Circuitry 4 – 1
4.1 Circuit Descriptions . . . . . . . . . . . . . . . . . . . . 4–2
4.2 Parts Lists . . . . . . . . . . . . . . . . . . . . . . . . . 4 – 6
4.3 Schematic Diagrams . . . . . . . . . . . . . . . . . . . 4 – 8
i
ii Contents
SIM900 Mainframe
General Information
Safety and Preparation for Use
Dangerous voltages, capable of causing injury or death, are present in this instrument. Use extreme caution whenever theWARNING! instrument covers are removed. Do not remove the covers while the unit is plugged into a live outlet.
Line Voltage
The universal input power supply of the SIM900 accommodates any voltage in the range 90 VAC to 260 VAC, with a frequencyin the range 47 Hz to 63 Hz.
Line Fuse
The line fuse is internal to the SIM900 and may not be serviced by the user. If the Standby LED does not turn on when line power is provided, contact Stanford Research Systems.
Line Cord
Service
The SIM900 has a detachable, three-wire power cord for connection to the power source and to a protective ground. The exposed metal parts of the instrument are connected to the outlet ground to protect against electrical shock. Always use an outlet which has a properly connected protective ground.
Do not attempt to service or adjust this instrument unless another person, capable of providing first aid or resuscitation, is present.
Do not install substitute parts or perform any unauthorized modi­fications to this instrument. Contact the factory for instructions on how to return the instrument for authorized service and adjustment.
The SIM900 Mainframe is not intended for hot-swapping applica­tions. Be certain to switch power to Standby before inserting or ejecting modules in the mainframe. Do not connect a module to the remote port while power is on.
iii
iv General Information
Symbol Description
Alternating current
Caution - risk of electric shock
Frame or chassis terminal
Caution - refer to accompanying documents
Earth (ground) terminal
Battery
Fuse
On (supply)
Off (supply)
Symbols you may Find on SRS Products
SIM900 Mainframe
General Information v
Notation
The following notation will be used throughout this manual:
Front-panel indicators are set as Overload.
Remote command names are set as *IDN?.
Literal text other than command names is set as OFF.
Remote command examples will all be set in monospaced font. In these examples, data sent by the host computer to the SIM900 are set as straight teletype font, while responses received by the host computer from the SIM900 are set as slanted teletype font. Command terminators explicitly sent by the host computer are set
with the symbol “”.
SIM900 Mainframe
vi General Information
Specifications
Performance Characteristics
Power Supplies Voltages ±15 VDC, ±5 VDC, +24 VDC
Regulation ±0.5 % (±15 V, ±5 V)
±2 % (+24 V)
Current limits 5 A max (+5 V)
3 A max (all others)
Power limit 70 W total, all voltages
Timebase Internal timebase 10 MHz VCXO, ±10 ppm
External connector Rear panel BNC
External input 10 MHz, 1 V to 5 V pp Capture range ±50 ppm (±500 Hz)
Interfaces SIM ports 8 internal + 1 Remote
DB–15 (female)
Aux. RS-232 2; DB–9 (male) DTE
Host interface RS-232; DB–9 (female) DCE
GPIB (optional)
Eavesdrop RS-232; DB–9 (female) DCE
Indicator Lights Interface RS-232, GPIB
Operating Temperature 0◦C to 40◦C, non-condensing
General Characteristics
Timebase Internal, External Lock, External Fault
Activity 8 slots, Remote SIM,
Aux A, Aux B, Mainframe, Data Send, Data Receive, Data Error
Startup Script Enabled
Power On, Standby, Overload, Trip
Power 90 VAC to 260 VAC, 47 Hz to 63 Hz
150 W max
Weight 12.6 lbs
Dimensions 17.000W × 5.300H × 9.000D
Rack mount O900RM (optional)
SIM900 Mainframe
1 Operation
In This Chapter
This chapter describes the operation of the SIM900 Mainframe.
1.1 Introduction to the Instrument . . . . . . . . . . . . 1 – 2
1.1.1 Front Panel . . . . . . . . . . . . . . . . . . . 1 – 2
1.1.2 Rear Panel . . . . . . . . . . . . . . . . . . . . 1 – 3
1.2 Getting Started . . . . . . . . . . . . . . . . . . . . . 1 – 3
1.3 Timebase . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 4
1.4 Configuration Switches . . . . . . . . . . . . . . . . 1 – 4
1.4.1 Baud Rate/GPIB Address . . . . . . . . . . . 1 – 4
1.4.2 Host Select . . . . . . . . . . . . . . . . . . . . 1 – 5
1.4.3 Clock Distribution Enable . . . . . . . . . . . 1 – 5
1.4.4 Startup Script Enable . . . . . . . . . . . . . . 1 – 6
1.5 Activity Monitors . . . . . . . . . . . . . . . . . . . . 1 – 6
1.6 SIM Interface Connector . . . . . . . . . . . . . . . 1 – 6
1 – 1
1 – 2 Operation
1.1 Introduction to the Instrument
The SIM900 Mainframe is the platform on which a SIM system is assembled. The mainframe provides power, computer interfaces, clock synchronization, and individual module status.
1.1.1 Front Panel
The SIM900 front panel consists of a power switch and a collection of indicator lamps (see Figures 1.1).
Figure 1.1: The SIM900.
Figure 1.2: The SIM900 rear panel (shown with a full complement of SIM modules).
SIM900 Mainframe
1.2 Getting Started 1 – 3
1.1.2 Rear Panel
The SIM900 rear panel is shown in Figure 1.2. In addition to the host interface connector(s) and power entry module, the rear panel contains an external timebase reference input, auxiliary RS-232 inter­faces, and a window for access to SIM module rear panels.
1.2 Getting Started
The SIM architecture does not support hot insertion or extraction of modules. Before installing or removing any SIM modules, the mainframe power must be switched to “Standby.”
To install a module, align the back of the module with the black guide-ramps in the mainframe slot. Ease the module in until the connector begins to mate. Be careful to not apply pressure directly on any module display; it is better to push along the upper part of the edge of the module side covers until a positive “click” is heard. At this time, the module will be fully mated and locked in place.
To remove a module, press firmly on the ejection button below the module slot. When ejecting a double-wide module, the left-hand button must be pressed to eject.
When the arrangement of desired SIM modules is installed, turn on the mainframe power switch to begin operation.
SIM900 Mainframe
1 – 4 Operation
1.3 Timebase
The SIM900 Mainframe provides a common 10 MHz clock reference to the SIM modules. By synchronizing clocks, low-frequency mix­ing products (beat tones) of independently running module clocks is avoided. A common timebase also allows precision time and frequency modules to be synchronized. This feature can be en­abled or disabled using the rear-panel configuration switches (see
section 1.4.3) or with the CLKD remote command.
In a laboratory employing multiple SIM900’s or where a high­precision clock reference is desired, this feature can be extended by synchronizing the mainframe(s) to an external 10 MHz reference. An auto-detect circuit senses the presence of an AC signal at the TIME­BASE IN connector on the rear panel, and attempts to phase-lock the internal oscillator to the applied signal. The TIMEBASE block of the SIM900 front panel (see Figure 1.3) indicates the clock status as one of three states:
Internal 10 MHz : No signal is detected at the timebase input, and the SIM900
internal oscillator is being used.
External Lock : The SIM900 detected an external clock reference and success-
External Fault : An external clock signal was detected, but the SIM900 failed to
The phase-locked loop has a capture range of ±10 ppm (±100 Hz), and should lock reliably with input signals of 1 V to 5 V peak-to­peak amplitude.
1.4 Configuration Switches
The rear panel DIP switches (see Figure 1.3) provide basic configura­tion of the SIM900 Mainframe host interface. The switches selecting the remote interface are read only at power-up time, but may be changed at any time.
1.4.1 Baud Rate/GPIB Address
The rightmost five (5) switches program either the default baud rate for the “COMPUTER” RS-232 port, or the GPIB address.
The RS-232 default baud rate can be set to 1200, 9600, 19.2k, 57.6k, or
115.2k. Select one rate by setting that switch in the down position; if no switch is selected or more than one is down, the SIM900 defaults to 9600 baud and Error lights for several secondsafter power-up. The host baud rate can be changed after power-up under remote program
fully phase-locked to it.
phase-lock to it.
SIM900 Mainframe
1.4 Configuration Switches 1 – 5
control (see the BAUD command), but will revert to the rear-panel
default after power cycling or a Device Clear (RS-232 hbreaki) signal.
For GPIB, the 5 switches set the binary-encoded bus address for the SIM900. To add 2nto the address, set switch An in the lower position.
For example, to set the GPIB address to 19 (= 16 + 2 + 1) set switches A0, A1, and A4 down (on).
1.4.2 Host Select
The next switch to the left of the Rate/Address field (position # 3) selects the mainframe host interface: up selects RS-232, down selects the (optional) GPIB interface.
1.4.3 Clock Distribution Enable
The next switch to theleft of the Host Select field(position #2) controls the mainframe timebase distribution. When this switch is in the on (down) position, the 10 MHz timebase is distributed to all 8 module slots and the rear-panel Remote SIM port on pins 5 & 12. When the switch is in the o(up) position, no clock signals are distributed, and pins 5 & 12 on all SIM ports both idle at 0 V. In either case, all SIM modules will continue to operate properly.
Figure 1.3: The SIM900 front and rear panels.
SIM900 Mainframe
1 – 6 Operation
Note that unlike the other DIP switch settings, the Clock Distribution Enable switch is continuously monitored, and anychanges take eect
immediately (although they can be later overridden with the CLKD
remote command).
1.4.4 Startup Script Enable
The SIM900 has a 4000 byte non-volatile memory to store a se­quence of remotecommands to execute upon power-up (the “Startup Script”). In order for a stored script to execute automatically after power-up, the left-most switch must be in the on (down) position.
When the script is enabled and executed, the front-panel indicator flashes and then remains lit.
See section 2.5.8 for the remote commands to configure the startup script.
1.5 Activity Monitors
The ACTIVITY section of the front panel monitors data transfer to and from the mainframe. When bytes are received from any port, the corresponding port indicator (18, Remote SIM, Aux A (RS-232) or Aux B (RS-232)) flashes together with From SIM. When the main­frame transmits data to the host interface, Mainframe and From SIM both flash as well.
When data is received at the mainframe host interface or transmitted to one of the ports, To SIM flashes, along with the corresponding port indicator.
If a communication error is encountered, Error will flash briefly.
1.6 SIM Interface Connector
The DB–15 SIM Interface connector carries all the power and com­munications lines between the mainframe and SIM modules. The module-side of the interface is DB–15 male (plug), while the main­frame side is DB–15 female (socket). The connector signals are spec­ified in Table 1.1
Note that all SIM modules are specified to operate with or without the presence of the ±REF 10MHZ signals, so these lines are optional in any cabling interface between the mainframe REMOTE SIM port and a module.
SIM900 Mainframe
1.6 SIM Interface Connector 1 – 7
Direction
Pin Signal Src Dest Description
1 SIGNAL GND MF SIM Ground reference for signal 2 STATUS SIM MF Status/service request (GND=asserted, +5V=idle) 3 RTS MF SIM HW Handshake (+5 V=talk; GND=stop) 4 CTS SIM MF HW Handshake (+5 V=talk; GND=stop) 5 REF 10MHZ MF SIM 10 MHz reference 6 5V MF SIM Power supply (fast analog circuitry) 7
15V MF SIM Power supply (analog circuitry) 8 PS RTN MF SIM Power supply return 9 CHASSIS GND Chassis ground
10 TXD MF SIM Async data (start bit=“0”=+5 V; “1”=GND) 11 RXD SIM MF Async data (start bit=“0”=+5 V; “1”=GND) 12 +REF 10MHz MF SIM 10 MHz reference 13 +5V MF SIM Power supply (digital & fast analog circuitry) 14 +15V MF SIM Power supply (analog circuitry) 15 +24V MF SIM Power supply (power circuitry)
SIM900 Mainframe
Table 1.1: SIM Interface connector pin assignments, DB–15
1 – 8 Operation
SIM900 Mainframe
2 Remote Programming
This chapter describes how to control the SIM900 Mainframe, and any connected SIMs or generic RS-232 devices, from a host computer.
In This Chapter
2.1 Index of Commands . . . . . . . . . . . . . . . . . . 2 – 2
2.2 Alphabetic List of Commands . . . . . . . . . . . . 2 – 5
2.3 Introduction . . . . . . . . . . . . . . . . . . . . . . . 2 – 9
2.4 Port Communications . . . . . . . . . . . . . . . . . 2 – 10
2.5 Commands . . . . . . . . . . . . . . . . . . . . . . . 2 – 12
2.6 Register Model . . . . . . . . . . . . . . . . . . . . . 2 – 41
2.3.1 Device Clear . . . . . . . . . . . . . . . . . . . 2 – 9
2.3.2 Queues and buers . . . . . . . . . . . . . . . 2 – 9
2.4.1 Message-based communication . . . . . . . . 2 – 10
2.4.2 Connection-based communication . . . . . . 2 – 10
2.4.3 Port map . . . . . . . . . . . . . . . . . . . . . 2 – 11
2.5.1 Command syntax . . . . . . . . . . . . . . . . 2 – 12
2.5.2 Examples . . . . . . . . . . . . . . . . . . . . 2 – 14
2.5.3 Communication commands . . . . . . . . . . 2 – 15
2.5.4 Configuration commands . . . . . . . . . . . 2 – 17
2.5.5 Eavesdropping commands . . . . . . . . . . 2 – 21
2.5.6 Serial commands . . . . . . . . . . . . . . . . 2 – 22
2.5.7 Status commands . . . . . . . . . . . . . . . . 2 – 24
2.5.8 Script commands . . . . . . . . . . . . . . . . 2 – 28
2.5.9 Housekeeping commands . . . . . . . . . . . 2 – 31
2.5.10 Interface commands . . . . . . . . . . . . . . 2 – 34
2.6.1 Control registers . . . . . . . . . . . . . . . . 2 – 41
2.6.2 Status registers . . . . . . . . . . . . . . . . . 2 – 44
2 – 1
2 – 2 Remote Programming
2.1 Index of Commands
symbol definition
p Port number i,j Integers z Literal token b Multi-byte (string) block
(?) Required for queries; illegal for set commands var Parameter always required
{var} Required parameter for set commands; illegal for queries [var] Optional parameter for both set and query forms
Communications
CONN p,b 2 – 15 Connect to Port SEND p,b [,i] 2 – 15 Send Message to Port SNDT p,b [,i] 2 – 15 Send Terminated Message to Port ECHO? b 2 – 16 Echo Message back to Host BRDC b [,i] 2 – 16 Broadcast Message to Ports BRDT b [,i] 2 – 16 Broadcast Terminated Message to Ports GETN? p,i 2 – 16 Get Bytes from Port RAWN? p,i 2 – 17 Get Raw Bytes from Port
Configuration
NINP? p 2 – 17 Input Bytes Waiting NOUT? p 2 – 17 Output Bytes Waiting AINP? p 2 – 18 Input Spaces Available AOUT? p 2 – 18 Output Spaces Available DONE? [p] 2 – 18 Transmit Complete BRER(?) [p,] {i} 2 – 18 Broadcast Enable RDDR(?) [p,] {i} 2 – 19 Receive Data Disable RPER(?) [p,] {i} 2 – 19 Receive Pass-Through Enable MSGL(?) {i} 2 – 19 Maximum MSG Length TMOT(?) p,{i} 2 – 19 Timeout TERM(?) p,{z} 2 – 20 Message Termination CEOI(?) {z} 2 – 20 Generate EOI on hLFi EOIX(?) {z} 2 – 20 EOI conversion during CONNect
Eavesdropping
VERB(?) [i],{j} 2 – 21 Verbosity EAVS b 2 – 22 Echo Message to Eavesdrop EIDN 2 – 22 Identify to Eavesdrop
Serial Configuration
PRTC(?) {z} 2 – 22 Port C Function PRTD(?) {z} 2 – 23 Port D Function BAUD(?) p {,i} 2 – 23 Baud Rate
SIM900 Mainframe
2.1 Index of Commands 2 – 3
FLOW(?) p {,z} 2 – 23 Flow Control PARI(?) p {,z} 2 – 24 Parity WORD(?) p {,i} 2 – 24 Word Length SBIT(?) p {,i} 2 – 24 Stop Bits
Status
SSCR? [p] 2 – 25 SIM Status Condition SSPT(?) [p,] {i} 2 – 25 SIM Status Positive Transition SSNT(?) [p,] {i} 2 – 25 SIM Status Negative Transition SSEV? [p] 2 – 25 SIM Status Event SSEN(?) [p,] {i} 2 – 25 SIM Status Enable CESR? [p] 2 – 26 Comm Error Status CESE(?) [p,]{i} 2 – 26 Comm Error Status Enable TOSR? [p] 2 – 26 Timeout Status TOSE(?) [p,] {i} 2 – 26 Timeout Status Enable IOSR? [p] 2 – 26 Input Overflow Status IOSE(?) [p,] {i} 2 – 27 Input Overflow Status Enable FCSR? [p] 2 – 27 Flow Control Status FCSE(?) [p,] {i} 2 – 27 Flow Control Status Enable CTCR? [p] 2 – 27 CTS Status Condition CTSR? [p] 2 – 28 CTS Status CTSE(?) [p,] {i} 2 – 28 CTS Status Enable PDPR? [p] 2 – 28 Port Data Pending PDPE(?) [p,] {i} 2 – 28 Port Data Pending Enable
Script
APSS b 2 – 29 Append to Script ATSS b 2 – 29 Append Terminated to Script ERSS 2 – 29 Erase Script LKSS(?) {z} 2 – 29 Lock Script LISS? 2 – 30 List Script NBSS? 2 – 30 Bytes Used in Script AVSS? 2 – 30 Space Available in Script ENSS? 2 – 30 Script Enable RNSS 2 – 30 Run Script
Housekeeping
TBIN? 2 – 31 Timebase Input Detect VTBI? 2 – 31 Timebase Input Analog PLLC(?) {z} 2 – 32 Timebase Control CLKD(?) {z} 2 – 32 Clock Distribution LOCK? 2 – 32 Timebase Status VLOC? 2 – 33 Timebase Status Analog VVCO? 2 – 33 Timebase VCO VMON? 2 – 33 Primary Voltage
SIM900 Mainframe
2 – 4 Remote Programming
IMON? 2 – 33 Primary Current PMON? 2 – 33 Primary Power UNDV? 2 – 34 Undervoltage TICK? 2 – 34 Elapsed Time DIPS? [i] 2 – 34 DIP Switch
Interface
*RST 2 – 35 Reset FLOQ 2 – 35 Flush Output Queue SRST [p] 2 – 35 SIM Reset FLSI [p] 2 – 36 Flush Port Input Buers FLSO [p] 2 – 36 Flush Port Output Queues FLSH [p] 2 – 36 Flush Port Buers *IDN? 2 – 36 Identify *TST? 2 – 36 Self Test *CLS 2 – 36 Clear Status *STB? [i] 2 – 37 Status Byte *SRE(?) [i,] {j} 2 – 37 Service Request Enable *ESR? [i] 2 – 37 Standard Event Status *ESE(?) [i,] {j} 2 – 37 Standard Event Status Enable *PSC(?) {i} 2 – 37 Power-on Status Clear *OPC(?) 2 – 38 Operation Complete *WAI 2 – 38 Wait to Continue CONS(?) {z} 2 – 38 Console Mode WAIT i 2 – 38 Wait REQT(?) {z} 2 – 38 Announce REQT REQF(?) {z} 2 – 39 Announce REQF LEXE? 2 – 39 Execution Error LCME? 2 – 40 Command Error TOKN(?) {z} 2 – 40 Token Mode
SIM900 Mainframe
2.2 Alphabetic List of Commands 2 – 5
2.2 Alphabetic List of Commands
?
*CLS 2 – 36 Clear Status *ESE(?) [i,] {j} 2 – 37 Standard Event Status Enable *ESR? [i] 2 – 37 Standard Event Status *IDN? 2 – 36 Identify *OPC(?) 2 – 38 Operation Complete *PSC(?) {i} 2 – 37 Power-on Status Clear *RST 2 – 35 Reset *SRE(?) [i,] {j} 2 – 37 Service Request Enable *STB? [i] 2 – 37 Status Byte *TST? 2 – 36 Self Test *WAI 2 – 38 Wait to Continue
A
AINP? p 2 – 18 Input Spaces Available AOUT? p 2 – 18 Output Spaces Available APSS b 2 – 29 Append to Script ATSS b 2 – 29 Append Terminated to Script AVSS? 2 – 30 Space Available in Script
B
BAUD(?) p {,i} 2 – 23 Baud Rate BRDC b [,i] 2 – 16 Broadcast Message to Ports BRDT b [,i] 2 – 16 Broadcast Terminated Message to Ports BRER(?) [p,] {i} 2 – 18 Broadcast Enable
C
CEOI(?) {z} 2 – 20 Generate EOI on hLFi CESE(?) [p,]{i} 2 – 26 Comm Error Status Enable CESR? [p] 2 – 26 Comm Error Status CLKD(?) {z} 2 – 32 Clock Distribution CONN p,b 2 – 15 Connect to Port CONS(?) {z} 2 – 38 Console Mode CTCR? [p] 2 – 27 CTS Status Condition CTSE(?) [p,] {i} 2 – 28 CTS Status Enable CTSR? [p] 2 – 28 CTS Status
D
DIPS? [i] 2 – 34 DIP Switch DONE? [p] 2 – 18 Transmit Complete
SIM900 Mainframe
2 – 6 Remote Programming
E
EAVS b 2 – 22 Echo Message to Eavesdrop ECHO? b 2 – 16 Echo Message back to Host EIDN 2 – 22 Identify to Eavesdrop ENSS? 2 – 30 Script Enable EOIX(?) {z} 2 – 20 EOI conversion during CONNect ERSS 2 – 29 Erase Script
F
FCSE(?) [p,] {i} 2 – 27 Flow Control Status Enable FCSR? [p] 2 – 27 Flow Control Status FLOQ 2 – 35 Flush Output Queue FLOW(?) p {,z} 2 – 23 Flow Control FLSH [p] 2 – 36 Flush Port Buers FLSI [p] 2 – 36 Flush Port Input Buers FLSO [p] 2 – 36 Flush Port Output Queues
G
GETN? p,i 2 – 16 Get Bytes from Port
I
IMON? 2 – 33 Primary Current IOSE(?) [p,] {i} 2 – 27 Input Overflow Status Enable IOSR? [p] 2 – 26 Input Overflow Status
L
LCME? 2 – 40 Command Error LEXE? 2 – 39 Execution Error LISS? 2 – 30 List Script LKSS(?) {z} 2 – 29 Lock Script LOCK? 2 – 32 Timebase Status
M
MSGL(?) {i} 2 – 19 Maximum MSG Length
N
NBSS? 2 – 30 Bytes Used in Script NINP? p 2 – 17 Input Bytes Waiting NOUT? p 2 – 17 Output Bytes Waiting
P
PARI(?) p {,z} 2 – 24 Parity PDPE(?) [p,] {i} 2 – 28 Port Data Pending Enable
SIM900 Mainframe
2.2 Alphabetic List of Commands 2 – 7
PDPR? [p] 2 – 28 Port Data Pending PLLC(?) {z} 2 – 32 Timebase Control PMON? 2 – 33 Primary Power PRTC(?) {z} 2 – 22 Port C Function PRTD(?) {z} 2 – 23 Port D Function
R
RAWN? p,i 2 – 17 Get Raw Bytes from Port RDDR(?) [p,] {i} 2 – 19 Receive Data Disable REQF(?) {z} 2 – 39 Announce REQF REQT(?) {z} 2 – 38 Announce REQT RNSS 2 – 30 Run Script RPER(?) [p,] {i} 2 – 19 Receive Pass-Through Enable
S
SBIT(?) p {,i} 2 – 24 Stop Bits SEND p,b [,i] 2 – 15 Send Message to Port SNDT p,b [,i] 2 – 15 Send Terminated Message to Port SRST [p] 2 – 35 SIM Reset SSCR? [p] 2 – 25 SIM Status Condition SSEN(?) [p,] {i} 2 – 25 SIM Status Enable SSEV? [p] 2 – 25 SIM Status Event SSNT(?) [p,] {i} 2 – 25 SIM Status Negative Transition SSPT(?) [p,] {i} 2 – 25 SIM Status Positive Transition
T
TBIN? 2 – 31 Timebase Input Detect TERM(?) p,{z} 2 – 20 Message Termination TICK? 2 – 34 Elapsed Time TMOT(?) p,{i} 2 – 19 Timeout TOKN(?) {z} 2 – 40 Token Mode TOSE(?) [p,] {i} 2 – 26 Timeout Status Enable TOSR? [p] 2 – 26 Timeout Status
U
UNDV? 2 – 34 Undervoltage
V
VERB(?) [i],{j} 2 – 21 Verbosity VLOC? 2 – 33 Timebase Status Analog VMON? 2 – 33 Primary Voltage VTBI? 2 – 31 Timebase Input Analog VVCO? 2 – 33 Timebase VCO
SIM900 Mainframe
2 – 8 Remote Programming
W
WAIT i 2 – 38 Wait WORD(?) p {,i} 2 – 24 Word Length
SIM900 Mainframe
2.3 Introduction 2 – 9
2.3 Introduction
The SIM900 Mainframe provides fully buered multiplexed commu­nications between the host computer and up to 9 SIM modules plus 2 (optionally as many as 4) external RS-232 devices. These SIM/RS­232 connections are generically called Ports here, and each port has a dedicated UART (universal asynchronous receiver & transmitter) with hardware input and output FIFO buers. The host computer (typically a PC) communicates with the mainframe through the host interface, which can be either RS-232 or (optionally) GPIB. The active interface is selected with rear-panel DIP switches at power-on.
No protocol requirements are placed on the communications across the ports—any sequence of bytes can be transmitted to or received from any port. Simultaneous ongoing communications with multi­ple ports can be maintained using a packet-message style of com-
mand (see SEND, BRDC, GETN?, RPER commands below). Sim­ple host-to-port communications are provided with the CONN com-
mand.
2.3.1 Device Clear
2.3.2 Queues and buffers
If the host interface is GPIB, the IEEE–488 DCL (Device Clear) or SDC (Selected Device Clear) interface messages will cause the mainframe to flush the host input buer and output queue, and reset the parser to the idle state.
If the host interface is RS-232, the same action is initiated by theRS-232 hbreaki RS-232 hbreaki signal (space level (0) for at least one full character frame). This single “out-of-band” signal allows the host to reset the mainframe interface to a known state, independent of the current operating mode.
In particular, a Device Clear event (either from DCL, SDC, or RS­232 hbreaki) will cause the mainframe to abandon an active connect
session (see CONN command).
Each port is separately buered with a port input buer and port output queue, while the host interface is buered with the host input buer and host output queue. All queues and buers are 512 bytes deep.
Data is initially received from the host interface into the host input buer. If the mainframe is not currently in connect mode, then bytes from the host input buer are read by the parser until a valid com­mand is found. Command Errors detected by the parser are reported
SIM900 Mainframe
2 – 10 Remote Programming
through the CME flag in the ESR register. Mainframe-directed com­mands and queries are then handled directly, and responses (if any) transferred to the host output queue for the host computer to read.
2.4 Port Communications
2.4.1 Message-based communication
Port-directed messages SEND,SNDT and BRDC,BRDT are parsed
for syntax, and then given to the Message Handler for delivery. The message payload is stripped out of the command, and copied to the appropriate port output queue(s) for delivery. If the port out­put queue is full (because the SIM or external RS-232 device has asserted flow control, or simply because of data rate mismatch), the
mainframe will wait up to TMOT milliseconds until there is su-
cient room in the port output queue for the data. In the meantime, commands and queries from the host will simply accumulate in the input buer until that fills as well. At that point, flow control on the host interface should hold oany further transmissions from the host until the buers clear up.
Data received from the ports is initially stored in the corresponding port input buer. If the corresponding bit in the ReceivePass-through Enable Register (RPER) is set and there is sucient room in the host output queue, then the data is wrapped into a MSG unit and transferred to the output queue for delivery to the host. If the output queue was too full, the message will be sent as soon as sucient space becomes available. If the corresponding bit in RPER is clear, then the corresponding bit in the Port Data Pending Register (PDPR) is set.
2.4.2 Connection-based communication
If the mainframe is connected to a port via the CONN command, the
situation is somewhat dierent. Bytes received from the host accu­mulate in the input buer, where they are scanned for matching the
escape string provided with CONN. Non-matching bytes are directly
transferred to the port output queue. A partial match is held o until an unambiguous complete match or non-match is present. On a successful complete match, the connect mode is terminated and the mainframe is ready for new commands.
Concurrently, bytes received in the port input buer are transferred directly to the host output queue. Data received at the unconnected ports will be held in their port input buers (causing the correspond­ing bit(s) in the PDPR to be set).
SIM900 Mainframe
2.4 Port Communications 2 – 11
2.4.3 Port map
The SIM900 Mainframe ports are defined in the following table:
Port Type Description 1 SIM Slot 1 SIM port 2 SIM Slot 2 SIM port 3 SIM Slot 3 SIM port 4 SIM Slot 4 SIM port 5 SIM Slot 5 SIM port 6 SIM Slot 6 SIM port 7 SIM Slot 7 SIM port 8 SIM Slot 8 SIM port 9 SIM Remote SIM port (DB-15-F back panel connector) A RS-232 Aux–1 DTE (DB–9/M back panel connector) B RS-232 Aux–2 DTE (DB–9/M back panel connector) C RS-232 Eavesdrop DCE (DB–9/F back panel connector) D RS-232 COMM DCE (DB–9/F back panel connector)
Ports 1 through B are always available as user ports, with A & B as generic RS-232 ports. After power-on, ports 1–B default to 9600 baud, 8-bits, no parity, and 1 stop bit.
Port C (Eavesdrop) is normally dedicated to monitoring communi­cations between the mainframe and host, but can be remapped as
an additional general purpose port with the PRTC command. At
power-on, this port defaults to 9600/8/N/1. Baud rate, parity, word size, and stop bits can be reconfigured by command after power­on, regardless of whether Port C is used for eavesdrop or general communications.
Port D (COMM) is normally dedicated as the RS-232 interface to the host computer. At power-on, this port defaults to the baud rate selected by the rear-panel DIP switches, or 9600 if the DIP settings are invalid (8/N/1). If RS-232 is NOT the active host interface, then Port D is normally inactive, but can be remapped as an additional general
purpose port with the PRTD command. Baud rate, parity, word
size, and stop bits can be reconfigured by command after power-on, regardless of whether Port D is used for the host interface or general communications.
When Port C or D are not reconfigured for general port communi­cations, the corresponding PC and/or PD bits in the RPER, BER, and PDPR registers are undefined; they can be written or read, but will have no eect.
SIM900 Mainframe
2 – 12 Remote Programming
2.5 Commands
All commands for the SIM900 Mainframe originate at the host com­puter1, and are sent to the mainframe via the host interface. The commands are organized according to functional groups, beginning with commands that directly control communications with the SIM modules. Other groups of commands configure the mainframe com­munications hardware, status reporting mechanism, startup script, internal housekeeping, and host interface.
2.5.1 Command syntax
All command names are 4-characters long and are case-insensitive.
IEEE–488.2 defined commands begin with the “*” character followed
by 3 letters, while SIM900-specific commands are composed of 4 letters.
The four letter mnemonic (shown in CAPS) in each command se-
quence specifies the command. The rest of the sequence consists of parameters.
Commands may take either set or query form, depending on whether
the “?” character follows the mnemonic. Set only commands are listed without the “?”, query only commands show the “?” after the mnemonic, and optionally query commands are marked with a “(?)”.
Parameters shown in { } and [ ] are not always required. Parameters in { } are required to set a value, and are omitted for queries. Parameters in [ ] are optional in both set and query commands. Parameters listed without any surrounding characters are always required.
Do not send ( ) or { } or [ ] as part of the command.
The command buer is limited to 255 bytes, with multi-byte block pa­rameter bytes separately stored in an independent 255 byte buer— any command that exceeds this size will generate a command error and be discarded.
If the host interface is RS-232, commands are terminated by either hCRi (ASCII 13) or hLFi (ASCII 10) characters that are outside any protected binary block or string. If the host interface is GPIB, then commands are terminated by either hLFi or hEOIi or hLF-EOIi. Exe­cution of the command does not begin until the command terminator is received.
Unlike most SIM modules, nomulti-command messages(i.e., “;” separated commands) are allowed for the SIM900.
1
or from the startup script
SIM900 Mainframe
2.5 Commands 2 – 13
The following table summarizes the notation used in the command descriptions:
symbol definition
p Port number (19, ad, AD, but see below)
i,j Integers
z Literal token
b Multi-byte (string) block
(?) Required for queries; illegal for set commands
var parameter always required
{var} required parameter for set commands; illegal for queries
[var] optional parameter for both set and query forms
2.5.1.1 Ports
Port parameters can be given as either simple decimal integers, or a single-letter hexadecimal value (without any leading 0x).
Many of the commands to set/query a register accept an optional port parameter. In these cases, if the optional parameter p is given, then the command only sets/queries the single bit corresponding to the binary weight 2p. Typically, this bit represents Port p, but in a few cases additional flag bits are packed into the register. For these additional flag bits, the optional p still restricts the command to the single bit, but it no longer corresponds to a port. Thus, it is possible in these cases for p to be E, despite the maximum port value of D.
2.5.1.2 Integers
2.5.1.3 Tokens
SIM900 Mainframe
Integer parameters follow “C-language” style. Simple decimal inte­gers are indicated by beginning with a non-zero digit (19). Octal integers are represented with a leading zero digit (0). Hexadecimal integers are given by a leading 0x or 0X.
For example, 26, 032, 0x1A all refer to the integer value 26.
Tokens are listed here as word–integer pairs, such as AUTO 2. For set commands, token parameters must either be the exact text word indicated (case-insensitive), or the corresponding decimal integer code. For example, to set the response termination sequence to hCRi+hLFi, the following two commands are equivalent:
TERM CRLF —or— TERM 3
2 – 14 Remote Programming
For queries that return token values, the return format (keyword or
integer) is specified with the TOKN command.
2.5.1.4 Blocks
Multi-byte block parameters can follow one of 3 formats (4 on GPIB).
Quote-delimited strings : An arbitrary byte sequence bounded by either " or charac-
ters. All characters (including control characters) are allowed. The quoting character itself (either " or ) can be included by escaping with an additional quote. For example,
"It is a ""good"" quote"
is identical to
’It is a "good" quote’.
Hex-formatted binary : #Hxx xx xx, where xx are hexadecimal bytes (00 through ).
Whitespace is ignored.
Definite-length arb. : #abbbrrrr, where a is a single non-zero digit equal to the digit
count in bbb, bbb is a decimal integer count of the number of data bytes to follow, and rrrr are the raw data bytes.
Indefinite-length arb. : #0rrrrhLF-EOIi, where rrrr is the raw data block, and
2.5.2 Examples
hLF-EOIi is the newline character (ASCII 10) with the GPIB-EOI line simultaneously asserted. (only on GPIB)
Each command is provided with a simple example illustrating its usage. In these examples, all data sent by the host computer to the SIM900 are set as straight teletype font, while responses received the host computer from the SIM900 are set as slanted teletype font. Command terminators explicitly sent by the host
computer are set with the symbol “”.
The usage examples vary with respect to set/query, optional param­eters, and block parameter formats. These examples are not exhaus­tive, but are intended to provide a convenient starting point for user programming.
SIM900 Mainframe
2.5 Commands 2 – 15
2.5.3 Communication commands
These commands provide the actual communication, through the SIM900 mainframe, between the host computer and the SIM modules or external RS-232 devices. Stream-style communications is provided with the CONN command, while packet messaging is supported with the remainder of the commands in this section.
Connect to PortCONN p,b The CONN command establishes a stream-style connection to Port p,
with escape string b.
Executing the CONN command automatically clears the RPER regis-
ter.
In the following, a SIM910 preamp is installed in slot 4 of the SIM900.Example:
CONN 4,"xyz" IDN?
Stanford Research Systems,SIM910,s/n510998,ver1.0
xyz*IDN?
Stanford Research Systems,SIM900,s/n938272,ver3.4
Send Message to PortSEND p,b [,i] The SEND command transfers the message b to Port p. If present, i
contains a checksum for b.
The optional checksum is calculated as the unsigned integer sum of the ASCII value of each byte in b (excluding wrapping characters such as #H).
SEND 4,"GAIN 10"Example:
Notice the(either hCRi or hLFi) before the closing quote mark; this is the command terminator for the destination SIM instrument
located at slot 4. See SNDT(below) to have the SIM900 automatically
append the command terminator to outgoing messages to ports.
Send Terminated Message to PortSNDT p,b [,i] The SNDTcommand transfers the message b followed by the htermi
sequence to Port p. If present, i contains the checksum value for b
(see SEND). See the TERM command for more about the htermi sequence.
SNDT 4,"GAIN 10"Example:
SIM900 Mainframe
2 – 16 Remote Programming
Echo Message back to HostECHO? b The ECHO command transfers the message b+htermi back to the
host output queue.
Note this command does not control character echoing back to a
console terminal; see the CONS (console) command.
ECHO? "Hello ""world."""Example:
Hello "world."
Broadcast Message to PortsBRDC b [,i] The BRDC command transfers the message b to multiple ports. If
present, i is the checksum on b .
BRDCacts just like SEND, except instead of indicating a specific port
in the command, all ports enabled in the BRER register receive a copy of the message b.
BRDC "*RST"Example:
Broadcast Terminated Message to PortsBRDT b [,i] The BRDT command transfers the message b+htermi to multiple
ports. If present, i is the checksum on b.
BRDT #14*RSTExample:
Note the use of a definite-length arbitrary block (see section 2.5.1.4).
Get Bytes from PortGETN? p,i The GETN command retrieves up to i bytes from Port p and transfers
them to the host output queue.
Data is formatted as a definite-length arbitrary block, #3aaabbbbbb, where aaa = number of bytes actually retrieved from Port p. Re­sponse message may be up to 7 bytes longer than i, for the #3aaa header + htermi.
SNDT 7,"GAIN?"Example: GETN? 7,80
#300410
where the query response from Port 7 was “10”, and the response terminatorwas the two character sequence hCRi+hLFi.
SIM900 Mainframe
2.5 Commands 2 – 17
Get Raw Bytes from PortRAWN? p,i The RAWNcommand retrieves exactly i bytes from Port p and trans-
fers them to the host output queue.
No header or htermi characters are added. If fewer than i bytes are available, no bytes are transferred and the EXE flag is set within the ESR register.
SNDT 7,"GAIN?"Example: RAWN? 7,2
10
2.5.4 Configuration commands
The first five Configuration commands query the current state of the port I/O buers, while the remaining commands are used to set or query registers and other parameters controlling communications with the SIMs.
See the Register Model section for more about the mainframe regis­ters.
Input Bytes WaitingNINP? p
Query bytes waiting in Port p input buer. Returns the integer number of bytes waiting to be read by the host.
NINP? 4Example:
30
Output Bytes WaitingNOUT? p
Query bytes waiting in Port p output queue. Returns the integer number of bytes waiting to be transmitted to the SIM or RS-232 device.
NOUT? 4Example:
0
SIM900 Mainframe
2 – 18 Remote Programming
Input Spaces AvailableAINP? p
Query spaces available in Port p input buer. Returns the integer number of additional bytes that can be written by the host before overflowing the port input buer.
AINP? 4Example:
482
Output Spaces AvailableAOUT? p
Query spaces available in Port p output queue. Returns the integer number of additional bytes that can be written by the SIM or RS-232 device before overflowing the port output queue.
AINP? 4Example:
512
Transmit CompleteDONE? [p] DONE? returns 1 if there are no bytes remaining to be transferred,
and 0 if any bytes remain in either port output buers or in the UART output FIFO buers.
If p is given, only the buers for Port p are checked; otherwise all port buers are checked.
DONE?Example:
1
Broadcast EnableBRER(?) [p,] {i}
Set (query) the Broadcast Enable Register [Port p bit] {to i}. The Broad­cast Enable Register (BER) selects which ports will receive broadcast
messages via the BRDC and BRDT commands. If p is given, only
the bit corresponding to Port p is set (queried); otherwise the entire register is indicated.
BRER 4,1Example: BRER 5,1 BRER 7,1 BRER?
176
SIM900 Mainframe
2.5 Commands 2 – 19
Receive Data DisableRDDR(?) [p,] {i}
Set (query) the Receive Data Disable Register [Port p bit] {to i}. Bits within the Receive Data Disable Register (RDDR) are used to inhibit the serial receiver circuitry for the corresponding ports. If p is given, only the bit corresponding to Port p is set (queried); otherwise the entire register is indicated.
RDDR 6Example:
disables Ports 1 & 2 (binary weights 21+ 22= 6).
Receive Pass-Through EnableRPER(?) [p,] {i}
Set (query) Receive Pass-Through Enable Register [Port p bit] {to i}. Bits within the Receive Pass-Through Enable Register (RPER) are used to enable spontaneous delivery of port data messages to the host output queue as MSG packets. If p is given, only the bit corresponding to Port p is set (queried); otherwise the entire register is indicated.
RPER 510Example:
enables Ports 1–8 for Pass-Through.
Maximum MSG LengthMSGL(?) {i}
Set (query) the maximum overall MSG length to i bytes. The data portion of MSG packets will have 10 or 11 fewer bytes than the maximum data block length i, corresponding to the characters MSG p,#2yy or MSG p,#3yyy that precede the data block. The command terminator (either hCRihLFi or hLF-EOIi) is not included in i.
After reset, the default is MSGL 64. The maximum value is 128.
MSGL 128Example:
TimeoutTMOT(?) p,{i} Set (query) the timeout value for Port p {to i milliseconds}. If TMOT
is non-zero, the mainframe will wait up to i milliseconds while at­tempting to transfer output to a port output queue that is full (either due to flow control or simple transfer-rate mismatch). If the timeout expires before the mainframe is able to transfer the message, an error is recorded in the Timeout Status Register (TOSR).
If TMOT p,0, the timeout feature is disabled for Port p, and the
mainframe will wait indefinitely on a full output queue.
SIM900 Mainframe
After reset, the default is TMOT1000 (1 s) for all ports.
TMOT 4,500Example:
2 – 20 Remote Programming
Message TerminationTERM(?) p,{z}
Set (query) the htermi sequence for Port p {to z=CR 0, LF 1, CRLF 2, LFCR 3, NONE 4}.
The htermi sequence is appended to port messages sent with the
SNDT or BRDT commands, and is constructed of ASCII charac-
ter(s) 13 (carriage return) and 10 (line feed). The token mnemonic gives the sequence of characters. When the host interface is RS-232,
then TERM D (the host port) also determines the termination for
all mainframe-generated query responses (for GPIB host interface, query responses always terminate in hLF-EOIi).
At power-on, ports default to TERM p,LF. After *RST, ports are reset to TERM p,CR. When the host interface is RS-232, Port D defaults to
TERM D,CRLF both at power-on and *RST.
TERM 4,LFExample:
Generate EOI on hLFiCEOI(?) {z}
Set (query) the connect-mode EOI-on-hLFi {to z=(OFF 0, ON 1)}.
CEOIcontrols whether the hEOIi signal is generated on the GPIB host
interface whenever a hLFi character is received from a port during connect mode. This command has no eect when the host interface is RS-232. Set z to ON to enable hEOIi generation.
After reset, the default is CEOI ON.
CEOI ONExample:
EOI conversion during CONNectEOIX(?) {z}
Set (query) the EOI-conversion-mode {to z=(OFF 0, ON 1)}.
In connect mode, EOIX controls whether the receipt of the hEOIi
signal from the GPIB host interface causes a new hLFi character to transmitted to the connected port. This command has no eect when the host interface is RS-232. Set z to ON to enable hLFi generation.
After reset, the default is EOIX ON.
EOIX OFFExample:
This default setting changed with firmware revision 3 (February 2005).
SIM900 Mainframe
2.5 Commands 2 – 21
2.5.5 Eavesdropping commands
By default, Port C is an eavesdropping monitor port. This port can be configured to provide real-time monitoring of communications and internal state changes in the SIM900 Mainframe, and is intended to help users build and debug their SIM applications.
VerbosityVERB(?) [i],{j}
Set (query) the eavesdropping verbosity control [bit i] {to j}.
The verbosity control is an 8-bit register providing on/ocontrol of separate eavesdropping monitor functions. The bit definitions are:
Weight Bit Flag
1 0 MFERRORS 2 1 LONGERRS 4 2 IOMON
8 3 MFMON 16 4 STATMON 32 5 FROMHOST 64 6 TOHOST
128 7 RTMON
MFERRORS : Error conditions in the mainframe will be reported.
LONGERRS : The long-form (English text) of error messages will be used.
This flag is only functional if MFERRORS is also set.
IOMON : I/O status messages (device-clear, buer overrun, . . . ) will be
reported.
MFMON : Internal state changes in the mainframe (such as timebase set-
tings) will be reported. Also, if MFMON is set, any bytes sent to Port C will be interpreted as though sent by the mainframe, and processed as remote commands.
STATMON : Any (enabled) status register changes will be reported.
FROMHOST : All data received by the mainframe from the host interface is
echoed to Port C.
TOHOST : All data sent by the mainframe to the host interface is echoed
to Port C.
RTMON : A summary message of mainframe housekeeping data is re-
ported once a second. The message is formatted as:
<vtbi=#, vloc=#, vvoc=#; vmon=#, imon=#>
where the value of each field corresponds with the query com-
mand of the same name (i.e., see VTBI?, VLOC?, . . . ).
SIM900 Mainframe
2 – 22 Remote Programming
After reset, the default is VERB 5 (MFERRORS and IOMON).
VERB 127Example:
Echo Message to EavesdropEAVS b
Send message b to the eavesdrop port.
EAVS "This text will appear on the Eavesdrop port"Example:
Identify to EavesdropEIDN Send the identify message (see *IDN) to the eavesdrop port.
EIDNExample:
2.5.6 Serial commands
The Serial commands control the configuration of the serial port hardware in the SIM900 Mainframe, such as baud rate and parity. Optional re-mapping of Port C and Port D is also provided with the
PRTC and PRTDcommands.
Port C FunctionPRTC(?) {z}
Set (query) Port C function {to z=(EAVS 0, PORT 1)}.
Ordinarily, Port C is dedicated to eavesdropping on communications
with the host computer. Using PRTC, it is possible to override this
function and make Port C available as a general purpose RS-232 port.
WithPRTCPORT, general communications with Port C are performed using CONN, SEND, BRDC, etc., just as with other ports.
Set z to EAVS (0) for the default eavesdropping function, or PORT (1) for the general purpose port.
After reset, the default is PRTC EAVS.
PRTC?Example:
EAVS
SIM900 Mainframe
2.5 Commands 2 – 23
Port D FunctionPRTD(?) {z}
Set (query) Port D function {to z=(COMM 0, PORT 1)}.
Ordinarily, Port D is dedicated to communications with the host computer (when configured for host RS-232). If the host interface is GPIB, Port D is normally idle. Using the PRTD command with the GPIB interface, it is possible to make Port D available as a general purpose RS-232 port.
Set z to COMM 0 for the default host function, or PORT 1 for the general
purpose port. Note that PRTD PORT will generate an execution error
if the host interface is RS-232.
After reset, the default is PRTD COMM.
PRTD PORTExample:
Baud RateBAUD(?) p {,i}
Set (query) Port p baud rate {to i}.
At power-on, all baud rates default to 9600. The minimum baud rate for all ports is 110 baud. For Ports 1–9 (SIM ports), rates can be set to standard values through 38 400; above that, most modules can be set to the following (non-standard) rates: 62 500, 78 125, 104 167, and 156 250. For Ports A–D (RS-232 ports), high-speed standard rates of 57 600, 115 200, 230 400, and 460 800 are all available.
Changing baud rate must be carefully orchestrated to ensure proper connectivity throughout the transaction.
SNDT 4,’BAUD 62500’Example: BAUD 4,62500 SNDT 4,’*IDN?’ GETN? 4,80
#3053Stanford Research Systems,SIM923A,s/n003982,ver1.25
Flow ControlFLOW(?) p {,z}
Set (query) Port p flow control {to z=(NONE 0, RTS 1, XON 2)}.
At power-on, all ports default to FLOW RTS flow control.
FLOW 4,0Example:
SIM900 Mainframe
2 – 24 Remote Programming
ParityPARI(?) p {,z}
Set (query) Port p parity {to z = (NONE 0, ODD 1, EVEN 2, MARK 3, SPACE 4)}.
At power-on, all ports default to PARI NONE.
PARI A,EVENExample:
Word LengthWORD(?) p {,i}
Set(query) Port p word length {to i bits (5, 6, 7, or 8)}.
WORD sets the RS-232 word length to 5–8 bits. The set command
is only valid for Ports A–D, and will generate an execution error if p<A.
At power-on, all ports default to WORD 8.
WORD B,7Example:
2.5.7 Status commands
Stop BitsSBIT(?) p {,i}
Set(query) Port p stop bits {to i bits (1, or 2)}.
SBIT selects 1 or 2 stop bits for the RS-232 ports. The set command
is only valid for Ports A–D, and will generate an execution error if p<A.
If WORD 5 (5-bit word length) is set, then SBIT 2 corresponds to 1.5
stop bits.
At power-on, all ports default to SBIT 1.
SBIT B,2Example:
The Status commands query and configure registers associated with status reporting of SIMs and the mainframe.
See section 2.6.2 for more about the mainframe status registers.
SIM900 Mainframe
2.5 Commands 2 – 25
SIM Status ConditionSSCR? [p]
Query SIM Status Condition Register [for Port p bit].
SSCR? returns the present value of the STATUS signal.
SSCR?Example:
16
SIM Status Positive TransitionSSPT(?) [p,] {i}
Set (query) SIM Status Positive Transition Register [Port p] {to i }.
SSPT 4,1Example:
SIM Status Negative TransitionSSNT(?) [p,] {i}
Set (query) SIM Status Negative Transition Register [Port p] {to i }.
SSPT and SSNT together define the enabled events (positive and
negative transitions, respectively) that generate SIM Status Events.
At power-on, SSPT and SSNT are both cleared.
SSPT?Example:
16
SIM Status EventSSEV? [p]
Query SIM Status Event Register [for Port p bit].
Upon executing an SSEV? query, the returned bit(s) of the SSEV
register are cleared.
SSEV?Example:
16
SIM Status EnableSSEN(?) [p,] {i}
Set(query) SIM Status Enable Register [for Port p bit] {to i}.
SSEV 4,1Example:
SIM900 Mainframe
2 – 26 Remote Programming
Comm Error StatusCESR? [p]
Query Comm Error Status Register [for Port p bit].
Upon executing a CESR?query, the returned bit(s) of the CESR reg-
ister are cleared, with the exception of the TOSB bit (see the Register Model section for details).
CESR?Example:
144
This corresponds to errors at Ports 4 & 7 (24+ 27= 144).
Comm Error Status EnableCESE(?) [p,]{i}
Set (query) Comm Error Status Enable Register [for Port p bit] {to i}
CESE 4,1Example:
Timeout StatusTOSR? [p]
Query Timeout Status Register [for Port p bit].
Upon executing a TOSR? query, the returned bit(s) of the TOSR
register are cleared.
TOSR?Example:
0
Timeout Status EnableTOSE(?) [p,] {i}
Set (query) Timeout Status Enable Register [for Port p bit] {to i}.
TOSE 4,1Example:
Input Overflow StatusIOSR? [p]
Query input Overflow Status Register [for Port p bit].
Upon executing a IOSR? query, the returned bit(s) of the IOSR reg-
ister are cleared.
IOSR?Example:
128
SIM900 Mainframe
2.5 Commands 2 – 27
Input Overflow Status EnableIOSE(?) [p,] {i}
Set (query) input Overflow Status Enable Register [for Port p bit] {to i}.
IOSE 7,1Example:
Flow Control StatusFCSR? [p]
Query Flow Control Status Register value [for Port p bit].
Upon executing a FCSR? query, the returned bit(s) of the FCSR reg-
ister are cleared, with the exception of the CTSB bit (see the Register Model section for details).
FCSR?Example:
0
Flow Control Status EnableFCSE(?) [p,] {i}
Set (query) Flow Control Status Enable Register [Port p bit] {to i}.
FCSE 7,1Example:
CTS Status ConditionCTCR? [p]
Query CTS Status Condition Register [for Port p bit].
CTCR? returns the present value of the CTS signal [from Port p].
Note that for Ports 1–9 (the SIM ports), a passive pull-down resistor
in the SIM900 causes CTCR? to always return 0 for unconnected
ports. A connected SIM module will normally drive the CTS line
high. This permits the use of CTCR?as a “module-present” detector
(see section 2.6.2.17).
This usage is not applicable to Ports A–D (the RS-232 ports), where
the passive termination is a pull-up resistor. This causes CTCR? to
always return 1 for Ports A–D except when hardware flow control is being asserted by the remote device.
CTCR?Example:
15376
This shows a module on Port 4 (24+ 210+ 211+ 212+ 213= 15376).
SIM900 Mainframe
2 – 28 Remote Programming
CTS StatusCTSR? [p]
Query CTS Status Register [for Port p bit].
Upon executing a CTSR? query, the returned bit(s) of the CTSR
register are cleared.
CTSR?Example:
0
CTS Status EnableCTSE(?) [p,] {i}
Set (query) CTS Status Enable Register [for Port p bit] {to i}.
CTSE 4,1Example:
Port Data PendingPDPR? [p]
Query Port Data Pending Register value [for Port p bit].
2.5.8 Script commands
Upon executing a PDPR? query, the returned bit(s) of the PDPR
register are cleared.
PDPR?Example:
0
Port Data Pending EnablePDPE(?) [p,] {i}
Set (query) Port Data Pending Enable Register [bit for Port p] {to i}.
PDPE 4,1Example:
The Startup Script is a non-volatile block of memory that stores a series of commands for optional execution by the mainframe upon
power-on. Any legal mainframe command, except for APSS, ATSS, ERSS, LKSS, and RNSS, can be included within the Startup Script.
Automatic execution of the Startup Script on power-on is controlled by the Startup Script Enable dip switch, on the rear panel of the mainframe.
SIM900 Mainframe
2.5 Commands 2 – 29
Append to ScriptAPSS b
Append block b to Startup Script macro.
This command can only be executed after LKSS OFF.
LKSS OFFExample: APSS "BRER 510 RPER 510
BRDT ’*IDN?’ WAIT 1000
RPER 0"
This example adds a script to identify modules in Ports 1–8.
Append Terminated to ScriptATSS b
Append block b+hLFi to Startup Script macro.
This command can only be executed after LKSS OFF.
ATSS "*IDN?"Example:
Erase ScriptERSS
Erase Startup Script macro.
This command can only be executed after LKSS OFF.
ERSSExample:
Lock ScriptLKSS(?) {z}
Set (query) Startup Script write/erase lockout {to z=(OFF 0, ON 1)}.
After LKSS ON has been executed, the Startup Script is protected
against any modification or erasure. To reprogram the Startup Script,
issue LKSS OFF. After reset, the default is LKSS ON.
LKSS?Example:
ON
SIM900 Mainframe
2 – 30 Remote Programming
List ScriptLISS?
List Startup Script contents.
LISS?Example:
BRER 510 RPER 510 BRDT ’*IDN?’ WAIT 1000 RPER 0 IDN?
Bytes Used in ScriptNBSS?
Query number of bytes used in Startup Script macro.
NBSS?Example:
60
Space Available in ScriptAVSS?
Query number of spaces available in Startup Script memory.
AVSS?Example:
3968
Script EnableENSS?
Query Startup Script Enable token value (ON 1, OFF 0) from rear­panel DIP switch.
ENSS?Example:
OFF
Run ScriptRNSS
Run Startup Script now (independent of DIP switch setting).
RNSSExample:
MSG 4,#253Stanford Research Systems,SIM923A,s/n003982,ver1.25 Stanford Research Systems,SIM900,s/n000112,ver3.4
SIM900 Mainframe
2.5 Commands 2 – 31
0
2000
4000
6000
8000
10000
12000
0 250 500 750 1000 1250 1500 1750
10 MHz input (mV pp)
VTBI? (mV)
2.5.9 Housekeeping commands
The Housekeeping commands provide status information on the SIM900 Mainframe hardware, such as the 10 MHz timebase and the total power consumption.
Timebase Input DetectTBIN?
Query external Timebase Input detected token (TRUE 1, FALSE 0).
TBIN?Example:
FALSE
Timebase Input AnalogVTBI?
Query external Timebase Input detection circuit voltage, in milli­volts. The detection circuit is a non-linear AC-detector, see plot for the typical response versus 10 MHz input amplitude. Note that the
threshold for automatic detection is VTBI=2000 (see TBIN?, above).
SIM900 Mainframe
VTBI?Example:
390
2 – 32 Remote Programming
Timebase ControlPLLC(?) {z}
Set (query) Timebase PLL Control {to z=(OFF 0, ON 1, AUTO 2)}.
When PLLC AUTO is set, the SIM900 Mainframe will automatically ac­tivate the timebase phase-locked loop (PLL) whenever TBIN? TRUE.
To force the PLL to remain either o(free-running clock) or on (al-
ways attempting to lock), set PLLC appropriately.
PLLC?Example:
AUTO
Clock DistributionCLKD(?) {z}
Set (query) the Clock Distribution mode {to z=(OFF 0, ON 1}.
When CLKD ON is set, the SIM900 Mainframe will distribute the
10 MHz timebase signals to all SIM ports (on pins 5 & 12 of the DB–
15 SIM Interface connector. When CLKDOFF, the timebase signals are
turned o, and clock pins idle at 0 V (note, however, that the internal oscillators in the SIM modules will continue to operate normally).
At reset, the value of CLKD is determined by the rear panel DIP setting. Subsequent CLKD set commands will override the rear panel
setting. Any changes to the rearpanel setting, however, will takeeect immediately.
CLDK OFFExample:
Timebase StatusLOCK?
Query Timebase status token value (FREE 0, LOCKING 1, LOCKED 2, FAULT 3).
While the PLL is o, LOCK? returns FREE. For 50 ms after activat­ing the PLL, LOCK? will return LOCKING; after that, either LOCKED or
FAULT is returned, indicating whether the loop is successfully track­ing the external timebase input.
LOCK?Example:
FREE
SIM900 Mainframe
2.5 Commands 2 – 33
Timebase Status AnalogVLOC? Query lock detector voltage, in millivolts. When VLOC?4000, the
PLL is locked (see LOCK?, above).
VLOC?Example:
940
Timebase VCOVVCO?
Query the VCO control voltage, in millivolts.
VVCO?Example:
4490
Primary VoltageVMON?
Query the SIM900 Mainframe primary power supply voltage, in millivolts (nominally 24000).
VMON?Example:
23740
Primary CurrentIMON?
Query the SIM900 Mainframe primary power supply current, in milliamps.
IMON?Example:
430
Primary PowerPMON?
Query the SIM900 Mainframe primary power supply power, in mil-
liwatts. Equal to (VMON?)×(IMON?)/1000.
PMON?Example:
10683
SIM900 Mainframe
2 – 34 Remote Programming
UndervoltageUNDV?
Query output undervoltage detect.
While an output undervoltage condition exists, UNDV? returns
1; otherwise it returns 0. An undervoltage occurs if any of the SIM900 Mainframe output voltages droop below their nominal value, indicating an overload.
UNDV?Example:
0
Elapsed TimeTICK?
Query time elapsed since power-on (each count is 50 ms). The max­imum value before wrap-around is 4 294 967 295 (about 6.8 years).
TICK?Example:
114888
2.5.10 Interface commands
DIP SwitchDIPS? [i]
Query rear panel dip switch [bit i] value.
DIPS?Example:
64
The interface commands include required IEEE–488.2 common com­mands, along with additional commands for configuring the inter­face between the SIM900 Mainframe and the host computer. Addi­tionally, commands for flushing the port input buers and output queues are also provided.
SIM900 Mainframe
2.5 Commands 2 – 35
Reset*RST
Reset the mainframe to default configuration.
The following register and command values are established imme-
diately following a *RST:
cmd value
BRER 0 RDDR 0 RPER 0
TERM TMOT MSGL 64 CEOI 1 ON EOIX 1 ON PRTC 0 EAVS PRTD 0 COMM PLLC 2 AUTO CLKD determined by rear-panel setting CONS 0 OFF VERB 5(MFERRORS and IOMON) TOKN 0 OFF LKSS 1 ON REQT 0 OFF REQF 0 OFF
0
1000
TERM and TMOT are reset for all ports
*RSTExample:
Flush Output QueueFLOQ
Flush the host output queue.
FLOQExample:
SIM ResetSRST [p]
Sends the SIM Reset signal [to Port p] (default is all SIM ports).
SRST causes a hbreaki signal (MARK level) to be asserted for 100
milliseconds, either to Port p or to all SIM ports. Upon receiving the hbreaki signal, any connected SIM will flush its internal input buer, reset its command parser, and default to 9600 baud communications.
SRSTExample:
SIM900 Mainframe
2 – 36 Remote Programming
Flush Port Input BuersFLSI [p]
Flushes port input buers [associated with Port p].
FLSI 4Example:
Flush Port Output QueuesFLSO [p]
Flushes port output queues [associated with Port p].
FLSO 4Example:
Flush Port BuersFLSH [p]
Flushes port input buers & output queues [associated with Port p].
FLSHExample:
Identify*IDN?
Read the mainframe device identification string.
The identification string is formatted as:
Stanford Research Systems,SIM900,s/n******,ver#.#
where ****** is the 6-digit serial number, and #.# is the firmware revision level.
*IDN?Example:
Stanford Research Systems,SIM900,s/n000112,ver3.4
Self Test*TST?
Perform mainframe self-test (currently no-op, returns 0).
*TST?Example:
0
Clear Status*CLS *CLS immediately clears the SSEV, ESR, CESR, FCSR, PDPR, TOSR,
IOSR, and CTSR registers.
*CLSExample:
SIM900 Mainframe
2.5 Commands 2 – 37
Status Byte*STB? [i]
Reads the serial poll Status Byte register [bit i].
*STB?Example:
16
Service Request Enable*SRE(?) [i,] {j}
Set (query) the Service Request Enable register [bit i] {to j}.
*SRE 0,1Example: SRE?
1
Standard Event Status*ESR? [i]
Reads the Standard Event Status Register [bit i].
Upon executing *ESR?, the returned bit(s) of the ESR register are
cleared.
*ESR?Example:
32
Standard Event Status Enable*ESE(?) [i,] {j}
Set (query) the Standard Event Status Enable Register [bit i] {to j}.
*ESE 32Example:
Power-on Status Clear*PSC(?) {i}
Set (query) the Power-on Status Clear flag {to j}. The Power-on Status Clear flag is stored in non-volatile memory in the SIM900 Mainframe, and thus maintains its value through power-cycle events.
If the *PSC=0, then the Service Request Enable and Standard Event Status Enable registers (*SRE, *ESE) retain their values through power-cycles. If *PSC=1, then *SRE and *ESE are cleared upon
power-cycle.
The initial factory default is *PSC 1.
*PSC?Example:
1
SIM900 Mainframe
2 – 38 Remote Programming
Operation Complete*OPC(?)
Operation Complete. Sets the OPC flag in the ESR register.
The query form *OPC?writesa 1 in theoutput queuewhen complete,
but does not aect the ESR register.
*OPC?Example:
1
Wait to Continue*WAI
Wait to Continue. Equivalent to a no-op.
*WAIExample:
Console ModeCONS(?) {z}
Set (query) the host port Console mode {to z=(OFF 0, ON 1)}.
CONS only has an eect when host interface is RS-232, and causes
each character received at the host input buer to be copied to the host output queue.
After reset, the default is CONS OFF.
CONS?Example:
OFF
WaitWAIT i
Wait i milliseconds before processing more commands from the host.
This command can be especially useful programming the Startup Script.
WAIT 1000Example:
Announce REQTREQT(?) {z}
Set (query) the REQT announce mode {to z=(OFF 0, ON 1)}.
When REQT ON is set, any event which causes a new service re-
quest condition will cause the characters <reqt>+htermi to be spon­taneously written to the host output buer.
On reset, the default is REQT OFF.
SIM900 Mainframe
2.5 Commands 2 – 39
REQT?Example:
OFF
Announce REQFREQF(?) {z}
Set (query) the REQF announce mode {to z=(OFF 0, ON 1)}.
When REQF ON is set, any event which causes the Master Sum-
mary Status message to become false will cause the characters <reqf>+htermi to be spontaneously written to the host output buer.
After reset, the default is REQF OFF.
REQF?Example:
OFF
Execution ErrorLEXE?
Query the last Execution Error code. Valid codes are:
Value Definition
0 No execution error since power-on 1 Invalid port 2 Invalid token 3 Command failed 4 Timeout 5 Invalid bit 6 Invalid value 7 Checksum failed 8 Invalid host interface
SIM900 Mainframe
*STB? 12Example: LEXE?
5
The error code (5) corresponds to “Invalid bit,” since *STB? only
allows bit-specific queries of 0–7.
2 – 40 Remote Programming
Command ErrorLCME?
Query the last Command Error code. Valid codes are:
Value Definition
0 No parser error since power-on 1 Illegal first character 2 Illegal name 3 Undefined command 4 Extra questio mark 5 No query allowed 6 Only query allowed 7 Missing parameter(s) 8 No parameters allowed
9 Premature command terminator 10 Message buer overflow 11 Illegal half-byte in hex parameter 12 Command buer overflow 13 Illegal extra string parameter 14 Illegal extra hex parameter 15 Illegal extra binary parameter 16 Illegal byte-digits count 17 Illegal bytes count 18 Null parameter 19 Extra parameter(s) 20 Illegal port 21 Illegal short integer 22 Illegal long integer 23 Illegal token integer 24 Unknown token 25 Illegal string parameter 26 Illegal hex parameter 27 Illegal binary parameter 28 hEOIi without hLFi on indef. arb. block
*IDNExample: LCME?
6
The error (6, “Only query allowed”) is due to the missing “?”.
Token ModeTOKN(?) {z}
Set (query) the Token Query mode {to z=(OFF 0, ON 1)}.
If TOKN ON is set, then queries to the SIM900 mainframe that return
tokens will return the text keyword; otherwise they will return the decimal integer value.
After reset, the default is TOKNOFF.
TOKN ONExample:
SIM900 Mainframe
2.6 Register Model 2 – 41
2.6 Register Model
Registers in the SIM900 Mainframe are divided into 2 broad cate­gories: control registers and status registers. Control registers gov­ern the operation of the mainframe (specifically, controlling the au­tomatic routing of port data), while status registers (and their asso­ciated configuration registers) govern the monitoring and reporting of status conditions within the mainframe.
The registers are represented as either 8-bit or 16-bit unsigned integer values. Individual flags within a register correspond to an integer weight of 2n. Most commands for setting or reading the registers have an optional parameter to select a single bit within the register. Using this optional parameter, all flag values are either 0 or 1. In the default (whole-register) form, the commands treat the register as a single integer value by summing the weighted values of the individual flags.
2.6.1 Control registers
2.6.1.1 Receive Data Disable (RDDR)
This is a 16-bit wide register that controls transfers of data from the ports to the port input buers.
Weight Bit Flag
1 0 undef (0) 2 1 P1-disable 4 2 P2-disable
8 3 P3-disable 16 4 P4-disable 32 5 P5-disable 64 6 P6-disable
128 7 P7-disable 256 8 P8-disable
512 9 P9-disable 1024 10 PA-disable 2048 11 PB-disable 4096 12 PC-disable 8192 13 PD-disable
16384 14 undef (0) 32768 15 undef (0)
If the bit corresponding to a particular port is set in the RDDR, and data from that port arrives at the mainframe, it is immediately discarded. If the corresponding bit is cleared, then data flows as normal from the port hardware into the port input buer.
SIM900 Mainframe
If a bit is set in RDDR while data is already in the corresponding port input buer, that data remains available to the host computer,
2 – 42 Remote Programming
but no further data from the port will be accepted until the RDDR bit is cleared. No flow control signals are asserted to stop the port from
transmitting data.
At power-on, this register is cleared.
2.6.1.2 Receive Pass-Through Enable (RPER)
This is a 16-bit wide register that controls transfers of data from the ports to the mainframe output queue.
Weight Bit Flag
1 0 undef (0) 2 1 P1-passthrough 4 2 P2-passthrough
8 3 P3-passthrough 16 4 P4-passthrough 32 5 P5-passthrough 64 6 P6-passthrough
128 7 P7-passthrough 256 8 P8-passthrough
512 9 P9-passthrough 1024 10 PA-passthrough 2048 11 PB-passthrough 4096 12 PC-passthrough 8192 13 PD-passthrough
16384 14 undef (0) 32768 15 undef (0)
If the bit corresponding to a particular port is set in the RPER when data from that port arrives at the mainframe, it is immediately en­capsulated into MSG packet(s) by the mainframe and transferred to the output queue without further host intervention (i. e., no query command is needed).
Messages are formatted as: MSG p,b
where p is the port the message came from, and b is a definite-length arbitrary binary data block (see section 2.5.1.4 for format).
Since the mainframe imposes no protocol requirements on the data transferred to or from the SIMs and external RS-232 devices, the MSG packets are divided at arbitrary points in the data stream. To correctly reconstruct the byte stream from a particular port, the host must concatenate the contents of all packets from that port in the order received.
The data block b of the MSG packets are guaranteed not to exceed
the byte limit set by the MSGL command. If fewer bytes are re-
ceived from a port, then a MSG packet is generated after a timeout of approximately 5 serial-byte times (5 or 6 ms at 9600 baud).
SIM900 Mainframe
2.6 Register Model 2 – 43
When the mainframe is switched to connect mode to a port (via
CONN), the RPER is cleared to all zeros. This prevents data from any
of the unconnected ports from being interspersed in theoutput queue with data bytes from the connected port. Upon leaving connect mode the RPER remains cleared, so the host must reprogram RPER if needed.
At power-on, this register is cleared.
2.6.1.3 Broadcast Enable (BER)
This is a 16-bit wide register that selects ports to receive broadcast
messages (BRDC, BRDT) from the mainframe.
Weight Bit Flag
1 0 undef (0) 2 1 P1–broadcast 4 2 P2–broadcast
8 3 P3–broadcast 16 4 P4–broadcast 32 5 P5–broadcast 64 6 P6–broadcast
128 7 P7–broadcast 256 8 P8–broadcast
512 9 P9–broadcast 1024 10 PA–broadcast 2048 11 PB–broadcast 4096 12 PC–broadcast 8192 13 PD–broadcast
16384 14 undef (0) 32768 15 undef (0)
SIM900 Mainframe
If the bit corresponding to a particular port is set in the BER, then any broadcast messages sent from the host to the mainframe will be transferred to that port. Note that the Port C and Port D bits are only
eective if PRTC PORT (or PRTDPORT) have been set.
This register is cleared on power-on.
2 – 44 Remote Programming
2.6.2 Status registers
The SIM900 Mainframe status registers follow the hierarchical IEEE–
488.2 format. A block diagram of the entire status register array is given in Figure 2.1.
There are four broad categories of registers in the status model of the mainframe:
Condition Registers : These read-only registers correspond to the real-time condi-
tion of some underlying physical property being monitored. Queries return the latest value of the property, and have no
further side eects. Condition register names end with CR.
Transition Selection Registers : These read/write registers define specific transition events
(such as 0 1 or 1 0). The event is then defined by the selected transition in the value of the underlying condition
register. Transition register names end with PT or NT.
Event Registers : These read-only registers record the occurrence of defined
events within the mainframe. If the event occurs, the corre­sponding bit is set to 1. Upon querying an event register, any set bits within it are cleared2. These are sometimes known as “sticky bits,” since once set, a bit can only be cleared by reading
its value. Event register names typically end with SR.
Enable Registers : These read/write registers define a bitwise mask for their cor-
responding event register. If any bit position is set in an event register while the same bit position is also set in the enable register, then the corresponding summary bit message is set.
Enable register names typically end with SE.
2
Except for any summary bit messages.
SIM900 Mainframe
7
X
5
4
3
2
1
0
SSSB: SIM Status Summary Bit
RQS / MSS: Master Summary Status
ESB: Event Status Bit
MAV: Message Available
IDLE
CESB: Comm Error Summary Bit
FCSB: Flow Control Summary Bit
PDSB: Port Data Pending Summary Bit
7
6
5
4
3
2
1
0
Status Byte
SB SRE
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
SSCR SSPT SSNT SSEV SSEN
SIM Status
STATUS1
STATUS2
STATUS3
STATUS4
STATUS5
STATUS6
STATUS7
STATUS8
STATUS9
undef
undef
undef
undef
undef
undef
undef
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
OPC: Operation Complete
undef
DDE: Device Error
EXE: Execution Error
CME: Command Error
undef
PON: Power On
QYE: Query Error
ESR ESE
Standard Event Status
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DataAvail1
DataAvail2
DataAvail3
DataAvail4
DataAvail5
DataAvail6
DataAvail7
DataAvail8
DataAvail9
DataAvailA
DataAvailB
DataAvailC
DataAvailD
undef
undef
Port Data Pending
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
TOSR TOSE
TimeoutGPIB
Timeout1
Timeout2
Timeout3
Timeout4
Timeout5
Timeout6
Timeout7
Timeout8
Timeout9
TimeoutA
TimeoutB
TimeoutC
TimeoutD
undef
undef
Timeout Status
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
DCAS
CommErr1
CommErr2
CommErr3
CommErr4
CommErr5
CommErr6
CommErr7
CommErr8
CommErr9
CommErrA
CommErrB
CommErrC
CommErrD
IOSB
CESR CESE
Comm Error Status
TOSB
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CTSR CTSE
CTS Event Status
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
undef
RTS_Halted1
RTS_Halted2
RTS_Halted3
RTS_Halted4
RTS_Halted5
RTS_Halted6
RTS_Halted7
RTS_Halted8
RTS_Halted9
RTS_HaltedA
RTS_HaltedB
CTS_HaltedC
CTS_HaltedD
undef
FCSR FCSE
Flow Control Status
CTSB
undef
0 0
PDPR PDPE
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
undef
CTS1
CTS2
CTS3
CTS4
CTS5
CTS6
CTS7
CTS8
CTS9
CTSA
CTSB
RTSC
RTSD
undef
undef
CTCR
(only neg. transitions CTCR CTSR)
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
IOSR IOSE
InovrGPIB
Inovr1
Inovr2
Inovr3
Inovr4
Inovr5
Inovr6
Inovr7
Inovr8
Inovr9
InovrA
InovrB
InovrC
InovrD
undef
undef
Input Overrun Status
2.6 Register Model 2 – 45
SIM900 Mainframe
Figure 2.1: Status Register Model for the SIM900 Mainframe.
2 – 46 Remote Programming
2.6.2.1 Status Byte (SB)
This is an 8-bit wide register defined by IEEE–488.2. It can be read
either by a GPIB serial poll, or through the *STB? command. The
Status Byte is the top-level summary of the SIM900 Mainframe status model.
Weight Bit Flag
1 0 PDSB 2 1 FCSB 4 2 CESB
8 3 IDLE 16 4 MAV 32 5 ESB 64 6 RQS/MSS
128 7 SSSB
Bit 6 returns the RQS message during a GPIB serial poll, and MSS
when queried with *STB?
PDSB : Port Data Pending Summary Bit. Indicates whether one or
more of the enabled flags in the Port Data Pending Status Reg­ister has become true.
FCSB : Port Flow Control Summary Bit. Indicates whether one or more
of the enabled flags in the Port Flow Control Status Register has become true.
CESB : Comm Error Summary Bit. Indicates whether one or more of
the enabled flags in the Comm Error Status Register has become true.
IDLE : Indicates that the input buer is empty and the command
parser is idle. Can be used to help synchronize mainframe query responses.
MAV : Message Available. Indicates whether or not the output queue
has any data pending for the host.
ESB : Event Status Bit. Indicates whether one or more of the enabled
events in the Standard Event Status Register is true.
RQS : IEEE–488 Request Service message, indicating this device (the
SIM900 Mainframe) requested service.
MSS : Master Summary Status. Indicates whether one or more of the
enabled status messages in the Status Byte register is true.
SSSB : SIM Status Summary Bit. Indicates whether one or more of
the enabled event flags in the SIM Status Event Register has become true.
SIM900 Mainframe
2.6 Register Model 2 – 47
Bits in the Status Byte are not cleared by the *STB? query. These
bits are only cleared by reading the underlying event registers, or by clearing the corresponding enable registers.
2.6.2.2 Service Request Enable (SRE)
This is an 8-bit wide register defined by IEEE–488.2. Each bit in the SRE corresponds one-to-one with a bit in the SB register, and acts as a bitwise AND of the SB flags to generate MSS/RQS. Bit 6 of the SRE is undefined - setting it has no eect, and reading it always returns
0. This register is set and queried with the *SRE(?) command. At power-on, this register is cleared if *PSCis non-zero. It retains its
value if *PSC 0.
2.6.2.3 Standard Event Status (ESR)
This is an 8-bit wide register defined by IEEE–488.2. These event flags are all “sticky bits” that are set by the corresponding event,
and cleared only by reading or with the *CLS command. Reading a single bit (with the *ESR? i query) clears only bit i.
Weight Bit Flag
1 0 OPC
2 1 undef (0)
4 2 QYE
8 3 DDE 16 4 EXE 32 5 CME 64 6 undef (0)
128 7 PON
OPC : Operation Complete. Set by the *OPC command.
QYE : Query Error. Indicates either (1) an attempt to read data when
no output is present or pending (only valid for GPIB), or (2) data in the output queue has been lost.
DDE : Device Dependent Error. Indicates a mainframe power supply
undervoltage.
EXE : Execution Error. Indicates an error in a command that was
successfully parsed. Out-of-range parameters are an example.
The error code can be queried with LEXE?.
CME : Command Error. Indicates a parser-detected error. The error
code can be queried with LCME?.
SIM900 Mainframe
PON : Power On. Indicates that an o-to-on transition has occurred.
2 – 48 Remote Programming
2.6.2.4 Standard Event Status Enable (ESE)
This is an 8-bit wide register defined by IEEE–488.2. It acts as a bitwise AND with the ESR register to produce the single bit ESB message in the Status Byte Register (SB). It can be set and queried
with the *ESE(?) command. At power-on, this register is cleared if *PSCis non-zero. It retains its
value if *PSC 0.
2.6.2.5 SIM Status Condition (SSCR)
This 16-bit wide register monitors the STATUS line from the 9 SIM ports (1–9). There is no corresponding signal for the RS-232 ports. SSCR is a read-only register.
Weight Bit Flag
1 0 undef (0)
2 1 Status1
4 2 Status2
8 3 Status3 16 4 Status4 32 5 Status5 64 6 Status6
128 7 Status7 256 8 Status8
512 9 Status9 1024 10 undef (0) 2048 11 undef (0) 4096 12 undef (0) 8192 13 undef (0)
16384 14 undef (0) 32768 15 undef (0)
The STATUS output signal from a SIM idles high, indicating no special status information to report, and set or pulsed to low to indicate some (device-dependent) status message. The SSCR records the complement of the signal, so STATUS True (low) appears as a 1 in the SSCR, while STATUS False (high) appears as a 0. Reads
to the SSCR (via SSCR?) return the present value of the STATUS
signal for Port n as bit Statusn.
2.6.2.6 SIM Status Positive/Negative Transition (SSPT/SSNT)
These two 16-bit wide registers control the mapping of transitions in the SSCR to setting flags in the SSEV register. For any particular SIM port, if the corresponding bit is set in SSPT, then a 0 1 transition in the SSCR causes the bit to be set in the SSEV. Likewise, if a bit is set in SSNT, then a 1 0 transition in the SSCR causes the bit to be set in the SSEV.
SIM900 Mainframe
2.6 Register Model 2 – 49
All combinations of SSPT and SSNT settings for the 9 SIM ports are valid. At power-on, both SSPT and SSNT are cleared.
2.6.2.7 SIM Status Event (SSEV)
This 16-bit wide register monitors selected events in the SSCR, based on transitions selected in SSPT and SSNT. When the selected transi­tion(s) occur, the corresponding bit is set. Reading the register clears it (reading a single bit clears only that bit). This register is cleared by
the *CLS command.
2.6.2.8 SIM Status Enable (SSEN)
This is a 16-bit wide register that masks the SSEV register. The logical OR of the bitwise AND of SSEV and SSEN produces the SSSB message in the Status Byte register (SB).
2.6.2.9 Communications Error Status (CESR)
This is a 16-bit wide register that monitors communications errors on the ports.
Weight Bit Flag
1 0 DCAS 2 1 CommErr1 4 2 CommErr2
8 3 CommErr3 16 4 CommErr4 32 5 CommErr5 64 6 CommErr6
128 7 CommErr7 256 8 CommErr8
512 9 CommErr9 1024 10 CommErrA 2048 11 CommErrB 4096 12 CommErrC 8192 13 CommErrD
16384 14 TOSB 32768 15 IOSB
DCAS : Device Clear Active State. Set by the mainframe receiving a
Device Clear event (either from DCL, SDC, or RS-232 hbreaki.
CommErrp : Communication Error for Port p. Set by the mainframe de-
tecting a serial error (such as parity violation or framing error, or an input buer overflow) on the corresponding port input hardware.
SIM900 Mainframe
TOSB : Timeout Summary Bit message. TOSB indicates the logical OR
of the bitwise AND of TOSR and TOSE (see below).
2 – 50 Remote Programming
IOSB : Input Overflow Summary Bit message. IOSB indicates the
logical OR of the bitwise AND of IOSR and IOSE (see below).
This register (with the exception of the TOSB & IOSB bits) is cleared
either by reading, or with the *CLS command.
2.6.2.10 Communications Error Status Enable (CESE)
This is a 16-bit wide register that masks the CESR register. The logical OR of the bitwise AND of CESR and CESE produces the CESB message in the Status Byte register (SB).
At power-on, this register is cleared.
2.6.2.11 Timeout Status (TOSR)
This is a 16-bit wide register that monitors timeout errors.
Weight Bit Flag
1 0 TimeoutGPIB 2 1 Timeout1 4 2 Timeout2
8 3 Timeout3 16 4 Timeout4 32 5 Timeout5 64 6 Timeout6
128 7 Timeout7 256 8 Timeout8
512 9 Timeout9 1024 10 TimeoutA 2048 11 TimeoutB 4096 12 TimeoutC 8192 13 TimeoutD
16384 14 undef (0) 32768 15 undef (0)
If an attempt to write to a port output queue fails due to a timeout error, the corresponding bit in the TOSR is set. (This can also be thought of as an output overflow error.) The register is cleared either
by reading, or with the *CLS command.
2.6.2.12 Timeout Status Enable (TOSE)
This is a 16-bit wide register that masks the TOSR register. The logical OR of the bitwise AND of TOSR and TOSE produces the TOSB message in the Communications Error Status Register (CESR).
SIM900 Mainframe
2.6 Register Model 2 – 51
2.6.2.13 Input Overflow Status (IOSR)
This is a 16-bit wide register that monitors input overflow errors.
Weight Bit Flag
1 0 InoverGPIB 2 1 Inovr1 4 2 Inovr2
8 3 Inovr3 16 4 Inovr4 32 5 Inovr5 64 6 Inovr6
128 7 Inovr7 256 8 Inovr8
512 9 Inovr9 1024 10 InovrA 2048 11 InovrB 4096 12 InovrC 8192 13 InovrD
16384 14 undef (0) 32768 15 undef (0)
When data is received by the mainframe at a port, it is initially stored in the 512-byte port input buer, on a first-in, first-out (FIFO) basis. If an input buer overflows, an error condition is recorded in the IOSR, and the corresponding input buer is flushed. If the host input buer overflows, then the host output queue is also flushed (as though a Device Clear had occurred).
The register is cleared either by reading, or with the *CLS command.
2.6.2.14 Input Overflow Status Enable (IOSE)
This is a 16-bit wide register that masks the IOSR register. The logical OR of the bitwise AND of IOSRand IOSE produces the IOSB message in the Communications Error Status Register (CESR).
2.6.2.15 Flow Control Status (FCSR)
This 16-bit wide register monitors the flow-control hardware of the ports. If the mainframe stops the incoming flow of data from a port (by deasserting RTS), then the corresponding bit in the FCSR is set. Whether or not this means that data was actually lost depends on the implementation of the particular SIM or RS-232 device sourcing data to the mainframe.
Since Ports C and D (EAVS and COMM) are DCE ports rather than DTE ports, the hardware flow-control outputs are actually CTS for these two ports.
SIM900 Mainframe
2 – 52 Remote Programming
Note if FLOW is set to XON or NONE, the FCSR will not be set by flow
control events. Only RTS flow control is monitored by FCSR.
Weight Bit Flag
1 0 undef (0) 2 1 RTS–Halted1 4 2 RTS–Halted2
8 3 RTS–Halted3 16 4 RTS–Halted4 32 5 RTS–Halted5 64 6 RTS–Halted6
128 7 RTS–Halted7 256 8 RTS–Halted8
512 9 RTS–Halted9 1024 10 RTS–HaltedA 2048 11 RTS–HaltedB 4096 12 CTS–HaltedC 8192 13 CTS–HaltedD
16384 14 CTSB 32768 15 undef (0)
CTSB is the CTS Summary Bit status message, and is the logical OR of the bitwise AND of CTSR and CTSE (see below).
This register (with the exception of the CTSB bit) is cleared either by
reading. All bits are cleared by *CLS.
2.6.2.16 Flow Control Status Enable (FCSE)
This is a 16-bit wide register that masks the FCSR register. The logical OR of the bitwise AND of FCSR and FCSE produces the FCSB message in the Status Byte register (SB).
At power-on, this register is cleared.
SIM900 Mainframe
2.6 Register Model 2 – 53
2.6.2.17 CTS Status Condition (CTCR)
This 16-bit wide register monitors the CTS line of all ports (1–D).
Weight Bit Flag
1 0 undef (0) 2 1 CTS1 4 2 CTS2
8 3 CTS3 16 4 CTS4 32 5 CTS5 64 6 CTS6
128 7 CTS7 256 8 CTS8
512 9 CTS9 1024 10 CTSA 2048 11 CTSB 4096 12 RTSC 8192 13 RTSD
16384 14 undef (0) 32768 15 undef (0)
The CTS output signal from a SIM or RS-232 device is typically used for hardware flow control, and is asserted high (1) to indicate the mainframe is Clear To Send new bytes to the device, and deasserted (0) to stop the flow.
2.6.2.18 CTS Status (CTSR)
Since Ports C and D (EAVS and COMM) are DCE ports instead of DTE ports, the hardware flow-control inputs for these two ports are actually RTS rather than CTS.
SIM ports (1–9) each have a pull-down resistor wired to the CTS input, so unconnected slots will show CTCR[p] = 0. The RS-232 ports each have a pull-up resistor wired to the flow-control input, so unconnected RS-232 ports will show CTCR[p]=1.
Regardless of the current FLOWsetting for a port, the CTCR always
reflects the real-time value of CTS (RTS for Ports C & D).
This is another 16-bit wide register that monitors the flow control hardware of the ports. A 1 0 transition in the CTCR will cause the corresponding bit in the CTSR to be set. Thus, only Negative
Transitions generate the CTS Status events. When FLOW is RTS, this
indicates the SIM or RS-232 device has halted the flow of data from the mainframe.
This register is cleared either by reading, or with the *CLS command.
SIM900 Mainframe
2 – 54 Remote Programming
2.6.2.19 CTS Status Enable (CTSE)
This is a 16-bit wide register that masks the CTSR register. The logical OR of the bitwise AND of CTSR and CTSE produces the CTSB message in the Flow Control Status register (FCSR).
At power-on, this register is cleared.
2.6.2.20 Port Data Pending (PDPR)
This is a 16-bit wide register that monitors incoming data from the ports to the mainframe.
Weight Bit Flag
1 0 undef (0) 2 1 DataAvail1 4 2 DataAvail2
8 3 DataAvail3 16 4 DataAvail4 32 5 DataAvail5 64 6 DataAvail6
128 7 DataAvail7 256 8 DataAvail8
512 9 DataAvail9 1024 10 DataAvailA 2048 11 DataAvailB 4096 12 DataAvailC 8192 13 DataAvailD
16384 14 undef (0) 32768 15 undef (0)
A bit for a given port in the PDPR is set if any bytes arrive from that port while it is NOT mapped to the mainframe output queue (either
by the CONN command or through the RPER register). Reading the
register clears it (reading a single bit clears only that bit).
This register is cleared by the *CLS command.
2.6.2.21 Port Data Pending Enable (PDPE)
This is a 16-bit wide register that masks the PDPR register. The logical OR of the bitwise AND of PDPR and PDPE produces the PDSB message in the Status Byte register (SB).
At power-on, this register is cleared.
SIM900 Mainframe
3 Communications Examples
This chapter providesdetailed examples of communications with the SIM900 Mainframe.
In This Chapter
3.1 Introduction to Communications . . . . . . . . . . 3 – 2
3.1.1 Streaming Communications . . . . . . . . . . 3 – 2
3.1.2 Message-Based Communications . . . . . . . 3 – 3
3.1.3 Other Styles . . . . . . . . . . . . . . . . . . . 3 – 4
3.2 Streaming Example . . . . . . . . . . . . . . . . . . . 3 – 4
3.2.1 openMainframe() . . . . . . . . . . . . . . . . 3 – 4
3.2.2 main() . . . . . . . . . . . . . . . . . . . . . . 3 – 4
3.3 Message-Based Example . . . . . . . . . . . . . . . . 3 – 8
3.3.1 serviceMsgs() & deliverMsg() . . . . . . . . . 3 – 8
3.3.2 readMsg() & sendMsg() . . . . . . . . . . . . 3 – 8
3.3.3 openMainframe() . . . . . . . . . . . . . . . . 3 – 8
3.3.4 main() . . . . . . . . . . . . . . . . . . . . . . 3 – 9
3.4 Combination Example . . . . . . . . . . . . . . . . . 3 – 16
3.4.1 Details . . . . . . . . . . . . . . . . . . . . . . 3 – 16
3 – 1
3 – 2 Communications Examples
3.1 Introduction to Communications
The Small Instrumentation Module family supports several styles of communications between a user’s computer and a collection of instruments. While it is possible to communicate directly with a SIM module, this chapter will only consider the case of communication through a SIM900 Mainframe.
The SIM900 has two host computer interfaces: RS-232 and GPIB. To switch interfaces, use the rear-panel piano-style DIP switch (see section 1.4.2). The 5 right-most switches are interpreted based on the host selection, and determine either default baud rate or instrument address (see section 1.4.1). Only one host interface can be active, and the selection is determined at power-on time for the SIM900.
3.1.1 Streaming Communications
The simplest style of communication through the SIM900 is the “con­nection” model, where a single bidirectional I/O stream is managed. Upon power-on, the streamis initiallydirected tothe SIM900 itself, so
that, for example, an identification query (see *IDN?, section 2.5.10)
will result in the SIM900 ID string as a response back to the host
computer. Using the CONN command (section 2.5.3), the user can
steer the I/O stream to one of the instrument ports of the mainframe (1–8 for the internal slots, 9 for the remote SIM port, and A or B for the auxiliary RS-232 ports). After connecting to a particular port, all I/O is directed from the host computer through the Mainframe to the target port, and responses from the target port are passed through the Mainframe back to the host computer.
To end the connection, the host computer sends a preprogrammed “escape” string. The escape string is provided as the second pa-
rameter in the CONN command, and should be chosen carefully to
ensure that it does not inadvertently occur within the normal stream of I/O from the host computer to the target. In the example below, the nonsense sequence XYZZY is chosen as an escape string (note the string is case-sensitive). When the mainframe is relaying data from the host computer through to a connected port, it continually scans for a possible match with the escape string. If the first character of the string is received, the character is held in a memory buer of the mainframe. When the next character is received, it is compared with the second character of the string; if it matches, it too is added to the buer, otherwise both the buered previous character and the new character are transmitted to the target port.
SIM900 Mainframe
3.1 Introduction to Communications 3 – 3
As an illustration, consider the following session:
from host to module
CONN 3,’DEFQ’ establish connection GAIN 10 GAIN 10 “normal” pass-thru ABCDEF ABC partial match found GHIJK DEFGHIJK not escape string; catch up ABCDEFQ ABC connection ended
Notice that when the host computer transmitted ABCDEF, the last three characters (DEF) were not retransmitted by the mainframe to the target module; the mainframe withheld these bytes waiting to see if the complete escape string was being given. When the next character (G) was sent, the mainframe determined that this was not the escape string, and resumed transmission to the target module. There is no timeout on this partial-match buering, so the data will be held back indefinitely until the Mainframe can uniquely disambiguate between the message data and the escape string.
The situation get more interesting when multiple SIM900s are con­nected together using the auxiliary RS-232 ports. In this case, dif­ferent escape strings must be used for the two mainframes to enable redirection of the downstream SIM900 I/O stream without discon­necting the upstream connection.
3.1.2 Message-Based Communications
An alternative to the streaming connection model, message-based communications treats all transactions as mainframe-directed com­mands and queries. Transmissions from the host computer to in-
dividual modules are performed with the SEND and SNDT com-
mands; transmissions to multiple modules can broadcast with the
BRDC,BRDT commands (section 2.5.3).
There are several options available for receiving data from modules back to the host computer under a message-based scheme:
One or more ports can be enabled for “pass-through” messag-
ing with the RPER register (see sections 2.5.4 and 2.6.1.2). In-
coming data messages from an enabled port are encapsulated in a MSG packet, and transmitted directly to the host output queue. The example program below demonstrates this.
Individual port(s) can be polled for data (with the NINP?query, or through the RDPR status register). When data is available from a port, it can be retreived with the GETN? or RAWN?
queries (see section 2.5.3).
SIM900 Mainframe
3 – 4 Communications Examples
3.1.3 Other Styles
It is also possible to combine elements of each communication model. For instance, messages from the host to the modules can be con-
veniently dispatched with the SEND and SNDT commands, while query responses can be retrieved by CONNecting to the port and sim-
ply reading the results. The final example program demonstrates this hybrid style.
3.2 Streaming Example
This example demonstrates I/O to multiple SIM modules using the stream-based connection model. Low-level I/O is handled by func­tion calls to the National Instruments VISA library, and supports both RS-232 and GPIB.
3.2.1 openMainframe()
The most complicated function in this example is openMainframe(). After first performing a number of VISA-related initializations, the
program places the mainframe into a reset state (with *RST). The next command (VERB127) enables debugging output on the Eaves-consider monitoring the
Eavesdrop port for debugging drop RS-232 port. The next two commands (CEOI and EOIX) enable
translation of line-feed characters to EOI messages (and visa-versa) when connected via GPIB. The host interface terminator is next pro­grammed to line-feed for consistency when connected via RS-232.
3.2.2 main()
Because the mainframe serial baud rates are not modified by the
*RST command, the program next loops over all valid port numbers
and commands each port to 9600 baud (the module default).
Finally, all internal port buers in the mainframe are flushed (FLSH),
and a serial break signal is sent to all SIM modules to force their
communications interfaces to a clean state (SRST).
After first querying the identification string of the mainframe, the program moves the I/O stream to port 5 and identifies the module plugged into that slot. Notice the “TERM LF” command that is first sent to the module—this sets the module to terminate responses with a line-feed character. This is particularly helpful for GPIB-based communications.
The dialog is repeated for port 7, after which the program ends.
SIM900 Mainframe
3.2 Streaming Example 3 – 5
/* == = = = = = = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = == = = == = == = = == = == = =
* example_stream i n g .c -- simple IO * * compile l ine : cl ex a m p l e _ s t r e a m i n g .c /l ink visa 3 2 .lib */
#include <st d i o .h > #include <st d l i b .h > #include <st r i n g .h > #include <ti m e . h > #include <vi s a . h > /* external VI S A library */
/* the f ollowing mac r o defines the VIS A resource (uncomment o nly on e ) */ #define VI S A R E S O U R C E " G PIB :: 2 :: IN S T R " /* GPI B Address 2 */ /* #define VI S A R E S O U R C E " A S RL2 : : IN S T R " /* COM 2 (RS -232) */
#define VI S A T I M E O U T 1000 /* ti meou t , in ms */
/* Define the de f a u l t baud rate for th e host i n t e r f ace (for RS -232).
* Edi t to match the settin g on the rear -pane l DIP sw i tch . */
#define DE F A U L T B A U D 960 0
/* === function prototypes === */
in t openMainframe ( vo i d ); vo id closeMainframe (voi d ); vo id sendString ( ch ar *m s g ); vo id recvString ( ch ar *msg , int size );
/* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = == */ /* == = This is the ma in progra m . The ma i n f r a m e I D string is qu e ried , = = = */ /* == = and then mo d u l es in slots 5 & 7 are id e n t i f i e d . == = */ /* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = == */
in t main (void ) {
ch ar msg [81];
if (openMainframe () ) return 0; /* at t e m pt to open co m m u n i c a t i o n s */
sen d S t r i n g ("* IDN ?\ n " ); /* query m a i n f rame ID string */ rec v S t r i n g (ms g , sizeof ( msg )) ; /* rece i v e r e sponse */ pr i n t f (" MF IDN : % s \n " ,ms g ); /* report the re s u l t */ ff l u s h (stdout );
sen d S t r i n g (" CONN 5 ,’ x yZZy ’\ n " ); /* co nnect to Slot 5 */ sen d S t r i n g (" TERM LF \ n " ); /* set response te r m to LF */ sen d S t r i n g ("* IDN ?\ n " ); /* query m odule ID strin g */ rec v S t r i n g (ms g , sizeof ( msg )) ; /* rece i v e r e sponse */ pr i n t f (" S l o t 5: % s\ n" , m sg ); / * repor t the re s u lt */ ff l u s h (stdout ); sen d S t r i n g (" xyZZy " ) ; /* disconnect */
sen d S t r i n g (" CONN 7 ,’ x yZZy ’\ n " ); /* co nnect to Slot 7 */
SIM900 Mainframe
3 – 6 Communications Examples
sen d S t r i n g (" TERM LF \ n " ); /* set response te r m to LF */ sen d S t r i n g ("* IDN ?\ n " ); /* query m odule ID strin g */ rec v S t r i n g (ms g , sizeof ( msg )) ; /* rece i v e r e sponse */ pr i n t f (" S l o t 7: % s\ n" , m sg ); / * repor t the re s u lt */ ff l u s h (stdout ); sen d S t r i n g (" xyZZy " ) ; /* disconnect */
closeMainframe ( );
re t u r n 0;
}
/* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = ==
* low level I/ O funct i o n s : * op e n M a i n f r a m e () -- open communications ch annel , and in i t i a l i ze * mai n f r a m e & mo dules * cl o s e M a i n f r a m e () - close co m m u n i c a t i o n s c h a n n el * se n d S t r ing () -- --- transmit a null - te r m i n a t e d string * re c v S t r ing () -- --- receive da ta int o a null - t e r m i n a t e d string */
st a t i c ViSession defaul t R M ; st a t i c ViSession in s t r ; st a t i c ViStatus st a t u s ; st a t i c ViUInt32 ret C o u n t ; st a t i c ViUInt32 write C o u n t ;
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
in t openMainframe ( vo i d ) {
V i U I n t 1 6 itype;
in t i; ch ar buf [32];
st a t u s =viOpenDefaultRM (& defaultRM ); if (status < V I _ S U C C E S S ) {
pr i n t f (" Cou l d not open a s e s s i o n \n "); ex i t (EXIT_FAILURE );
}
st a t u s = viOpen (d e f aultRM , VI SARESOURCE , VI_N ULL , VI_NUL L , &instr ); if (status < V I _ S U C C E S S ) {
pr i n t f (" Cannot op en a session to the devi c e .\ n"); st a t u s = viClose ( in str ); st a t u s = viClose ( de f a u l t R M ); ex i t (EXIT_FAILURE );
}
/* Set timeout va l u e */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _TMO_VALUE , VI S A T I M E O U T );
/* Set interf a ce - sp e c i f i c config . (RS -2 3 2 or GPIB ...) */
st a t u s = vi G e t A t t r i b u t e (ins tr , VI _ A T T R _INTF_TYPE , &i t y pe ); if (itype == VI _ I N T F _ A S R L ) { /* int e r f a c e is RS - 2 3 2 */
SIM900 Mainframe
3.2 Streaming Example 3 – 7
/* transmit se r i al BREAK to re set SIM9 0 0 host in t e r f a c e */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _END_OUT , VI_ASRL_END_BREAK ); st a t u s = viWrite (i nst r , (ViBuf) buf , 0, &writeCount ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _END_OUT , VI_ASRL_END_NONE );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ASRL_BAUD , DE F A U L T B A U D ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _ D A T A _ B ITS , 8) ; st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S RL_PARITY , VI_ASRL_PAR_NONE ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _ S T O P _ B ITS , VI_AS R L _ S T O P _ O N E ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ T E RMCHAR_EN , VI_ T R U E ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R_TERMCHAR , 0xA ) ;
} els e if ( itype == VI _ I N T F _ G P I B ) { /* interface is GP I B */
st a t u s = viClear ( in str ); /* clear SI M 9 0 0 hos t i n t e r f ace */ st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ T E RMCHAR_EN , VI _ F A L S E ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ S U P P R E S S _ E N D _ E N , VI_FALSE ) ;
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ S E ND_END_EN , VI_ T R U E ); } sen d S t r i n g ("* RST\ n " ); /* SI M 9 0 0 default */ sen d S t r i n g (" VERB 127\ n " ); /* en a b l e E avesdrop */ sen d S t r i n g (" CEOI ON \ n " ); /* conve r t EOI ’ s (fo r GPIB ) */ sen d S t r i n g (" EOIX ON \ n " ); sen d S t r i n g (" TERM D, L F \ n " ); /* set SIM 9 0 0 to LF term */
fo r (i=1; i < = 0 xb ; + + i) { /* set po r ts to 9600 baud */
sp r i n t f (buf , " BA U D %x ,9600\ n" , i);
sen d S t r i n g (buf ); } sen d S t r i n g (" FLSH\ n " ); /* fl u sh all port bu f f ers */ sen d S t r i n g (" SRST\ n " ); /* re s et module i n t e r f a c e s */ re t u r n 0;
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id closeMainframe (voi d ) {
st a t u s = viClose ( in str ); st a t u s = viClose ( de f a u l t R M );
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id sendString ( ch ar *m s g ) {
st a t u s = viWrite (i nst r , (ViBuf) msg , st r l e n (msg ), & writeCoun t );
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id recvString ( ch ar *msg , int size ) {
st a t u s = viRead ( i nstr , msg , s ize -1 , & re t C o u n t ); if (retCount == 0) ms g [0] = ’\0 ’;
}
SIM900 Mainframe
3 – 8 Communications Examples
3.3 Message-Based Example
This example demonstrates basic I/O to multiple SIM modules using the message-based communication model. Low-level I/O is handled by function calls to the National Instruments VISA library, and sup­ports both RS-232 and GPIB.
3.3.1 serviceMsgs() & deliverMsg()
The serviceMsgs() function handles the incoming stream of mes­sage packets from the various module ports to the host computer. Ideally, this function would be repeatedly called within a parallel thread to the main program. For simplicity, in this example, the function is called repeatedly within the main thread of the program, and no explicit parallelism is used.
Separate input port buers (portBuf) are used to store the incoming streams from each port; data originating with the mainframe itself is buered as “port 0”. Each incoming packet begins with a MSG header (see section 2.6.1.2) containing the source port address and the byte count for the payload data. The bulk of serviceMsgs() handles the parsing of this header, buering partial packets internally, and sending any data not encapsulated in a MSG packet to the “port 0” buer.
Data is transferred to the portBuf array by the internal helper func­tion deliverMsg(); this function should not be called by any user­level code.
3.3.2 readMsg() & sendMsg()
These two functions constitute the user-level interface for communi­cations. readMsg() drains data from the portBuf array, and if neces­sary calls serviceMsgs() to retrieve more data. Calls to readMsg() transfer data up to (and including) either the requested number of bytes, or the first line-feed character.
The sendMsg() sends data to the SIM system; messages directed to the mainframe (port=0) simply have a line-feed appended to the
end, while port-directed messages are sent as the payload of a SNDT
command (section 2.5.3).
3.3.3 openMainframe()
The only change to openMainframe(), compared with the previous example, is the addition of the line:
sen d S t r i n g (" RPER 40 94\ n " );
SIM900 Mainframe
3.3 Message-Based Example 3 – 9
This programs the Receive Pass-Through Enable register (sec­tion 2.6.1.2) for ports 1–B, causing incoming data from the modules to the mainframe to be immediately transmitted by the mainframe to the host as MSG packets.
3.3.4 main()
The main program is similar to the first example. Notice that the TERM LF message is now being broadcast to all module ports using
the BRDT command. Also, the serviceMsgs() function is called
after each query command is sent, before attempting to read the results. Ideally, the calls to serviceMsgs() would be hidden in a parallel thread, but that refinement is omitted here.
SIM900 Mainframe
3 – 10 Communications Examples
/* == = = = = = = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = == = = == = == = = == = == = =
* example_messages .c -- SIM IO ex a m p le * * compile l ine : cl example_messages .c /link v isa32 . lib */
#include <st d i o .h > #include <st d l i b .h > #include <st r i n g .h > #include <ti m e . h > #include <vi s a . h > /* external VI S A library */
/* the f ollowing mac r o defines the VIS A resource (uncomment o nly on e ) */ #define VI S A R E S O U R C E " G PIB :: 2 :: IN S T R " /* GPI B Address 2 */ /* #define VI S A R E S O U R C E " A S RL2 : : IN S T R " /* COM 2 (RS -232) */
#define VI S A T I M E O U T 500 /* ti meout , in ms */
/* Define the de f a u l t baud rate for th e host i n t e r f ace (for RS -232).
* Edi t to match the settin g on the rear -pane l DIP sw i tch . */
#define DE F A U L T B A U D 960 0
/* === function prototypes === */
vo id serviceMsgs ( vo id ); vo id deliverMsg ( int port , cha r *p, int len ); vo id readMsg( i nt port , cha r *buf , int ma x L en ); vo id sendMsg( i nt port , cha r *buf ); in t openMainframe ( vo i d ); vo id closeMainframe (voi d ); vo id sendString ( ch ar *m s g ); vo id recvString ( ch ar *msg , int size );
/* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = == */ /* == = This is the ma in progra m . The ma i n f r a m e I D string is qu e ried , = = = */ /* == = and then mo d u l es in slots 5 & 7 are id e n t i f i e d . == = */ /* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = == */
in t main (void ) {
ch ar msg [81];
if (openMainframe () ) return 0;
se n d M s g (0 , "BRER 1022 " ) ; /* enable por t s 1-9 to re c e ive broadcasts */ se n d M s g (0 , "BRDT ’ TERM LF ’ " ); /* set all modul e s to LF t e r m i n a t i o n s */
se n d M s g (0 , "*IDN ?"); /* qu e ry mainframe ID str i n g */ se r v i c e M s g s (); re a d M s g (0 , msg , size o f (ms g )) ; pr i n t f (" MF IDN : % s \n " ,ms g ); /* report the re s u l t */ ff l u s h (stdout );
se n d M s g (5 , "*IDN ?");
SIM900 Mainframe
3.3 Message-Based Example 3 – 11
serv i c e M s g s (); re a d M s g (5 , msg , size o f (ms g )) ; pr i n t f (" S l o t 5: % s\ n" , m sg ); / * repor t the re s u lt */ ff l u s h (stdout );
se n d M s g (7 , "*IDN ?"); se r v i c e M s g s (); re a d M s g (7 , msg , size o f (ms g )) ; pr i n t f (" S l o t 7: % s\ n" , m sg ); / * repor t the re s u lt */ ff l u s h (stdout );
closeMainframe ( );
re t u r n 0;
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * **
* mes sage - level I/ O function s : * se r v i c e M s g s () -- pseu do - b a c k g r o u n d f unction to handl e i n c oming msg s * de l i v e r Msg () - - in t e r n a l function to co p y msg to por t - s p e c i f i c buffer * re adMsg () -- user - le v el function to re ad m s g from a s p e cific por t * se ndMsg () -- user - le v el function to wr i t e msg to a s pecific po r t * * For readMsg ( ) an d sendMsg () , use por t =0 to send to the Mainframe it s elf . * All reads will termina t e on ’\ n ’ or maxLen , an d all sends wi ll hav e a * ’ \ n ’ postpended. */
#define MA X P O R T 0x d #define BU F S I Z E 10 2 4 st a t i c char p o r tBuf [ BUFS I Z E ][ MAXPOR T ]; st a t i c unsigned int portFi l l [ M AXPORT ] ; st a t i c unsigned int portDrain[ M A X P O R T ]; st a t i c unsigned int nBytesUsed [ MA X P ORT ];
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id serviceMsgs ( vo id ) {
st a t i c char msg [ 1 9 2 ]; st a t i c int idx; in t res ult , ne wBytes ; ch ar *p; in t po rt , le n ;
rec v S t r i n g (&msg[ i dx ] , s i z eof ( ms g )- id x ); n e w B y t e s = strlen (& msg [ id x ]) ; wh i le (newByte s ) {
id x = 0 ; /* we ’ l l upd a t e this if neces s a r y */
if (( p = str s t r (msg ,"MSG ") ) != NUL L ) {
/* detected a MSG pa c k e t */
if (p != msg ) {
/* send p r e c e eding bytes to bu f fer #0 */
del i v e r M s g (0, msg , msg -p );
SIM900 Mainframe
3 – 12 Communications Examples
st r c p y (msg ,p) ; } re s u l t = sscanf ( msg , " M SG %1 x ,#2 % 2 d" ,&por t ,& l en ) ; if (result == 2) { /* is he a der complete ? */
p = msg + 10; /* point to star t of pa y load */
if (strlen(p ) >= le n ) { /* is pa y l oad complete ? */
del i v e r M s g (port , p , len );
p += len; if (strlen(p )) { /* any tr a i l i ng data ? */
st r c p y (msg ,p); /* if so , buffer it . . . */ id x = strlen( m sg ) ;
}
} }
} els e {
/* no MS G p acket detec t e d */
if (( p = strrch r (ms g ,’\n ’ ) ) != NUL L ) { /* any co m p l e t e lines ? */
p++; /* include te r m i n a t o r */
del i v e r M s g (0, msg , msg -p ) ; /* se n d to buffer # 0 */
if (strlen(p )) { /* anything le ft ? */
st r c p y (msg ,p); id x = strlen( m sg ) ;
} } els e {
/* no complete li n e s ; stor e and re t urn .. . */
id x = strlen( m sg ) ; }
} rec v S t r i n g (&msg[ i dx ] , s i z eof ( ms g )- id x ); /* look fo r mor e data */ n e w B y t e s = strlen (& msg [ id x ]) ;
}
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id deliverMsg ( int port , cha r *p, int len ) {
wh i le (len && nB y t e s U s e d [port ] < BUFSIZE ) {
po r t B u f [portFill [ p o rt ] + + ] [ por t ] = *p ++ ; p o r t F i l l [port ] %= BU FSIZE ; ++ nBytesUsed[ p o rt ];
-- len ;
}
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id readMsg( i nt port , cha r *buf , int ma x L en ) {
ch ar lastRead ;
if (maxLen <= 1 ) {
*buf = ’\0 ’ ; re t u r n ;
}
SIM900 Mainframe
3.3 Message-Based Example 3 – 13
l a s t R e a d = ’\0 ’;
do {
wh i le (nBytesUsed [ po r t ] & & (ma xLen -1) && la s t R e ad != ’\n’ ) {
l a s t R e a d = ( * buf ++ = portBuf[ po r t D r a in [por t ]++][ port ]); por t D r a i n [port ] %= BU F S I Z E ;
-- nByt e s U s e d [port ];
-- ma x L e n ;
} if (( m a x Len -1) && la s t R e a d != ’\n ’ ) {
se r v i c e M s g s (); /* tr y for some mo re .. . */
}
} whil e ( n B y t e s U s ed [por t ] & & (max L en - 1 ) && la s t R e a d != ’\n ’ );
*buf = ’\0 ’ ;
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id sendMsg( i nt port , cha r *msg ) {
ch ar buf [256]; if (strlen( m sg ) > 12 8 ) retu r n ; /* er r or ! */
if (port = = 0) {
st r c p y (buf , msg ); st r c a t (buf ,"\n"); sen d S t r i n g (buf );
} els e {
sp r i n t f (buf , " SN D T %x ,#3%03 d%s\n " , p ort , strle n (msg), m sg ) ; sen d S t r i n g (buf );
}
}
/* ***** * * * * * * * ** * * ** * ** * * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * *
* low level I/ O funct i o n s : * op e n M a i n f r a m e () -- open communications ch annel , and in i t i a l i ze * mai n f r a m e & mo dules * cl o s e M a i n f r a m e () - close co m m u n i c a t i o n s c h a n n el * se n d S t r ing () -- --- transmit a null - te r m i n a t e d string * re c v S t r ing () -- --- receive da ta int o a null - t e r m i n a t e d string */
st a t i c ViSession defaul t R M ; st a t i c ViSession in s t r ; st a t i c ViStatus st a t u s ; st a t i c ViUInt32 ret C o u n t ; st a t i c ViUInt32 write C o u n t ;
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
in t openMainframe ( vo i d ) {
V i U I n t 1 6 itype;
in t i; ch ar buf [32];
SIM900 Mainframe
3 – 14 Communications Examples
st a t u s =viOpenDefaultRM (& defaultRM ); if (status < V I _ S U C C E S S ) {
pr i n t f (" Cou l d not open a s e s s i o n \n "); ex i t (EXIT_FAILURE );
}
st a t u s = viOpen (d e f aultRM , VI SARESOURCE , VI_N ULL , VI_NUL L , &instr ); if (status < V I _ S U C C E S S ) {
pr i n t f (" Cannot op en a session to the devi c e .\ n"); st a t u s = viClose ( in str ); st a t u s = viClose ( de f a u l t R M ); ex i t (EXIT_FAILURE );
}
/* Set timeout va l u e */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _TMO_VALUE , VI S A T I M E O U T );
/* Set interf a ce - sp e c i f i c config . (RS -2 3 2 or GPIB ...) */
st a t u s = vi G e t A t t r i b u t e (ins tr , VI _ A T T R _INTF_TYPE , &i t y pe );
if (itype == VI _ I N T F _ A S R L ) { /* int e r f a c e is RS - 2 3 2 */
/* transmit se r i al BREAK to re set SIM9 0 0 host in t e r f a c e */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _END_OUT , VI_ASRL_END_BREAK ); st a t u s = viWrite (i nst r , (ViBuf) buf , 0, &writeCount ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _END_OUT , VI_ASRL_END_NONE );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ASRL_BAUD , DE F A U L T B A U D ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _ D A T A _ B ITS , 8) ; st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S RL_PARITY , VI_ASRL_PAR_NONE ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _ S T O P _ B ITS , VI_AS R L _ S T O P _ O N E ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ T E RMCHAR_EN , VI_ T R U E ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R_TERMCHAR , 0xA ) ;
} els e if ( itype == VI _ I N T F _ G P I B ) { /* interface is GP I B */
st a t u s = viClear ( in str ); /* clear SI M 9 0 0 hos t i n t e r f ace */ st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ T E RMCHAR_EN , VI _ F A L S E ); st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ S U P P R E S S _ E N D _ E N , VI_FALSE ) ;
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ S E ND_END_EN , VI_ T R U E ); } sen d S t r i n g ("* RST\ n " ); /* SI M 9 0 0 default */ sen d S t r i n g (" VERB 127\ n " ); /* en a b l e E avesdrop */ sen d S t r i n g (" CEOI ON \ n " ); /* conve r t EOI ’ s (fo r GPIB ) */ sen d S t r i n g (" EOIX ON \ n " );
fo r (i=1; i < = 0 xb ; + + i) { /* set po r ts to 9600 baud */
sp r i n t f (buf , " BA U D %x ,9600\ n" , i);
sen d S t r i n g (buf ); } sen d S t r i n g (" TERM D, L F \ n " ); /* set SIM 9 0 0 to LF term */ sen d S t r i n g (" FLSH\ n " ); /* fl u sh all port bu f f ers */ sen d S t r i n g (" SRST\ n " ); /* re s et module i n t e r f a c e s */ sen d S t r i n g (" RPER 40 94\ n " ); /* Re c e i ve Pa ss -Through En a b l e ports 1 -B */ re t u r n 0;
SIM900 Mainframe
3.3 Message-Based Example 3 – 15
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id closeMainframe (voi d ) {
st a t u s = viClose ( in str ); st a t u s = viClose ( de f a u l t R M );
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id sendString ( ch ar *m s g ) {
st a t u s = viWrite (i nst r , (ViBuf) msg , st r l e n (msg ), & writeCoun t );
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id recvString ( ch ar *msg , int size ) {
st a t u s = viRead ( i nstr , msg , s ize -1 , & re t C o u n t ); if (retCount == 0) ms g [0] = ’\0 ’;
}
SIM900 Mainframe
3 – 16 Communications Examples
3.4 Combination Example
This example demonstrates basic I/O to multiple SIM modules using aspects of both the ”message”-based and ”stream”-based connection models. Low-level I/O uses National Instrument’s VISA library, and works with either RS-232 or GPIB.
3.4.1 Details
The main program for this final example is identical to the second example (example messages.c); again, the user-level interface is the functions sendMsg() and readMsg(). sendMsg() is also identical,
while readMsg() has been rewritten to use the CONN command.
The openMainframe() function is now identical to the first example
program, example streaming.c; the RPER register remains in the
reset state (value of 0).
By using the CONN path to retreive data from individual ports, the
intermediate layer serviceMsgs() is eliminated; instead of buer­ing the module-originated data on the host computer, this data is buered in the mainframe until the host computer is ready to query it directly. Since the SIM900 Mainframe has 512-byte buers for each port, this is usually sucient.
SIM900 Mainframe
3.4 Combination Example 3 – 17
/* == = = = = = = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = == = = == = == = = == = == = =
* example_hybrid . c - - SIM IO exa m p l e * * compile l ine : cl example_hybrid . c / li nk visa 3 2 .li b */
#include <st d i o .h > #include <st d l i b .h > #include <st r i n g .h > #include <ti m e . h > #include <vi s a . h > /* external VI S A library */
/* the f ollowing mac r o defines the VIS A resource (uncomment o nly on e ) */ #define VI S A R E S O U R C E " G PIB :: 2 :: IN S T R " /* GPI B Address 2 */ /* #define VI S A R E S O U R C E " A S RL2 : : IN S T R " /* COM 2 (RS -232) */
#define VI S A T I M E O U T 500 /* ti meout , in ms */ #define ES C A P E K E Y " XY ZZY "
/* Define the de f a u l t baud rate for th e host i n t e r f ace (for RS -232).
* Edi t to match the settin g on the rear -pane l DIP sw i tch . */
#define DE F A U L T B A U D 960 0
/* === function prototypes === */
vo id readMsg( i nt port , cha r *buf , int ma x L en ); vo id sendMsg( i nt port , cha r *buf ); in t openMainframe ( vo i d ); vo id closeMainframe (voi d ); vo id sendString ( ch ar *m s g ); vo id recvString ( ch ar *msg , int size );
/* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = == */ /* == = This is the ma in progra m . The ma i n f r a m e I D string is qu e ried , = = = */ /* == = and then mo d u l es in slots 5 & 7 are id e n t i f i e d . == = */ /* ===== = = = = = = = == = = == = = == = == = = == = == = = == = = == = == = = == = == = = == = = == = == = = == = = == */
in t main (void ) {
ch ar msg [81];
if (openMainframe () ) return 0;
se n d M s g (0 , "BRER 1022 " ) ; /* enable por t s 1-9 to re c e ive broadcasts */ se n d M s g (0 , "BRDT ’ TERM LF ’ " ); /* set all modul e s to LF t e r m i n a t i o n s */
se n d M s g (0 , "*IDN ?"); /* qu e ry mainframe ID str i n g */ re a d M s g (0 , msg , size o f (ms g )) ; pr i n t f (" MF IDN : % s \n " ,ms g ); /* report the re s u l t */ ff l u s h (stdout );
se n d M s g (5 , "*IDN ?"); re a d M s g (5 , msg , size o f (ms g )) ;
SIM900 Mainframe
3 – 18 Communications Examples
pr i n t f (" S l o t 5: % s\ n" , m sg ); / * repor t the re s u lt */ ff l u s h (stdout );
se n d M s g (7 , "*IDN ?"); re a d M s g (7 , msg , size o f (ms g )) ; pr i n t f (" S l o t 7: % s\ n" , m sg ); / * repor t the re s u lt */ ff l u s h (stdout );
closeMainframe ( );
re t u r n 0;
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * **
* mes sage - level I/ O function s : * re adMsg () -- user - le v el function to re ad m s g from a s p e cific por t * se ndMsg () -- user - le v el function to wr i t e msg to a s pecific po r t * * For readMsg ( ) an d sendMsg () , use por t =0 to send to the Mainframe it s elf . * All reads will termina t e on ’\ n ’ or maxLen , an d all sends wi ll hav e a * ’ \ n ’ postpended. */
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id readMsg( i nt port , cha r *msg , int ma x L en ) {
ch ar buf [128];
if (port ) {
sp r i n t f (buf , " CO N N %x ,’%s ’\n" , port , ESCAPEKE Y );
sen d S t r i n g (buf ); /* co n n e c t to the port */
rec v S t r i n g (ms g , maxLen ) ;
sen d S t r i n g ( E SCAPEKEY ); /* end connection */ } els e {
rec v S t r i n g (ms g , maxLen ) ; }
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id sendMsg( i nt port , cha r *msg ) {
ch ar buf [256]; if (strlen( m sg ) > 12 8 ) retu r n ; /* er r or ! */
if (port = = 0) {
st r c p y (buf , msg );
st r c a t (buf ,"\n");
sen d S t r i n g (buf ); } els e {
sp r i n t f (buf , " SN D T %x ,#3%03 d%s\n " , p ort , strle n (msg), m sg ) ;
sen d S t r i n g (buf ); }
}
SIM900 Mainframe
3.4 Combination Example 3 – 19
/* ***** * * * * * * * ** * * ** * ** * * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * *
* low level I/ O funct i o n s : * op e n M a i n f r a m e () -- open communications ch annel , and in i t i a l i ze * mai n f r a m e & mo dules * cl o s e M a i n f r a m e () - close co m m u n i c a t i o n s c h a n n el * se n d S t r ing () -- --- transmit a null - te r m i n a t e d string * re c v S t r ing () -- --- receive da ta int o a null - t e r m i n a t e d string */
st a t i c ViSession defaul t R M ; st a t i c ViSession in s t r ; st a t i c ViStatus st a t u s ; st a t i c ViUInt32 ret C o u n t ; st a t i c ViUInt32 write C o u n t ;
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
in t openMainframe ( vo i d ) {
V i U I n t 1 6 itype;
in t i; ch ar buf [32];
st a t u s =viOpenDefaultRM (& defaultRM ); if (status < V I _ S U C C E S S ) {
pr i n t f (" Cou l d not open a s e s s i o n \n ");
ex i t (EXIT_FAILURE ); }
st a t u s = viOpen (d e f aultRM , VI SARESOURCE , VI_N ULL , VI_NUL L , &instr ); if (status < V I _ S U C C E S S ) {
pr i n t f (" Cannot op en a session to the devi c e .\ n");
st a t u s = viClose ( in str );
st a t u s = viClose ( de f a u l t R M );
ex i t (EXIT_FAILURE ); }
/* Set timeout va l u e */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _TMO_VALUE , VI S A T I M E O U T );
/* Set interf a ce - sp e c i f i c config . (RS -2 3 2 or GPIB ...) */
st a t u s = vi G e t A t t r i b u t e (ins tr , VI _ A T T R _INTF_TYPE , &i t y pe );
if (itype == VI _ I N T F _ A S R L ) { /* int e r f a c e is RS - 2 3 2 */
/* transmit se r i al BREAK to re set SIM9 0 0 host in t e r f a c e */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _END_OUT , VI_ASRL_END_BREAK );
st a t u s = viWrite (i nst r , (ViBuf) buf , 0, &writeCount );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _END_OUT , VI_ASRL_END_NONE );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ASRL_BAUD , DE F A U L T B A U D );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _ D A T A _ B ITS , 8) ;
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S RL_PARITY , VI_ASRL_PAR_NONE );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ A S R L _ S T O P _ B ITS , VI_AS R L _ S T O P _ O N E );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ T E RMCHAR_EN , VI_ T R U E );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R_TERMCHAR , 0xA ) ;
SIM900 Mainframe
3 – 20 Communications Examples
} els e if ( itype == VI _ I N T F _ G P I B ) { /* interface is GP I B */
st a t u s = viClear ( in str ); /* clear SI M 9 0 0 hos t i n t e r f ace */
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ T E RMCHAR_EN , VI _ F A L S E );
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ S U P P R E S S _ E N D _ E N , VI_FALSE ) ;
st a t u s = vi S e t A t t r i b u t e (ins tr , VI _ A T T R _ S E ND_END_EN , VI_ T R U E ); } sen d S t r i n g ("* RST\ n " ); /* SI M 9 0 0 default */ sen d S t r i n g (" VERB 127\ n " ); /* en a b l e E avesdrop */ sen d S t r i n g (" CEOI ON \ n " ); /* conve r t EOI ’ s (fo r GPIB ) */ sen d S t r i n g (" EOIX ON \ n " );
fo r (i=1; i < = 0 xb ; + + i) { /* set po r ts to 9600 baud */
sp r i n t f (buf , " BA U D %x ,9600\ n" , i);
sen d S t r i n g (buf ); } sen d S t r i n g (" TERM D, L F \ n " ); /* set SIM 9 0 0 to LF term */ sen d S t r i n g (" FLSH\ n " ); /* fl u sh all port bu f f ers */ sen d S t r i n g (" SRST\ n " ); /* re s et module i n t e r f a c e s */ re t u r n 0;
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id closeMainframe (voi d ) {
st a t u s = viClose ( in str ); st a t u s = viClose ( de f a u l t R M );
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id sendString ( ch ar *m s g ) {
st a t u s = viWrite (i nst r , (ViBuf) msg , st r l e n (msg ), & writeCoun t );
}
/* ***** * * * * * * * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * ** * * ** * * ** * ** * * ** * * ** */
vo id recvString ( ch ar *msg , int size ) {
st a t u s = viRead ( i nstr , msg , s ize -1 , & re t C o u n t ); if (retCount == 0) ms g [0] = ’\0 ’;
}
SIM900 Mainframe
4 Parts Lists and Schematics
This chapter provides a brief description of the circuitry for the SIM900.
In This Chapter
4.1 Circuit Descriptions . . . . . . . . . . . . . . . . . . 4 – 2
4.1.1 Power Distribution . . . . . . . . . . . . . . . 4 – 2
4.1.2 Microcontroller Board . . . . . . . . . . . . . 4 – 3
4.1.3 Backplane Board . . . . . . . . . . . . . . . . 4 – 3
4.1.4 Power Supply Controller Board . . . . . . . . 4 – 4
4.1.5 Power Supply Mezzanine Board . . . . . . . 4 – 4
4.1.6 Rear Panel Board . . . . . . . . . . . . . . . . 4 – 4
4.1.7 Front Panel Board . . . . . . . . . . . . . . . . 4 – 5
4.1.8 GPIB Option Board . . . . . . . . . . . . . . . 4 – 5
4.2 Parts Lists . . . . . . . . . . . . . . . . . . . . . . . . 4 – 6
4.2.1 Microcontroller and GPIB Boards . . . . . . . 4 – 6
4.2.2 Backplane Board . . . . . . . . . . . . . . . . 4 – 7
4.2.3 Front and Rear Panel Boards . . . . . . . . . 4 – 7
4.2.4 Power Supply Controller Board . . . . . . . . 4 – 8
4.2.5 Power Supply Mezzanine Board . . . . . . . 4 – 8
4.3 Schematic Diagrams . . . . . . . . . . . . . . . . . . 4 – 8
4 – 1
4 – 2 Circuitry
4.1 Circuit Descriptions
The SIM900 is assembled from 6 (optionally 7) independent printed circuit boards. The boards are interconnected with board-to-board header connectors, as shown in Figure 4.1. Note that in this chapter, page references are to the 21-sheet schematics pages at the end of the manual.
4.1.1 Power Distribution
Figure 4.1: The SIM900 circuit board arrangement.
The internal distribution of power supply voltages within the SIM900 is somewhat involved. AC line power is converted to 24 VDC by the universal input power supply, located at the left side of the main­frame (in front of the power entry module on the rear panel). Note that this voltage (labeled +24US on the schematics) is always on whenever AC line voltage is present.
The unswitched 24 VDC power comes across the top of the module slots, and plugs into the power supply controller board at JP101 (schematic page 14 of 21). It routed from there up to the power
SIM900 Mainframe
4.1 Circuit Descriptions 4 – 3
supply mezzanine board, to the microcontroller board, and to the front panel board.
Two additional cable assemblies plug into the power supply con­troller board, at JP202 & JP203 (page 15); these carry all DC power for distribution to connected SIM modules.
4.1.2 Microcontroller Board
The microcontroller board (pages 1–6, labelled “µ-ctrl” in Figure 4.1) is the central control circuit for the SIM900. The microcontroller (U103) coordinates all functions of the SIM900 except for power. The microcontroller operates with an external 16-bit address bus, and an independent 8-bit data bus, with muliple address spaces defined by independent chip select lines (CSGPIB, CSUARTS,
CSRAM, CSROM). Firmware is stored in o-chip rom (U302), and port data is buered in the o-chip ram (U301). Direct board-to­board header/socket interfaces connect the microcontroller board to the front panel board (via JS103), the backplane board (via JP601), the rear panel board (via JP602), and the power supply controller board (via JP603).
4.1.3 Backplane Board
The clock circuit (page 2) is based on a 20 MHz crystal operated in a classic Colpitts oscillator with varactor tuning to create a VCXO. The tuning voltage is selected by U206 between a fixed DC voltage from R222, or the PLL output voltage generated by U207 and filtered at U205B. When operating in PLL mode, U207 is programmed to mix the the oscillator and reference signals at 1 MHz. U202A divides the oscillator output to produce complementary ±10 MHz signals for distribution throughout the system.
U201 buers the 10 MHz clocks for distribution to the SIM mod­ules; ±10MHZ DIST go the the back plane board for slots 1–8, while ±10MHZ RMT goes to the rear panel for port 9. EN CLOCKS (generated by U103) enables or disables this clock.
U204, together with U202B, further divide the clock to produce the 200 kHz synch signal for the power supply controller board (CLK PSSYNC), and the 5 MHz GPIB clock.
U402 is the quad UART controller for ports A–D (the true RS-232 ports).
The backplane board(pages 8–13) distributes power, data, and clocks to 8 internal SIM ports. JP101 (page 8) is the main interconnect, mating with JP601 (page 6) on the microcontroller board. The data and address bus, along with some control signals, are also passed
SIM900 Mainframe
4 – 4 Circuitry
through to the (optional) GPIB board via JS103 (located near the top of the backplane board).
Serial communication with ports 1–8 are managed by two quad UARTS (U201, U202, page 9). Power is distributed along the back­plane on inner planes, with separate decoupling at each slot directly before the DB–15 connectors.
4.1.4 Power Supply Controller Board
The power supply controller board (pages 14–16, labelled “P/S ctrl” in Figure 4.1), produces the DC operating voltages (±5 V, ±15V) from the incoming +24 V power supply. The incoming +24 V connects to JP101 (page 14, located near the “front panel” edge of the board); note that the negative return is not grounded, but drops below ground by the IR drop across R101, a 0.01 current sense resistor.
The DC-DC converter uses the transformer and diode bridges on the power supply mezzanine to produce unregulated ±8 V & ±18 V DC power, which is then linearly regulated to produce the final volt­ages. The center-tapped primary side of the tranformer is driven at 100 KHz by alternately pulling the two ends of the primary winding to ground through Q101 & Q102. Voltage ordering for start-up and fault protection is provided by D201–D206. The +24 V power to SIM modules is not re-generated by the DC-DC converter, but is switched with the other power rails, by the combination of U209 & Q201 (to ensure soft-starting of the power).
The main interconnect to the microcontroller board is via JS301 (which mates with JP603). Prior to the oscillator stabilizing, the switching controller (U104) self-clocks based on the time-constant set by R107 & C109.
The overvoltage/overcurrent detection circuit (page 16) is powered by the unswitched +5US power, derived linearly from +24US. The
TRIP signal shuts down U104, and requires a new rising edge on PWRSW 24 (the front-panel toggle switch) to clear the trip.
4.1.5 Power Supply Mezzanine Board
The power supply mezzanine board (page 17, labelled “P/S mez” in Figure 4.1) holds the large components of the power supply, namely the input filter, transformer, diode bridges, and post-rectifier filters.
4.1.6 Rear Panel Board
The rear panel board (pages 18–20) holds the Port 9 SIM connector, and the 4 DB–9 RS-232 connectors. The external timebase reference
SIM900 Mainframe
4.1 Circuit Descriptions 4 – 5
input (rear-panel BNC) is wired to this board (at J101), which passes the reference to the microcontroller board for the PLL circuit.
Line drivers and receivers are populated on this board, butthe UARTs for the RS-232 ports are located on the microcontroller board (U402, page 4). The remote SIM port uses the internal serial controller interface of the microcontroller for its UART function.
4.1.7 Front Panel Board
The front panel board (page 21) holds the display LEDs for the SIM900. Note that most indicators are driven statically from shift registers U401, U402, U403. The STANDBY and TRIP leds, however, must be directly driven by lines driven by the power supply con­troller board, since VCC is not powered when these indicators are lit.
The cooling fan is controlled by the FAN CTRL signal, which is also generated on the power supply controller board, and is proportional to the total power consumption of the SIM900.
4.1.8 GPIB Option Board
The GPIB option board (page 7) contains the GPIB controller chip and transceivers for the IEEE-488 bus. This board (not shown in Figure 4.1) plugs horizontally into the socket (JS103, page 8) located at the top of the backplane board. Use care when installing this board to ensure that the pins are correctly registered and mated (an inspection mirror can be helpful).
SIM900 Mainframe
4 – 6 Circuitry
Reference SRS P/N Part Value Reference SRS P/N Part Value C101,C102,C103,C104,C105, 5-00299 0.1U R213,R225 4-01471 470
C201,C205,C206,C207,C217, R216,R217,R219,R220 4-01184 4.99K C218,C219,C220,C221,C222, R222 4-00923 10K-POT C223,C224,C301,C302,C403, R224,R236 4-01355 301K C404,C405,C701,C702,C703 R228 4-01230 15.0K C202 5-00381 330P R229 4-01213 10.0K C204,C203 5-00373 68P R233,R234 4-01405 1.00M C208,C209,C211,C212 5-00387 1000P R237 4-01317 121K C210,C213 5-00379 220P R401 4-01405 1.00M C214 5-00371 47P R402,R403,R404,R405 4-01503 10K C215 5-00306 .033U R406,R407 4-01503 10K C216 5-00363 10P RN201 4-01704 100Kx4 C401,C402 5-00369 33P S601 2-00014 SPSTx8 D201 3-00803 MMBV609LT1 SO U302 1-00514 PLCC32 SOCKET D202,D203 3-00945 BAT54S U101 3-00902 74HC00 JP101 no pop. HEADER_3X2 U102 3-00903 MAX6348UR44T JP102 1-00086 3 PIN SI U103 3-00904 68HC812A4 JP201 no pop. HEADER_3 U201 3-00905 74HC240 JP601 1-00490 SOCKET_20X2 U202 3-00742 74HC74 JP602 1-00491 SOCKET_14X2 U203 3-00741 74HC04 JP603 1-00512 HEADER 7X2 U204 3-00906 74HC390 JP701 1-00493 HEADER 13X2 U205 3-00907 LM324 JS103 1-00513 SOCKET 5X2 U206 3-01367 DG419DY JS701 1-00160 GPIB CONNECTOR U207 3-00909 MC145157DW2 Q201 3-00808 MMBR5179LT1 U208 3-00653 AD8561 R101,R102,R103,R104,R105, 4-01503 10K U301 3-00910 UPD43256BGU-70LL R106,R107,R108,R109,R110, U302 3-00911 AT27C512R-70JC R111,R112,R113 U401 3-00662 74HC14 R201,R202,R223 4-01021 100/1% U402 3-00912 TL16C754BPN R203 4-00982 39.2 U403 3-00743 74HC138 R204,R205,R230,R231,R232 4-01117 1.00K U701 3-00914 NAT9914APL R206,R207,R208,R227 4-01309 100K/1% U702 3-00915 SN75ALS160DW R209,R218,R221 4-01355 301K U703 3-00916 SN75ALS161DW R210 4-01338 200K/1% Y201 6-00325 20.000MHZ R211,R212,R214,R215 4-01455 100 Y401 6-00507 22.1184MHZ
4.2 Parts Lists
The parts lists are separated by the internal (SRS) assembly kit, which consist of one or two boards each.
4.2.1 Microcontroller and GPIB Boards
SIM900 Mainframe
4.2 Parts Lists 4 – 7
Reference SRS P/N Part Value Reference SRS P/N Part Value C201,C202,C203,C315,C316, 5-00299 0.1U R301,R303,R305,R307,R309, 4-01479 1.0K
C415,C416,C515,C516,C615, R310,R312,R313,R315,R317, C616 R319,R321,R322,R324,R401, C301,C302,C308,C309,C401, 5-00298 0.01U R403,R405,R407,R409,R410, C402,C408,C409,C501,C502, R412,R413,R415,R417,R419, C508,C509,C601,C602,C608, R421,R422,R424,R501,R503, C609,C617 R505,R507,R509,R510,R512, C303,C304,C305,C306,C307, 5-00102 4.7U/35T R513,R515,R517,R519,R521, C310,C311,C312,C313,C314, R522,R524,R601,R603,R605, C403,C404,C405,C406,C407, R607,R609,R610,R612,R613, C410,C411,C412,C413,C414, R615,R617,R619,R621,R622, C503,C504,C505,C506,C507, R624 C510,C511,C512,C513,C514, R302,R304,R314,R316,R402, 4-01455 100 C603,C604,C605,C606,C607, R404,R414,R416,R502,R504, C610,C611,C612,C613,C614 R514,R516,R602,R604,R614, JP101 1-00495 HEADER_20X2 R616,R625,R626 JS102 1-00496 HEADER_6 R306,R308,R311,R318,R320, 4-01527 100K JS103 1-00497 SOCKET_13X2 R323,R406,R408,R411,R418, JS301,JS302,JS401,JS402, 1-00484 DB15F R420,R423,R506,R508,R511, JS501,JS502,JS601,JS602 R518,R520,R523,R606,R608, L301,L302,L303,L304,L305, 6-00174 BEAD R611,R618,R620,R623 L306,L307,L308,L309,L310, U202,U201 3-00912 TL16C754BPN L401,L402,L403,L404,L405, U203 3-00743 74HC138 L406,L407,L408,L409,L410, U301,U302,U401,U402,U501, 3-00662 74HC14 L501,L502,L503,L504,L505, U502,U601,U602 L506,L507,L508,L509,L510, L601,L602,L603,L604,L605, L606,L607,L608,L609,L610
Reference SRS P/N Part Value Reference SRS P/N Part Value C202,C201 5-00298 0.01U L202,L203,L204,L205,L206 6-00174 BEAD
C203,C204,C205,C206,C207, 5-00382 390P Q401 3-00644 TIP48/TIP47 C301,C302,C303,C304,C305, R101,R201,R203 4-01021 100/1% C306,C307,C308 R202,R204,R205,R208,R211, 4-01479 1.0K C208,C209,C210,C211,C212 5-00102 4.7U/35T R213,R215 C213,C214,C309,C401,C402, 5-00299 0.1U R209,R206,R217 4-01527 100K C403 R207,R210,R212,R214,R216 4-01455 100 C404 5-00102 4.7U/35T R301,R303,R305,R307 4-01503 10K D401,D402,D404,D405,D407, 3-00424 LED-G
R302,R304,R306,R308 4-01496 5.1K
D409,D410,D411,D412,D413,
R401,R402,R403,R404,R405, 4-01469 390
D414,D416,D417,D418,D419,
R406,R407,R408,R409,R410,
D420,D421,D422,D423,D425,
R411,R412,R413,R414,R415,
D426
R416,R417,R418,R419,R422, D406,D408,D415,D424 3-00425 LED-R R423,R425,R426 D427 3-00973 1N4742A R424 4-01435 15 JP101 1-00503 HEADER_14X2 S401 2-00049 SW_SPST JP301,JP302 1-00486 DB9M U201 3-00905 74HC240 JP401 1-00511 HEADER 5X2 U202 3-00662 74HC14 JS102 1-00496 HEADER6 U301,U304 3-00923 MC1488D JS201 1-00487 DB15F U303,U302 3-00924 MC1489D JS304,JS303 1-00485 DB9F U401,U402,U403 3-00925 74HC164 J101 1-00003 BNC Z401 0-00158 FAN, 60MM 24V L201 6-00512 CM BEAD
4.2.2 Backplane Board
4.2.3 Front and Rear Panel Boards
SIM900 Mainframe
4 – 8 Circuitry
Reference SRS P/N Part Value Reference SRS P/N Part Value C101,C102,C103 5-00318 2.2U/T35 R302 4-01047 187
C104,C107,C301,C304,C306 5-00299 0.1U R303 4-01123 1.15K C105,C106,C109 5-00387 1000P R304,R307,R308,R315 4-01213 10.0K C108,C201,C202,C203,C204, 5-00318 2.2U/T35 R305 4-01146 2.00K C205,C206,C219,C302 R306 4-01122 1.13K C207,C208,C211,C212 5-00514 100U/35V/FC R309,R316,R317,R318,R333 4-01519 47K C209,C210,C213,C214 5-00319 10U/T35 R328,R310 4-01527 100K C215,C216,C217,C218 5-00299 .1U R319 4-01224 13.0K C220 5-00471 10U/T16 R320 4-01114 931 C305,C303 5-00375 100P R323 4-01188 5.49K C307 5-00299 .1U R324 4-01130 1.37K C309,C308 5-00375 100P R327 4-01541 390K D201,D202,D203,D204,D205, 3-00625 MBR1535CT R331 4-00954 20 D206 R334 4-01251 24.9K JP101 1-00250 HEADER_2 R335 4-01145 1.96K JP102 1-00498 HEADER_4 R336 4-01309 100K/1% JP201 1-00499 HEADER_8 R337 4-01278 47.5K JP202,JP203 1-00111 HEADER_6 R338 4-01142 1.82K JS301 1-00331 SOCKET 7X2 R339 4-01294 69.8K Q102,Q101 3-00283 IRF530 U101 3-00114 LM340-15 Q201 3-00944 IRF4905 U102 3-00112 LM340-5 R101 4-00924 0.01 U103 3-00918 AD820 R102,R104,R314,R332 4-01117 1.00K U104 3-00919 SG3525AP R103,R105 4-01309 100K/1% U201 3-00112 LM340-5 R106,R311,R312,R313,R329, 4-01479 1.0K U202 3-00346 LM340-12 R330 U203 3-00330 LM320-12 R107 4-01201 7.50K U204 3-00384 LM350 R109,R108 4-00971 30.1 U205,U207 3-00920 LT1033 R201,R202,R209,R210 4-01021 100/1% U206 3-00921 LM338 R203,R204,R211,R212 4-01614 10-POT U209 3-00922 IPS511 R205,R206,R207,R208 4-01152 2.32K U301,U305,U306 3-00727 LM339 R213,R214 4-01068 309 U302 3-00662 74HC14 R221 4-01507 15K U303 3-00742 74HC74 R222,R223 4-01511 22K U304 3-00902 74HC00 R301 4-01184 4.99K U307 3-00804 74HC4066
Reference SRS P/N Part Value Reference SRS P/N Part Value C2,C1 5-00515 1500U/35V/FC JS1 1-00501 SOCKET_4
C3,C4 5-00516 330U/35V/FC JS2 1-00502 SOCKET_8 C6,C5 5-00517 1000U/35V/FC L1,L4,L5 6-00509 47.7UH C7,C8,C9,C10 5-00143 1200P/1000V L2,L3 6-00510 80.7UH D1,D2,D3,D4,D5,D6,D7,D8 3-00479 MUR410 T1 6-00511 MF XFORMER revB D1,D2,D3,D4,D5,D6,D7,D8 6-00528 BEAD
4.2.4 Power Supply Controller Board
4.2.5 Power Supply Mezzanine Board
4.3 Schematic Diagrams
Schematic diagrams follow this page.
SIM900 Mainframe
Loading...