37
J640 2192-10680-000-000 Page 1 MERLIN (ROM-DOS/Sockets) Technical Manual Product Information Full information about other Arcom products is available on our WebSite at: www.arcomcontrols.com Useful Contact Information Customer Support Europe Customer support US Tel: +44 (0)1223 412 428 Fax: +44 (0)1223 403 409 E-mail: [email protected] Tel: 816 941 7025 Fax: 816 941 7807 E-mail [email protected] Sales offices: United Kingdom: Arcom Control Systems Ltd Clifton Road Cambridge CB1 7EA, UK Tel: 01223 411 200 Fax: 01223 410 457 E-mail: [email protected] United States: Arcom Control Systems Inc 13510 South Oak Street Kansas City MO 64145 USA Tel: 816 941 7025 Fax: 816 941 0343 E-mail: [email protected] Sales Hotlines: Belgium: Groen Nummer: Tel: 0800 7 3192 Fax: 0800 7 3191 France: Numero Vert Tel: 0800 90 84 06 Fax: 0800 90 84 12 Germany: Kostenlose Infoline: Tel: 08001 824 511 Fax: 08001 824 512 Netherlands: Gratis 0800 Nummer: Tel: 0800 0221136 Fax: 0800 0221148 Italy: Numero Verde: Tel: 0800 790841 Fax: 0800 780841 Whilst Arcom’s sales team is always available to assist you in making your decision, the final choice of boards or systems is solely and wholly the responsibility of the buyer. Arcom’s entire liability in respect of the boards or systems is as set out in Arcom’s standard terms and conditions of sale. If you intend to write your own low-level software, you can start with the source code on the disk that is supplied. This is example code only to illustrate use on Arcom’s products. It has not been commercially tested. No warranty is made in respect of this code and Arcom shall incur no liability whatsoever or howsoever arising from any use made of the code. © 2001 Arcom Control Systems Ltd All trademarks recognized. Arcom Control Systems Ltd operate a company-wide quality management system which has been certified by the British Standards Institution (BSI) as compliant with ISO9001:1994

MERLIN Tech ManualB

Embed Size (px)

Citation preview

Page 1: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 1

MERLIN (ROM-DOS/Sockets)

Technical Manual

Product Information Full information about other Arcom products is available on our WebSite at: www.arcomcontrols.com Useful Contact Information Customer Support Europe Customer support US

Tel: +44 (0)1223 412 428 Fax: +44 (0)1223 403 409 E-mail: [email protected]

Tel: 816 941 7025 Fax: 816 941 7807 E-mail [email protected]

Sales offices: United Kingdom: Arcom Control Systems Ltd Clifton Road Cambridge CB1 7EA, UK Tel: 01223 411 200 Fax: 01223 410 457 E-mail: [email protected]

United States: Arcom Control Systems Inc 13510 South Oak Street Kansas City MO 64145 USA Tel: 816 941 7025 Fax: 816 941 0343 E-mail: [email protected]

Sales Hotlines: Belgium: Groen Nummer: Tel: 0800 7 3192 Fax: 0800 7 3191 France: Numero Vert Tel: 0800 90 84 06 Fax: 0800 90 84 12

Germany: Kostenlose Infoline: Tel: 08001 824 511 Fax: 08001 824 512 Netherlands: Gratis 0800 Nummer: Tel: 0800 0221136 Fax: 0800 0221148

Italy: Numero Verde: Tel: 0800 790841 Fax: 0800 780841

Whilst Arcom’s sales team is always available to assist you in making your decision, the final choice of boards or systems is solely and wholly the responsibility of the buyer. Arcom’s entire liability in respect of the boards or systems is as set out in Arcom’s standard terms and conditions of sale. If you intend to write your own low-level software, you can start with the source code on the disk that is supplied. This is example code only to illustrate use on Arcom’s products. It has not been commercially tested. No warranty is made in respect of this code and Arcom shall incur no liability whatsoever or howsoever arising from any use made of the code.

© 2001 Arcom Control Systems Ltd All trademarks recognized.

Arcom Control Systems Ltd operate a company-wide quality management system which has

been certified by the British Standards Institution (BSI) as compliant with ISO9001:1994

Page 2: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 2

Contents 1 Revision History ........................................................................................................................................ 4 2 Preface ....................................................................................................................................................... 5

2.1 Scope of this Manual ............................................................................................................................. 5 2.2 Name Conventions ................................................................................................................................ 5 2.3 Contents-Packing list ............................................................................................................................. 5 2.4 CD-ROM................................................................................................................................................ 5 2.5 Anti-Static Handling ............................................................................................................................... 6 2.6 Electromagnetic Compatibility (EMC)..................................................................................................... 6 2.7 Packaging.............................................................................................................................................. 6 2.8 Acknowledgements and Licensing ......................................................................................................... 6 2.9 Disclaimer.............................................................................................................................................. 6 2.10 Battery ................................................................................................................................................. 6

3 Introduction................................................................................................................................................ 7 3.1 Features ................................................................................................................................................ 7 3.2 Getting Started....................................................................................................................................... 7 3.3 Technical Overview................................................................................................................................ 8

4 Chip Selects and Interrupts ...................................................................................................................... 9 5 Memory Map............................................................................................................................................... 9 6 Links ......................................................................................................................................................... 11

6.1 Top view link settings (factory default) ................................................................................................. 12 7 On-board Functions................................................................................................................................. 13

7.1 COM1 .................................................................................................................................................. 13 7.2 COM2 .................................................................................................................................................. 13

7.2.1 COM2 Communications Modes ................................................................................................ 13 7.3 COM3 .................................................................................................................................................. 16 7.4 Ethernet Port........................................................................................................................................ 16 7.5 Real Time Clock .................................................................................................................................. 16 7.6 Software Watchdog.............................................................................................................................. 16 7.7 Battery ................................................................................................................................................. 17 7.8 Unique Electronic ID ............................................................................................................................ 17 7.9 LED’s................................................................................................................................................... 17 7.10 SRAM ................................................................................................................................................ 18 7.11 FLASH............................................................................................................................................... 18

7.11.1 PRE-INSTALLED FILES......................................................................................................... 18 7.11.2 FLASH CORRUPTION ........................................................................................................... 19

7.12 FACTORS AFFECTING MERLIN PERFORMANCE.......................................................................... 19 7.12.1 FLASH SPACE....................................................................................................................... 19 7.12.2 SOCKETS .............................................................................................................................. 20 7.12.3 SERIAL COMMUNICATIONS................................................................................................. 20 7.12.4 DRAM DISK DRIVE................................................................................................................ 20

8 Power Supply........................................................................................................................................... 22 8.1 Power Input Circuit............................................................................................................................... 22 8.2 Development Kit Power Supply............................................................................................................ 22

9 Appendix A - Connections ...................................................................................................................... 23 9.1 PL1 - IO Port........................................................................................................................................ 23 9.2 PL2 - JTAG/TAPFLASH (factory use only)........................................................................................... 23 9.3 PL3 - COM1 and COM2 (serial communications ports)........................................................................ 23 9.4 PL4 - Ethernet (10Base-T) ................................................................................................................... 24 9.5 PL5 - COM3 (RS-232 serial port) ......................................................................................................... 24 9.6 PL6 - Power connector ........................................................................................................................ 24

10 Appendix B - IO Mapping ...................................................................................................................... 25 10.1 I/O Address Table .............................................................................................................................. 25

Page 3: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 3

10.2 IRQ Interrupt Mappings...................................................................................................................... 25 10.3 386EX Port Pin Assignments ............................................................................................................. 26 10.4 Memory Page Address Register (/CS1) ............................................................................................. 26

11 Appendix C - BIOS settings and support ............................................................................................. 27 11.1 Entering BIOS Setup.......................................................................................................................... 27 11.2 BIOS Settings .................................................................................................................................... 27 11.3 OEM Interrupt Support Calls .............................................................................................................. 28 11.4 RTC BIOS functions........................................................................................................................... 28 11.5 Start-up Options................................................................................................................................. 29

12 Appendix D - SOFTWARE ..................................................................................................................... 30 12.1 ARCOM MERLIN SOFTWARE LIBRARY.......................................................................................... 30

12.1.1 MERLIN I/O Functions: ........................................................................................................... 30 12.1.2 IDTAG Functions .................................................................................................................... 31 12.1.3 RTC Functions........................................................................................................................ 31 12.1.4 RTC Defines ........................................................................................................................... 32 12.1.5 RTC NVRAM Defines ............................................................................................................. 34

12.2 RE-INSTALLING FLASH BINARY IMAGE......................................................................................... 34 12.3 CREATING YOUR OWN BINARY IMAGE......................................................................................... 35

13 Appendix E - Dimensional Information ................................................................................................ 37

Page 4: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 4

1 Revision History

Manual PCB Comments Issue A V1 Iss1 050201 First release of manual Issue B V1 Iss1 150301 [ECO 2957] Minor alterations

Page 5: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 5

2 Preface

2.1 Scope of this Manual This manual details the operation and use of the MERLIN board. It has been designed as both a reference and a user manual and includes information on using all aspects of the board.

2.2 Name Conventions Throughout this document a forward slash ‘/’ prefix denotes that a signal is active low (e.g. /READ). All numbers are in decimal unless otherwise indicated. Where a number is suffixed by ‘H’, the value is in hexadecimal format.

2.3 Contents-Packing list You should have this manual as part of the MERLIN ROM-DOS/Sockets Development Kit. In your development kit you should have:

• MERLIN-SE single board computer pre-installed with BIOS, ROM-DOS 6.22 and Sockets 2.xx

• Document titled ‘MERLIN Quickstart Manual’

• Mains voltage to +12V DC power supply complete with 3 plugs to allow use world-wide

• Crossover Ethernet cable

• 20-way header to 2 x 9-way D-type ribbon cable

• ‘Null-modem’ RS-232 serial comms cable

• Reset cable with push button

• CD-ROM titled ‘MERLIN Development Kit CD-ROM’, containing this document. Further details are given below

2.4 CD-ROM The MERLIN ROM-DOS/Sockets Development Kit CD-ROM contains the following:

• MERLIN software libraries

• Electronic copies of this manual and the MERLIN ROM-DOS/Sockets Quickstart Manual

• Datalight ROM-DOS 6.22 and Sockets 2.xx documentation

• Datalight ROM-DOS and Sockets utilities

• Electronic copy of the ‘Intel 386EX Embedded Microprocessor User Manual’

• Datasheets (in PDF format) of the main devices used on the MERLIN

• Binary image of the default FLASH program pre-installed

The development kit Quickstart manual gives full details on the installation of software contained on this CD-ROM.

Page 6: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 6

2.5 Anti-Static Handling This board contains CMOS devices that could be damaged in the event of static electricity being discharged through them. At all times, please observe anti-static precautions when handling the board and always unpack and install it in an anti-static working area.

2.6 Electromagnetic Compatibility (EMC) The MERLIN is classified as a component with regard to the European Community EMC regulations and it is the user’s responsibility to ensure that systems using the board are compliant with the appropriate EMC standards.

2.7 Packaging Please ensure that should a board need to be returned to Arcom, it is adequately packed. Use an anti-static bag for the board and use a box, not bag, to physically protect the board. An anti-static bag is not required if the board is being returned in the original development kit box, which has an anti-static foam interior.

2.8 Acknowledgements and Licensing The MERLIN product is supplied as standard with fully licensed copies of Datalight’s BIOS, FlashFX, ROM-DOS 6.22 and Sockets 2.xx (network communications application) products. These have been configured for use on the MERLIN (DOS) and MERLIN-SE (DOS) boards and cannot be copied or used on any other platform without the written permission of both Arcom Control Systems and Datalight. A copy of all the software and utilities is included on the development kit CD. This is exclusively provided as a backup copy for the software installed on the MERLIN product and for installation on a host PC for the user’s MERLIN software development. FlashFX is a trademark of Datalight Inc.

2.9 Disclaimer The information in this manual has been carefully checked and is believed to be accurate. Arcom Control Systems assumes no responsibility for any infringements of patents or other rights of third parties that may result from its use. Arcom Control Systems assumes no responsibility for any inaccuracies that may be contained in this document. Arcom Control Systems makes no commitment to update or keep current the information contained in this manual. Arcom Control Systems reserves the right to make improvements to this document and/or product at any time and without notice.

2.10 Battery The board contains a Lithium-ion rechargeable battery. Do not short-circuit the battery or place on a metal surface where the battery terminals could be shorted. The top surface of the battery is live. During shipment the battery is isolated from the board's circuitry and should be connected before using the board. Please refer to the link section of this manual for details (section 7). When disposing of the board or battery, take appropriate care. Do not incinerate, crush or otherwise damage the battery.

Page 7: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 7

3 Introduction

The MERLIN is a single board computer with comprehensive networking capabilities and pre-installed operating system, flash filing system, TCP/IP stack and communications utilities. The board is based on the Intel 80386EX embedded processor and has 2MBytes of DRAM and 1MBytes of FLASH memory as standard. There are two variants of the board: MERLIN-SE Single board computer with 2MB DRAM, 1MB FLASH, 512KBytes of SRAM MERLIN Single board computer with 2MB DRAM, 1MB FLASH, no SRAM The 512KByte SRAM on the MERLIN-SE variant is battery backed, as is the Real Time Clock (present and battery backed on both variants).

3.1 Features • Intel 386EX 25MHz processor

• 2Mb DRAM

• 1Mb Flash, configured as 8 pages of 128Kbytes

• Datalight BIOS, ROM-DOS 6.22 and FlashFX flash filing system pre-installed in flash

• 512Kb SRAM battery backed, 32 pages of 16Kbytes (MERLIN-SE only)

• 10Base-T Ethernet port with link status LED

• Datalight Sockets network communications application (includes TCP/IP , FTP, HTTPD, PPP)

• COM1 RS-232 serial port via 20 way pin header (PL3)

• COM2 RS485/RS422 serial port via 20-way pin header (PL3)

• COM3 RS-232 serial port with full-handshaking via 9-way DSUB (male)

• Real Time Clock, battery backed

• Software watchdog with configurable timeout period

• Transmit and receive activity LED’s for COM1 and COM2

• User LED on board

• User-assigned jumper link

• Debug port for software development

• 9-18V DC and 10-16V AC power input ranges

• Power consumption, typical 350mA @ 12V DC

• Operating temperature range, -20°C to +60°C (+75°C without battery)

• MTBF 163,000 hours; calculated using generic figures from MIL-HDBK-217F at ground benign

3.2 Getting Started The MERLIN and this manual are supplied as part of a development kit, which includes everything that is required to start developing and running code on the board. To get started using the board, read the printed manual contained in the development kit: “MERLIN Quickstart manual”.

Page 8: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 8

3.3 Technical Overview The following sections describe in some detail the technical configuration of both the MERLIN and MERLIN-SE boards. Where this manual refers to the MERLIN, it will usually mean both the MERLIN and MERLIN-SE variants of the board. The MERLIN board is pre-loaded with all the necessary software to begin development. All the BIOS, ROM-DOS and FlashFX flash filing system software is located in the top 128KByte sector of the flash memory and is inaccessible when running ROM-DOS. The remaining flash memory is configured as the C: drive and operates as a standard disk drive. The SRAM memory on the MERLIN-SE board is the D: drive once it has been formatted (this requires the battery link to be fitted first – see section 7.10 SRAM). There are 880Kbytes of DRAM accessible in the lower 1MByte of PC DOS address space; the upper 1Mbyte of DRAM is accessible as extended memory. The 3 serial ports are accessible as standard DOS communications ports, although only COM3 has hardware handshaking support. If COM2 is configured as a 2 wire RS-485 port, the communications software must handle the RS-485 driver enable/disable. Note also that COM3 uses IRQ1, which is not supported by some DOS communications application software (it is fully supported by all software provided in the ROM-DOS/Sockets development kit). The Ethernet port is a standard NE2000 compatible network port. The port address and interrupt are however fixed at 300H and IRQ5 respectively. The Sockets software pre-installed provides access to this port using a large number of supported networking protocols such as TCP/IP, FTP and HTTPD.

Page 9: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 9

4 Chip Selects and Interrupts

The chip selects and interrupts external to the 386EX are routed as shown below. Internal 386EX mapping is determined by software. A full default configuration IO settings table, interrupt assignment table and port pin connections table are given in Appendix B.

Chip Select Interrupt pin Selects / Interrupt from

UCS - FLASH memory CS0 - DRAM memory CS1 - FLASH/SRAM page register CS2 - SRAM memory CS3 INT1 Ethernet CS4 INT2 IO port CS5 INT0 COM3 CS6 - Used for DRAM refresh

5 Memory Map There are three areas of memory on the MERLIN: • 2MBytes of DRAM • 1MByte of FLASH • 512KBytes of battery-backed SRAM (fitted on the MERLIN-SE only).

The FLASH memory area is located at the top of the 386EX-memory map and contains the restart vector executable code, the Arcom MiniMonitor application, Datalight BIOS and Datalight’s ROM-DOS and FlashFX BIOS extensions. FlashFX is a flash filing system that allows the Flash and SRAM memory to be used as a conventional disk drive. The default memory configuration for the MERLIN is with the 386EX processor in real mode and for a 1Mbyte memory space to be visible and mapped as shown in the diagram below (figure 1). The FlashFX flash filing system allows the unused memory areas in the FLASH device to be treated as a conventional application filing system. When running 16-bit applications, the logical memory map cannot exceed 1 MByte. For the upper 1MByte of DRAM memory to be available when running ROM-DOS, the HIMEM and EMM386 device drivers must be run. This will give 1904 KBytes of accessible DRAM. 144 KBytes of the lower 1MByte memory space is taken up for the paged Flash and SRAM windows. (See Figure 1.)

Page 10: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 10

Figure 1 - Default MERLIN Memory Map

880K DRAM 128K FLASH Page 0

0x00000 0xE0000 0xFFFFF

128K FLASH Page 1

128K FLASH Page 2

128K FLASH Page 3

128K FLASH Page 4

128K FLASH Page 5

128K FLASH Page 6

128K FLASH Page 7

16K SRAM

1Meg FLASH

512K SRAM

Logical Memory

Configuration

16K SRAM Page 0

0xD800

16K SRAM

16K SRAM

16K SRAM

16K SRAM

16K SRAM

16K SRAM

Page 8 16K SRAM

Page 1

Page 2

Page 3

Page 4

Page 5

Page 6

Page 7

16K SRAM

16K SRAM

16K SRAM

16K SRAM

16K SRAM

16K SRAM

Page 9

Page 10

Page

Page

Page 30

Page 31

1MB Extended Memory

Page 11: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 11

6 Links

Link1 - MiniMonitor (default is not fitted) Fit to boot up into MiniMonitor debug environment. When not fitted, code jumps to application start vector and runs the Datalight BIOS and loads the ROM-DOS operating system. It is normally only fitted when developing code for the MERLIN board in a non ROM-DOS environment. Link2 - User assigned link (default is not fitted) Link2 is user assigned. When not fitted, P1.7 is pulled high, when fitted, P1.7 is pulled low. Link3 - Reset header When the pins of link3 are shorted for greater than 40ms, the MERLIN is reset. The MERLIN reset cable provided in the development kit can be attached to this header to provide a convenient push-button reset during development. Link4 - Battery Connect (factory default is not fitted) When fitted, the battery is connected to the battery-backup circuit of the MERLIN. When not fitted, the battery is open circuit. Fit to ensure that the BIOS CMOS settings and the SRAM formatting and contents are saved when main power is removed. The default BIOS settings are loaded if link4 is not fitted during boot-up. Link5 and Link6 - Full-duplex/Half-duplex RS422/485 select (default is not fitted) When not fitted, COM2 is wired for 4-wire RS-422 or RS-485 full duplex communication. When fitted, the transmit and receive lines of COM2 are connected together for 2-wire RS-485 multidrop half duplex operation. Links 5 and 6 should either be both fitted or both not fitted. See section 7.2. Link7 - RS422/485 Termination Resistor (default is fitted) When fitted, a 120R resistor is connected across the differential receive lines of COM2.

Page 12: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 12

6.1 Top view link settings (factory default)

PL5

PL4

PL1

PL3

BAT1

PL6

PL1

D1

LK7

LK5LK6

D2

D3

D5

D6

D7

LK1LK2

LK4LK3

Page 13: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 13

7 On-board Functions The on-board communications features are extensively supported by the pre-installed software; providing remote file transfer, TCP/IP stack and rich network applications. Read the Datalight Sockets manual, the MERLIN development kit Quickstart manual and the Arcom example code contained on the development kit CD for further details on the supported features.

7.1 COM1 COM1 is an RS-232 serial port. COM1 is directly supported by the 386EX processor and has 16450 compatibility, supporting interrupt driven communications through the standard IRQ4 interrupt. COM1 on the MERLIN does not have provision for hardware handshaking signals except for /RTS and /CTS. It is accessed via PL3, a 20-way pin header. See Appendix A, section 9.3 for a full pin-out of PL3. The maximum baud rate supported is 115.2Kbaud. COM1 is used as the default console and file transfer port for ROM-DOS environment development. The cables provided in the MERLIN development kit allow connection between COM1 of the MERLIN and COM1 or COM2 of the user’s PC (host PC). Running HyperTerminal and setting it to use the appropriate COM port on the host PC allows keyboard input to and text output from the MERLIN board. Files can also be transferred using the RSZ file transfer utility installed on the MERLIN in conjunction with HyperTerminal’s Z-modem file transfer utility. Step-by-step instructions are given in the development kit Quickstart manual.

7.2 COM2 COM2 is link selectable between a 4-wire full-duplex RS422/485 and a 2-wire half-duplex RS485 serial communications port. It is directly supported by the 386EX processor and has 16450 compatibility. This port supports interrupt driven communications through the IRQ3 interrupt. The maximum baud rate supported is 115.2Kbaud. COM2 signals are non-isolated. In addition to the RS422 transmit and receive signals, COM2 provides two differential handshaking signals, /RTS(+/-) and /CTS(+/-). Full signal pin-out is shown in Appendix A, section 9.3.

7.2.1 COM2 Communications Modes In order to use the COM2 port on the MERLIN it must be configured for the communications mode that you intend to use. The MERLIN COM2 supports both RS422 and RS485 type differential communications. The RS422 and RS485 communications specifications actually define the electrical specification of the driver and receiver electronics and do not specify the mode of operation. However, the terms RS422 and RS485 are commonly used to imply the operating mode. RS422 is always a 4-wire full-duplex method of serial comms. RS485 generally exceeds the electrical specification for RS422 and can be either 4 wire full-duplex or 2-wire half-duplex comms. However, excluding drive capability and thus the number of allowable receivers on a loop, the major difference between RS485 and RS422 specifications is that RS485 was designed to allow half-duplex operation. Thus there are commonly 3 modes of operation to consider: 1. RS422/485 point-to-point (often called just RS422 point-to-point) 2. RS422/485 4-wire multi-drop (often referred to as RS422 multi-drop) 3. RS485 2-wire multi-drop (often called just RS485)

Page 14: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 14

The differences between each of the configurations are illustrated below: 7.2.1.1 Selecting the Appropriate Communication Mode If you are designing your own systems implementation from scratch, you will be able to select the appropriate type of communications standard for your system: RS422 point-point is a good way of connecting two pieces of equipment together as the differential communications system gives good noise immunity and the full duplex gives high speed. RS422 Multi-drop is suitable for systems where one piece of equipment is controlling a number of other pieces of equipment in a master/slave type relationship. The full duplex nature of the system provides for high speed communication. Be aware that the software must ensure that no two transmitters are driving the bus at once. The line drivers have protection circuitry in them to prevent damage occurring, but communications data will be lost.

Number of Wires 5 Transmitters Enabled always Receivers Enabled always Duplex Mode full LK5 not fitted LK6 not fitted

Number of Wires 5 Transmitters Enabled active RTS Receivers Enabled always Duplex Mode full LK5 not fitted LK6 not fitted

Number of Wires 3 Transmitters Enabled active RTS Receivers Enabled always Duplex Mode half LK5 fitted LK6 fitted

RS422 POINT-TO-POINT RS422 MULTI-DROP RS485 MULTI-DROP

Page 15: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 15

RS485 is also a multi-drop configuration and is ideal for peer-peer networking or for systems where cabling cost is large so there are advantages to be gained with a three wire system. Note again that the software must ensure that only one transmitter is driving the communications pair at any one time. In multi-drop systems, the parity bit of 8-bit data packets is often used not as a parity check, but instead is set high to indicate that a packet is a control/address packet, and is cleared to indicate a general data packet. In this manner, slave devices know which device is being addressed by the master (by decoding only the address/control bytes) and can ignore data on the bus not directed to them. This can prevent a slave device confusing general data on the bus with a request for data from the master (which could lead to two slave devices transmitting at the same time). Configure links LK5 an LK6 for the appropriate differential communications mode. Note that these two links must either be both fitted or both links not-fitted. 7.2.1.2 Transmit Driver Enable/Disable When in multi-drop mode, all inactive transmitters must have disabled line drivers. The differential line driver on the MERLIN COM2 is enabled/disabled by the COM2 /RTS line. When /RTS is active (low) the transmit driver is switched on (enabled). Once the data has been transmitted, /RTS should be driven inactive (high) in order to disabled the driver. Note that the COM2 UART Transmit Buffer Empty interrupt only indicates that the transmit register is empty and ready for another byte of data. This does not mean that the UART transmit shift register is empty. The users application must ensure that the shift register is empty before disabling the driver. This is indicated by the Transmitter Empty (TEMT) bit of the Line Status Register. If using polled communications then this is not a problem, the TEMT bit should be polled not the Transmit Buffer Empty bit. If running interrupt driven comms, reception of a Transmit Buffer Empty interrupt is not a valid condition for negating RTS. The application could ensure that the shift register is empty in three ways:

- Polling the TEMT bit - Adding a suitable time delay after receiving the interrupt and before negating RTS - COM2 is configured so that the receiver is always enabled. This means that the MERLIN will always receive whatever it transmits on COM2. By waiting until it has received all the data written to the COM2 transmit register, you can be sure that the transmit shift register is empty.

Conversely, the application must also ensure that the driver is disabled before any receiving devices reply. 7.2.1.3 Line Terminations Differential communications pairs should be terminated to prevent reflections from either end of the communications cables. Each pair should be terminated at each end of the wire run with a resistance that matches the impedance of the cable. COM2 on the MERLIN can be configured to include a 120 Ohm line matching termination resistor by fitting link LK7. This will be a fair match for twisted pair wiring.

Page 16: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 16

7.2.1.4 Pull Apart Resistors The COM2 receive pair on the MERLIN is fitted with 1K5 pull apart resistors which ensure that in a multi-drop system the COM2 input is pulled inactive when no transmitters are active. If there are a large number of devices attached to a multi-drop system, it may be necessary to ensure that there are not too many pull apart resistors fitted to the network, as each resistor will load the line drivers.

7.3 COM3 COM3 is an RS-232 serial communications port with full hardware handshaking support. It is supported by a 16550 compatible UART. The 16550 UART is compatible with 16450 UART’s but has an internal 16-byte receive buffer and 16-byte transmit buffer. COM3 can be set as the console port instead of COM1 in the BIOS setup. (See Appendix C, BIOS Settings and Support, for more details on the BIOS setup features). Interrupt driven communications for COM3 is supported via the INT0 pin of the 386EX, which is connected to IRQ1 in the default software configuration of the MERLIN. The maximum baud rate supported is 115.2Kbaud. COM3 is accessed via PL5, a 9-way DSUB plug connector, which is pinned out as a standard PC RS-232 serial port. See Appendix A for the full pin-out.

7.4 Ethernet Port The MERLIN has a 10Base-T Ethernet port via an RJ45 connector (PL4). The Ethernet port is supported by a Realtek RTL8019AS device connected to the 386EX in 8-bit mode. A serial EEPROM is used to store the network settings including the port’s MAC ID. A link status LED (D5) indicates the presence of a physical Ethernet connection to PL4. The MERLIN is pre-loaded with Datalight Sockets 2.12 (or later). This includes a TCP/IP stack and FTP file server to support communication on this port. See the Datalight Sockets documentation included on the Development Kit CD for further details.

7.5 Real Time Clock A Dallas DS1302 device is used for the Real Time Clock (RTC). This device is interfaced via 386EX port pins P1.2 (SCLK), P1.3 (/RST) and P1.4 (I/O). This device has a dedicated 32.768KHz crystal and is powered through the MERLIN battery backup circuit. The crystal has an accuracy of ±2 seconds per day (at 25°C). The RTC includes 31 bytes of battery backed RAM which are used to store the CMOS settings for the BIOS. The ‘DOS clock’ is set to the RTC time whenever the MERLIN is booted up; once booted the DOS clock runs from the 18.2 Hz DOS ‘timer tick’ unless it is deliberately re-synchronized to the Dallas RTC time using an appropriate software function. It is suggested that any user application code that requires an accurate clock should get the time directly from the RTC using the appropriate BIOS call rather than via a DOS function call. The DOS clock can loose time during periods of heavy processor use by the flash filing system. See Appendix C for details on the MERLIN BIOS functions.

7.6 Software Watchdog The 386EX processor has internal watchdog circuitry, which is software controlled. This can be used to reset the MERLIN. If the software watchdog times-out a reset pulse is generated. This reset pulse is fed back to the hardware reset of the 386EX processor.

Page 17: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 17

The watchdog timeout period is software selectable. The timeout can be set to anything between 0 and 171 seconds, in 80ns intervals. See the ‘Intel 386EX Embedded Microprocessor User’s Manual’ for more details on setting the watchdog timeout period and setting the watchdog running. Note that once the software watchdog has been set running it can not be disabled, nor can the timeout period be changed. This is to prevent stray application code from accidentally disabling the watchdog.

7.7 Battery A rechargeable lithium-ion battery is used to support the Real Time Clock and SRAM memory while main board power is disconnected. The battery has a capacity of 65mAh. The board is shipped with the battery link (LK4) not connected in order to preserve battery life while the board is not in use. The battery life is dependent on both the board variant and on the ambient temperature of the board. If the battery link is fitted and the board is left permanently without power then the battery will support the SRAM and RTC for typically: MERLIN-SE 10 months MERLIN 2 years Actual battery life is dependent on: • temperature • the total life of the battery (it will decay over time even when open circuit) • the variance in current drawn by the SRAM and RTC devices due to batch differences The figures given above are for guidance only and cannot be guaranteed. If a MERLIN-SE board is powered on average for approximately 1 hour per day, the battery should remain near full capacity. The MERLIN has a battery OK indication on 386EX port pin P1.5. When this pin is high, the battery voltage is valid. If low, the battery should be considered flat or the battery link is not fitted. A function to read this signal is included in the Arcom MERLIN I/O software library (see Appendix D, section 12.1.1 for more details).

7.8 Unique Electronic ID A Dallas DS2401 ‘Silicon Serial Number’ IC is connected to port pin P3.5 of the 386EX. Each device has a unique 48-bit serial number pre-programmed into the device. This allows each MERLIN board to be uniquely identified. A software driver for reading this device is included in the MERLIN I/O software library (see Appendix D, section 12.1.1 for more details).

7.9 LED’s There are 6 surface mount LED’s fitted on the right hand side on the MERLIN board. Their functions are as follows: Reference Colour Description D1 Green COM1 transmit active D2 Green COM1 receive active D3 Amber User/Status LED D5 Red Ethernet link present D6 Green COM2 receive active D7 Green COM2 transmit active

Page 18: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 18

The User LED is switched on/off via 386EX processor port pin P1.0. software support for controlling this LED is included in the Arcom MERLIN I/O software library.

7.10 SRAM The MERLIN-SE variant has 512KBytes of battery-backed SRAM memory. When running ROM-DOS this memory is accessed as a standard disk drive (drive D:) via the FlashFX flash filing system. Once the FlashFX overhead is taken into account there are 485KBytes of SRAM available to the user. The MERLIN-SE board is shipped with the battery link not fitted and the SRAM not formatted. If the battery link is not fitted or the battery voltage is too low, the SRAM contents and formatting will be lost. The SRAM is formatted using the fxfmt command. At the C:\ prompt type: fxfmt 81 <return> To maintain the SRAM drive formatting and its contents, ensure that the battery link is fitted before removing power to the board. Note: DO NOT type fxfmt 80, as this will re-format the flash drive, deleting the flash contents and rendering the board unbootable! If for some reason the flash drive is re-formatted or corrupted then the Arcom factory default flash image can be reloaded. See Appendix D for details on reloading the Arcom flash image.

7.11 FLASH The MERLIN has 1MByte of Flash memory. Although this is implemented as 8 x 128KByte pages it will appear as a conventional disk drive when using the FlashFX filing system in ROM-DOS. The top page of Flash contains the BIOS, BIOS extensions such as FlashFX and the ROM-DOS operating system. FlashFX must always keep one page free for swapping files when erasing flash sectors, and so there are 6 pages of 128KBytes (i.e. 768KBytes) for the remaining utilities and user applications. A small amount of the available 768KBytes is used to store the FlashFX FAT12 file allocation tables.

7.11.1 PRE-INSTALLED FILES The MERLIN is pre-installed with a large number of utilities and example code. These files are needed or are useful when first running the board, but you may later want to delete many of these files in order to free up some more flash disk space for your own program storage. In the root directory, the file list will look something like: COMMAND COM 31,533 06-04-1999 6:22a SOCKETS <DIR> 01-01-1980 12:03a FLASHFX <DIR> 01-01-1980 12:00a UTILS <DIR> 01-01-1980 12:01a AUTOEXEC BAT 250 01-01-1980 12:10a ROMDOS <DIR> 01-01-1980 1:13p CONFIG SYS 109 01-31-2001 3:57p DEMO BAT 47 01-31-2001 1:22p HTTP <DIR> 01-01-1980 7:43p 9 file(s) 31,939 bytes 222,208 bytes free The HTTP directory contains the http example (ssidemo.exe) and its associated GIF and HTM files. These files are not needed if you are not running the HTTP demo. This will free up 75KBytes of flash.

Page 19: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 19

The SOCKETS directory contains the Sockets application code required to run all the Sockets comms functions. However, only ‘socketp.exe‘ or ‘socketm.exe‘ is required. ‘socketm.exe‘ is the full sockets code, including ethernet and serial comms support. ‘socketp.exe’ is similar, but only contains support for ethernet. You can delete one of these two files to free up at least 45KBytes. On top of the socketp.exe (or socketm.exe) TSR, other Sockets applications can be run such as FTPD.EXE (FTP server). There are more API’s as well as source code included on the development kit CD. The IPSTAT.EXE and XPING.EXE utilities can be useful when developing and debugging code but can be deleted if more flash memory is required. The SOCKETS directory on the MERLIN also contains the Arcom “configurator” program, sconfig.exe, which is automatically run on bootup (see the AUTOEXEC.BAT file). Once the IP settings have been configured for your application, you will probably want to remove this file (60KBytes). The FLASHFX directory contains the fxfmt command that is required to format the SRAM (see section 7.10). Once the SRAM has been formatted and the battery link is in place, this file can be removed, freeing about 19KBytes. The UTILS directory contains some Arcom utilities that you may find useful when developing code but none are essential for the running of ROM-DOS or Sockets. Removing all non-essential files, the MERLIN should have more than 500KBytes of free Flash drive space but still support all Sockets applications.

7.11.2 FLASH CORRUPTION If power is removed to any DOS-based file system while it is in the process of erasing or writing to a Flash drive or a Hard disk drive, it is possible for disk drive corruption to occur. If a Flash write is in progress and power is lost, the file will not have been closed and there will be lost clusters on the drive. In order to recover the lost clusters, the chkdsk.exe ROM-DOS utility should be run. It is suggested that the following lines are always included in your AUTOEXEC.BAT. C:\SOCKETS\chkdsk C: /f /c if exist FILE0001.CHK del *.CHK /f tells chkdsk to automatically fix any lost clusters /c tells chkdsk to NOT confirm before fixing lost clusters Lost clusters are saved as a FILE000x.CHK file, starting at FILE0001.CHK.

7.12 FACTORS AFFECTING MERLIN PERFORMANCE

7.12.1 FLASH SPACE The more Flash disk drive space there is free, the more efficient the FlashFX flash filing system is in writing to the flash. If there is only a small headroom, then writing files to the flash will take an increasingly longer time. This can affect the performance of other MERLIN functions, especially serial communications through either of the two communications ports that do not have transmit and receive FIFO’s (COM1 and COM2) while writing to Flash.

Page 20: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 20

If the flash is only being used to store the application program and is not used to store files or data during operation then no spare flash disk space is required. If it is being used to store data files that are often being written to, it is suggested that you try to keep at least 256Kbytes of the Flash disk drive unused at all times. FlashFX is a wear-leveling filing system, and as such ensures that all sectors of the flash chip are used evenly over a period of time.

7.12.2 SOCKETS Datalight Sockets is a suite of TSR programs. Many of these are already pre-installed on the MERLIN board included in the development kit and run by the autoexec.bat file. However, they are unlikely to all be needed by any user. Not only do all these programs take up flash disk space, the more TSR’s that are loaded, the more the demand on the 386EX processor. To obtain maximum performance, only those sections of Sockets that are needed by your application should be installed and run. For example, the development kit MERLIN board automatically runs an FTP server (FTPD.EXE), but many applications may only require an FTP client service. The FTP client is a smaller TSR and less demanding of processor time.

7.12.3 SERIAL COMMUNICATIONS The performance of the three serial communications channels can be affected by the demands on the processor. COM1 and COM2 are 16C450 compatible serial communications ports and as such do not have transmit or receive FIFO’s. COM3 uses a 16C550 compatible UART and has 16-byte receive and transmit FIFO’s. When these are enabled and used by an application, the 386EX can handle higher speed serial comms because the processor has a much larger window in which to service any generated interrupts. For example, with both FTP and HTTP server TSR’s running, the processor will not be able to cope with receiving high-speed serial communications (115200 baud) over COM1 and COM2. Very slow speed comms (e.g. less than 9600 baud) are unlikely to encounter any problems. With only an FTP client service running, COM1 can handle any speed up to 115200 baud. Another factor that can affect serial communications performance is the amount of Flash disk space remaining. If the MERLIN is receiving a stream of data at a high baud rate and is writing this data directly to the Flash drive, the amount of free disk space can have a large impact on the maximum baud rate that COM1 and COM2 can receive at. However, if files are being received on either of these ports, there are two alternatives to storing the files straight on to the flash drive. Firstly, the MERLIN-SE has a 512Kbyte SRAM drive (drive D:) that can be used instead. Received data can be directly written to a file on the D: drive without affecting the performance of serial communications. If data files are constantly being created, erased or re-written, the SRAM drive is also ideal as there is no maximum number of write-cycles for SRAM devices. If you do not want to use the SRAM drive or are using a MERLIN rather than MERLIN-SE board, a virtual RAM drive can be set up in DRAM space using the VDISK utility and used to temporarily store incoming files. See 7.12.4 below for details.

7.12.4 DRAM DISK DRIVE A virtual disk drive (RAM drive) can be set up in the DRAM memory area using the ROM-DOS VDISK device driver. The RAM drive can use either standard DOS program memory or extended memory (above 1MByte) for the disk. For example, to setup a 512Kbyte virtual RAM drive in extended memory, add the following line to the config.sys file on the MERLIN board: device = C:\ROMDOS\VDISK.SYS 512 /E

Page 21: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 21

See the ROM-DOS 6.22 Users Guide for details of the VDISK device driver. Remember that a DRAM disk drive is volatile and that all its contents will be lost if system power is removed from the board.

Page 22: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 22

8 Power Supply

8.1 Power Input Circuit The MERLIN is capable of being powered from either a DC or an AC power supply. AC supplies are full-wave rectified on-board. The resulting DC voltage is then regulated to +5.0V. All logic devices on the MERLIN are +5V only. The power-input requirements of the MERLIN are: DC Input: +8V to +18V AC Input: +10V to +16V rms The DC jack socket on the MERLIN has a 1.3mm diameter pin and a 4.0mm diameter hole and mates with a standard 1.3mm DC jack plug. The power rating of the board is approximately 4W. The MERLIN power input circuit includes a 750mA resettable fuse to protect the board (and power supply) in the event of a short circuit. A transient suppressor protects the board from high voltage transients from the power supply. The Micrel MIC4680 regulator also provides over-current protection and thermal shutdown circuitry.

8.2 Development Kit Power Supply A 15W, +12V DC power supply is included in the development kit. This power supply can be used in most countries and is rated to take a mains input of between 100V and 240V, at 47 - 63Hz. The power supply is supplied with three plugs (included in the kit) which allow it to be used in a variety of countries. The correct plug for your country should be selected and plugged into the main body of the supply. The power supply comes complete with 1.5m of figure-8 cable and a 1.3mm DC jack which mates with the power connector (PL6) of the MERLIN.

Page 23: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 23

9 Appendix A - Connections

9.1 PL1 - IO Port 20-way 0.1” header + 6-way 0.1” header

PIN SIGNAL PIN SIGNAL 1 GND 2 GND 3 /RD 4 Reserved 5 D0 6 D1 7 D2 8 D3 9 D4 10 D5 11 D6 12 D7 13 /BLE 14 A1 15 Reserved 16 /NMI 17 VCC 18 386EX CLKOUT 19 VCC 20 VCC 21 N/C 22 N/C 23 A2 24 A3 25 /CS4 26 INT2 27 /WR 28 GND

9.2 PL2 - JTAG/TAPFLASH (factory use only) 6-way 2mm pin header

PIN SIGNAL NAME PIN SIGNAL NAME 1 TDO 2 TDI 3 TMS 4 TCK 5 VCC 6 GND

9.3 PL3 - COM1 and COM2 (serial communications ports) 20 way 0.1” boxed header

PIN SIGNAL PIN SIGNAL 1 N/C 2 N/C 3 RX(1) 4 RTS(1) 5 9.3.1.1.1.1 TX(1) 6 CTS(1) 7 N/C 8 N/C 9 GND 10 N/C 11 N/C 12 N/C 13 GND 14 GND 15 TX(2)+ 16 TX(2)- 17 RX(2)+ 18 RX(2)- 19 GND 20 N/C

Note: When links 5 and 6 are fitted, pins 15 and 17 are connected together, as are pins 16 and 18.

Page 24: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 24

9.4 PL4 - Ethernet (10Base-T) 8-way RJ45

PIN SIGNAL NAME PIN SIGNAL NAME 1 TX+ 2 TX- 3 RX+ 4 N/C 5 N/C 6 RX- 7 N/C 8 N/C

9.5 PL5 - COM3 (RS-232 serial port) 9 way D-type male

PIN SIGNAL NAME PIN SIGNAL NAME 1 DCD(3) 2 RX(3) 3 TX(3) 4 DTR(3) 5 GND 6 DSR(3) 7 RTS(3) 8 CTS(3) 9 RI(3)

9.6 PL6 - Power connector DC jack power connector, 1.3mm

PIN DC POWER AC POWER Inner 9-18V DC 10-16V AC rms (fused side) Outer GND 10-16V AC rms

Page 25: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 25

10 Appendix B - IO Mapping

10.1 I/O Address Table Address I/O Function Used

DOS / PC Expanded FC0C - FC1F IO Expansion Port Yes (CS4) 03E8 - 03EF E4E8 - E4EF COM3 Yes (CS5) 0400 0400 Flash/SRAM Paging Register Yes (CS1) 0300 - 031F 0300 - 031F Ethernet Port Yes (CS3) 02F8 - 02FF F8F8 - F8FF COM2 (386EX UART 1) Yes F860 - F874 386EX Parallel Ports No F820 - F836 Device Configuration Yes F800 - F804 Power Management Yes* 03F8 - 03FF F4F8 - F4FF COM1 (386EX UART 0) Yes F4C0 - F4CA 386EX Watchdog Yes F4A0 - F4A7 Refresh Controller Yes F480 - F48A Synchronous Serial Port No F400 - F43F Chip Select Unit (CSU) Yes 00A0 - 00A1 F0A0 - F0A1 Slave INT Controller Yes 0092 F092 PORT92 Not rec’md 0081 - 008B F080 - F09B DMA Page No 0040 - 0043 F040 - F043 Timer/Counter No 0020 - 0021 F020 - F021 Master INT Controller Yes 0000 - 000F F000 - F01E DMA/BUS-ARB No 0022 0022 REMAPCFG Yes

Shaded part of table indicates functions internal to the 386EX processor. * Switching the 386EX processor into IDLE mode could save approximately 1W power consumption.

10.2 IRQ Interrupt Mappings ICU IRQ Function

IRQ0 Internal Timer/Counter 0 IRQ1 COM3 (via INT0 pin) IRQ2 Interrupt Cascade to Slave ICU IRQ3 COM2 (SIO INT1) IRQ4 COM1 (SIO INT0) IRQ5 Ethernet (via INT1 pin) IRQ6 Reserved for IO Expansion Port IRQ7 - IRQ8 - IRQ9 - IRQ10 Internal Timer/Counter 1 IRQ11 Internal Timer/Counter 2 IRQ12 - IRQ13 - IRQ14 - IRQ15 Watchdog Timeout

Page 26: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 26

10.3 386EX Port Pin Assignments Port Pin Function Input / Output

P1.0 User / Status LED (low switches D3 on) Output P1.2 RTC SCLK Output P1.3 RTC /RST Output P1.4 RTC I/O I/O P1.5 Battery Fail (active low) Input P1.6 Link1 (low indicates link present) Input P1.7 Link2 (low indicates link present) Input P3.1 Memory paging register output enable (active low) Output P3.5 Silicon serial number (Dallas ID chip) data line I/O P3.7 Serial communications clock (1.843MHz) Input

10.4 Memory Page Address Register (/CS1) Data bit Page Address bit

D0 FLASH Page Address 0 D1 FLASH Page Address 1 D2 FLASH Page Address 2 D3 SRAM Page Address 0 D4 SRAM Page Address 1 D5 SRAM Page Address 2 D6 SRAM Page Address 3 D7 SRAM Page Address 4

NOTE: If using ROM-DOS (and FlashFX) DO NOT write to the memory page register. This register is a write-only register and thus read-modify-writes are not possible. Any accesses to this register outside of FlashFX are likely to disrupt the operation of FlashFX and crash the board. It may also corrupt the flash drive and make the board unbootable.

Page 27: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 27

11 Appendix C - BIOS settings and support

11.1 Entering BIOS Setup To enter the BIOS setup, hold down the <shift> and ‘,’ (comma) keys during boot-up. Function key F2 could also be used, but most terminal emulators (including HyperTerminal) do not propagate function keys. The BIOS settings are displayed and can be changed in the following order: • Display/Change miscellaneous options? Y/N

Enable aggressive INT service checking? Y/N Enable dark boot option? Y/N Select console port (COM1=A, COM2=B, COM3=C)? Enable 115200 console baud rate? Y/N

• Change password? Y/N

Enter password (default, no password)

• Save changes & exit? Y/N

11.2 BIOS Settings The BIOS settings are described below. Note that the default settings (indicated below) are restored whenever the board is booted with the battery link removed. This is done even if the CMOS settings (in RTC RAM) are still valid. Aggressive INT Service Checking (default on) May be used when trying to debug code. If on, the MERLIN BIOS will return an error to the console if the user’s code calls an unsupported BIOS routine. Dark Boot Option (default off) If this option is switched on, all INT10 output to the serial console is disabled. To restore the serial console, the OEM interrupt support located at 0x60, sub-function 0x01 can be used. To change the BIOS setting back to dark boot disabled, disconnect the battery link (link4) and re-boot the board. Select Console Port (default COM1) Any of the 3 serial ports can be used as the console port. Enter A, B or C to change the console port setting. Default is A, COM1. Enable 115200 Console Baud Rate (default off) COM1 console port baud rate is set to 115200 baud instead of the default 19200 baud.

Page 28: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 28

Password Change The password is stored in the battery backed RAM (of the RTC) and is erased by disconnecting the battery link. If a password is set, the board cannot be booted to ROM-DOS or the BIOS configuration changed without the password being entered. Removing the battery link and re-booting will however disable the password protection.

11.3 OEM Interrupt Support Calls Interrupt Handler 0x60 These functions act on whichever COM port has been set to be the console port in the BIOS setup. Function (AX) Description 0x0100 Restore serial console (i.e. disable dark boot) 0x0200 Initialise COMx for communications port 0x0300 Re-initialise COMx for console port

Where COMx is the console port (COM1, COM2 or COM3) defined in the BIOS setup. When a COM port is used as the console port, ROM-DOS will not allow access (via DOS functions) to the port as it appears to already be used by another process. Sub-functions 0x02 and 0x03 allow application code to access the console port via standard DOS functions if necessary, especially during code development and debug.

11.4 RTC BIOS functions Standard RTC BIOS calls (INT 1A) are supported on the MERLIN. The BIOS interrupt support call values are given below for information. Interrupt Handler 0x1A Read Real Time Clock (INT 1A,2):

Register Description AH 0x02 CF 0 if successful, 1 if error, RTC not operating CH Hours in BCD CL Minutes in BCD DH Seconds in BCD DL 1 if daylight savings time option, 0 if standard time (NOT SUPPORTED)

Set Real Time Clock (INT 1A,3):

Register Description AH 0x03 CH Hours in BCD CL Minutes in BCD DH Seconds in BCD DL 1 if daylight savings time option, 0 if standard time (NOT SUPPORTED)

Returns nothing.

Page 29: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 29

Read Real Time Clock Date (INT 1A,4):

Register Description AH 0x04 CF 0 if successful, 1 if error, RTC not operating CH Century in BCD (decimal 19 or 20) CL Year in BCD DH Month in BCD DL Day in BCD

Note: Calling this interrupt will update the DOS maintained date and reset the BIOS Data Area date rollover flag at 40:70. Set Real Time Clock Date (INT 1A,5):

Register Description AH 0x05 CH Century in BCD (decimal 19 or 20) CL Year in BCD DH Month in BCD DL Day in BCD

Returns nothing.

11.5 Start-up Options i. Power cycle the board ii. When the ‘Press F2...’ message is displayed you may use the following keys:

< - (<shift> comma) Enter BIOS setup. 8 - Gives the option to install/ignore each BIOS extension in the system. Currently there are

three BIOS extensions. The ROM-DOS kernel BIOS extension is located at E000:0000 and is required. The Flash BIOS extension is located at F400:0000 and is required for access to the on-board flash drive.

5 - All BIOS extensions are skipped (The ROM-DOS O/S will then not be detected).

iii. When the ‘Starting ROM-DOS...’ message is displayed you may use the following keys:

B - (<shift> ‘b’ or Caps Lock ‘B’.) Allows the user to individually execute/ignore elements of CONFIG.SYS and AUTOEXEC.BAT.

F8 -This has the same functionality as ‘B’ but most terminal emulators do not propagate

function keys over the serial link.

Note: This is useful when code autostart needs to be disabled or when incorrect drivers have been added to CONFIG.SYS.

Datalight Sockets is not a BIOS extension but is a TSR which is called by AUTOEXEC.BAT and is required for access to the ethernet port and for networking support.

Page 30: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 30

12 Appendix D - SOFTWARE The MERLIN development kit CD contains two software libraries, MERLib and EIIALib. MERLib is detailed below and contains MERLIN hardware specific functions. The EIIALib is fully documented in the ‘MERLIN EIIA Library Technical Manual’ on the CD in the ‘Merlin\Docs\Arcom’ folder. The EIIA (Embedded Industrial Internet Appliance) library contains numerous functions that enhance and extend the Datalight Sockets TCP/IP stack. Note: the EIIA library functions will only run on Arcom processor boards. Both the MERLib and the EIIALib libraries are pre-built for use with the Borland C/C++ v4.52 compiler. If Borland C/C++ v4.52 is required, a copy may be obtained from Arcom Control Systems.

12.1 ARCOM MERLIN SOFTWARE LIBRARY (MERLib) The development kit CD contains an Arcom MERLIN software library file and documentation detailed the functions contained in the library. The library source code is also included on the CD. All these files are installed on your PC as part of the development kit CD installation process. The MERLIN software library contains functions which are specific to controlling and using the on-board functions of the MERLIN board, such as: Link status / Battery OK User LED on/off Read Dallas Unique ID code The following functions are all included in one of the “merlinio.h”, “idtag.h” or “rtc.h” header files. A library of these functions has been generated for each of the possible memory models: Library file Memory model Merlibs.lib small Merlibc.lib compact Merlibm.lib medium Merlibl.lib large Merlibh.lib huge

12.1.1 MERLIN I/O Functions: UCHAR getLinkStat(void); The function returns the state of the MM link (LK1) user link (LK2) & the battery state. An unsigned char is returned. Bit 0 = The state of the MM Link, 1 if the Link is in, 0 if the Link is out. Bit 1 = The state of the User Link, 1 if the Link is in, 0 if the Link is out. Bit 2 = The state of the battery, 1 if the battery is OK, 0 if the battery is flat or the battery link is removed. FLAG chkUserLink(void); This function returns the state of the UserLink. FLAG is an unsigned char, which equals TRUE if the link is in, or FALSE if the link is out.

Page 31: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 31

FLAG chkMMLink(void); This function returns the state of the MM Link. FLAG is an unsigned char, which equals TRUE if the link is in, or FALSE if the link is out. FLAG chkBattery(void); This function returns the state of the battery. FLAG is an unsigned char, which equals TRUE if the battery is OK, or FALSE if the battery is flat or the battery link is out. void setUserLed(void); This function turns on the user LED. void clrUserLed(void); This function turns off the user LED void toggleLed(void); This function inverts the current state of the user LED

12.1.2 IDTAG Functions This function is for Dallas electronic ID tag support. Each ID tag number is unique. FLAG DallasGet(char *idcode, char *CRC ) passed : idcode - char pointer for ID code - 8 chars in length

CRC - char pointer for CRC code - 2 chars in length return: TRUE - If the CRC from the device is equal to the CRC calculated from the ID Code

FALSE - read operation failed

12.1.3 RTC Functions void initHardware(void); This function initialises the hardware for use with the DS1302 real time clock device. When running the MERLIN board under ROM-DOS, the hardware is pre-configured by the BIOS. If running in a target environment (i.e. without an operating system such as ROM-DOS) this function must be called once. void DS1302Init(void); This function initialises the DS1302 device. It enables the clock, and disables the write protect function. This allows you to program the DS1302 device. When running the MERLIN board under ROM-DOS, the RTC is pre-initialised by the BIOS. This function required to be called once, when running under a target environment. void vDS1302Write( UCHAR bRegSelect, UCHAR bVal ); This function writes an 8-bit value (bVal) to a register (bRegSelect) in the DS1302 part. UCHAR bDS1302Read( UCHAR bRegSelect ); This function returns the value of the passed register (bRegSelect).

Page 32: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 32

12.1.4 RTC Defines The register definitions for the RTC, these are to be used with the vDS1302Write() and bDS1302Read() functions. Seconds register This is read and written in BCD SECONDS_READ SECONDS_WRITE

Bits 0 – 3 = Seconds Bits 4 – 6 = Ten’s of Seconds Bit 7 = Clock halt flag, 1 = clock off, RTC disabled, 0 = Clock on. Minutes register This is read and written in BCD MINUTES_READ MINUTES_WRITE

Bits 0 – 3 = Minutes Bits 4 – 6 = Ten’s of Minutes Bit 7 = Not used Hours register This is read and written in BCD HOURS_READ HOURS_WRITE

Bit 7 = 24 hour clock mode, 1 = 12 hour clock 0 = 24 hour clock Bit 6 = Not used Bit 5 = In 12 hour mode 1 = PM, 0 = AM. In 24 hour mode this is the second tens of hours bit Bit 4 = Ten’s of hours Bit 0-3 = hours. Month register This is read and written in BCD

Page 33: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 33

MONTH_READ MONTH_WRITE

Bit 0-3 = Month Bit 4 = Ten’s of Months Date register This is read and written in BCD DATE_READ DATE_WRITE

Bit 0 – 3 = date Bit 4 – 5 = Tens of date. Bit 6 – 7 = Not used Year register This is read and written in BCD YEAR_READ YEAR_WRITE

0 – 3 = Years 4 – 7 = Tens of Years Day register DAY_READ DAY_WRITE

Bit 0 – 2 = day of week Control register CONT_READ CONT_WRITE

Page 34: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 34

Bits 0-6 = Not used Bit 7 = Write protect. 0 = Write enabled, 1 = Write disabled

12.1.5 RTC NVRAM Defines NVRAM Size The number of non-volatile ram locations in the RTC NVRAM_BYTES MACROS These two macros can be used to generate the actual NVRAM register location from the NVRAM register number (i.e. 0 - 31).

NVRAM2RTCREADREG(regno) Macro for calculating the non-volatile ram read registers from a location number for use with the vDS1302Write() function. NVRAM2RTCWRITEREG(regno) Macros for calculating the non-volatile ram write registers from a location number for use with the bDS1302Read() function.

12.2 RE-INSTALLING FLASH BINARY IMAGE If the flash image becomes corrupted such that the board will not boot up into ROM-DOS but the Arcom MiniMonitor code is still OK, then the factory default flash image can be re-installed on the board. By inserting link LK1, the board will boot up using the Arcom MiniMonitor, displaying output via COM1 (console port). The Arcom factory default binary image is included on the development kit CD and is installed on to your PC as part of the installation process (default installation folder is C:\ARCOM\MERLIN\IMAGES). The TCOM.EXE utility is used for BIOS image updates. To re-install this image onto a MERLIN board, follow the instructions below: 1) The TCOM.EXE utility is installed on your PC as part of the development kit CD installation

process. Locate the folder that this has been installed to (default is C:\ARCOM\MERLIN\UTILS). The TCOM.EXE utility uses an initialisation file TCOM.INI. Check that the TCOM.INI text file is set to use the correct PC COM port that you are using to connect to the MERLIN board (e.g. COMPORT= 2;).

Note: If COMPORT= 1; then IRQ_USED= 4; If COMPORT= 2; then IRQ_USED= 3; Also, check that the following line is included in your TCOM.INI file. This ensures that the monitor program protection is disabled.

Page 35: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 35

PROTTMON= N; If this line is not present or is set to ‘Y’ then it must be added or changed. Note that there should be no space between the first word of the line and the ‘=’ sign, and there should be a single space between the ‘=’ sign and the value, followed by a semicolon. 2) Boot up the MERLIN board with link LK1 fitted. 3) Open a DOS window on your PC and run TCOM.

4) Press function key ‘F7’. This will cause TCOM to detect the MERLIN board and will set the baud

rate to 115200. If the board is not detected, check your cabling configuration and TCOM.INI settings.

5) Press the function key ‘F4’. You will be prompted for the filename to download. Type in the full path and filename for the binary image to be downloaded to the Flash memory (e.g. C:\MERLIN\IMAGES\merlin.bin) and then hit <return>. The new image should be 1MByte in size.

6) You will now be prompted for the memory location offset to start copying the image to. Enter ‘0’

and hit <return>.

7) A macro will now run which will sequentially erase the flash sectors and re-program them with the new file image. The MiniMonitor is first copied to and run from DRAM before re-programming the Flash memory. The macro will take a couple of minutes to complete. Once download is complete, the message “100000h bytes downloaded successfully” will appear in TCOM’s red message bar at the bottom of the window.

8) Press the function key “F10” to exit TCOM. Close down the DOS window on your PC to make the

PC COM port available to your terminal emulator.

9) Run your terminal emulator program and boot the MERLIN board with the MiniMonitor link (LK1) not fitted.

WARNING: DO NOT stop the flash re-install process once you have started the F4 macro. Doing so is likely to destroy the entire flash image and render the board un-useable.

12.3 CREATING YOUR OWN BINARY IMAGE When you have finished developing your application code and have a fully working set of software running on your MERLIN, you may wish to copy the full binary image of the flash memory for back-up purposes and to speed up the installation of software on to further MERLIN boards. Once you have a complete binary image extracted from your MERLIN board, follow the steps given above to install this image on new boards, just substituting your new image instead of the Arcom factory default image. The Arcom utility DUMPFLSH.EXE is used to extract a 1MByte binary image from the MERLIN board. The DUMPFLSH utility is included on the development kit CD and will have been installed on your PC in C:\ARCOM\MERLIN\UTILS. To run the utility, 2 serial comms port connections between the MERLIN and the host PC are required. To extract a 1MByte binary image from the MERLIN: 1) Connect one COM port of the host PC to COM1 of the MERLIN, and a second PC COM port to

COM3 of the MERLIN board. 2) Boot the MERLIN board into ROM-DOS.

Page 36: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 36

3) At the C:\> prompt in the terminal emulator, type:

DUMPLFLSH COM3 send <return> Replace COM3 with COM1 if you are using COM3 as the console port. The file image is sent over the comms port not being used as the console port.

4) Open a DOS window on the host PC. Type:

DUMPFLSH COM1 recv <return> Replace COM1 with COM2 if COM2 is the PC COM port connected to the non-console COM port of the MERLIN. The 1MByte flash image will be dumped to a file named FLASH.BIN in the directory that DUMPFLSH was run from.

Page 37: MERLIN Tech ManualB

J640 2192-10680-000-000

Page 37

13 Appendix E - Dimensional Information ENCLOSURE

A plastic injection-molded enclosure is available for the MERLIN board subject to a minimum order quantity. Please contact Arcom Control Systems for more details.

1

P L 4 P L 3

2 0

1 9

2

1

P L 6

P L 1

2 8

1

3 . 1

7 . 2

5 . 0 1 7 . 0

4 3 . 0 7 5 . 0

9 6 . 9

5 . 0 1 0 0 . 0 5 . 0

6 5 . 1

5 . 1

8 1 . 7

5 . 1

P L 5

1 0 0 . 0 5 . 0

1 . 0

5 . 1

8 1 . 7

5 . 1

4 6 . 0

Ø 3 . 4 5 O F F

7 1 . 7

S I N M M T O L E R A N C E S + / - 0 . 1 m m

C O N N E C T O R P O S I T I O N S D E F I N E D F R O M B O A R D E D G E T O C O N N E C T O R C E N T R E ,

E X C E P T P L 6 T O P I N 1 .

B O A R D O U T L I N E 1 1 0 X 9 1 . 9 A L L D I M E N S I O N