ADAM-4500 PC-based Communication Controller User's Manual Copyright Notice This document is copyrighted, 1997, by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd. reserves the right to make improvements to the products described in this manual at any time without notice. No part of this manual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co., Ltd.
Part No. 2050500110 Printed in Taiwan 1997 st 1 Edition July Table of Contents Chapter 1 General Information 1 1.1 Introduction 1.2 Features 1.3 Specifications 1.4 System Diagram 1 1 2 3 Chapter 2 Installation Guidelines 5 2.1 System Requirements to Setup ADAM-4500 2.2 Steps to Successfully Setup the System Step 1: Review the requirements Step 2: Wiring the power cables and download cable Step 3: Run utility software in host computer Step 4: Power on ADAM-4500 2.
Chapter 3 Programming and Downloading 1 1 3.1 Programming 1 1 Mini BIOS functions 1 1 Converting Program Codes 1 1 Other limitations 1 2 Programming the Watchdog timer 1 2 Interrupt types 1 3 Memory Mapping 1 3 3.2 Downloading and transferring 1 4 Install Utility Software on Host PC 1 4 Preparing the ALLFILE directory 1 4 Downloading into flash ROM 1 4 Transferring files to SRAM 1 6 3.
Step 2:Connect the cables 1 6 Step 3:Convert and download codes to flash ROM 1 7 Step 4:Power on ADAM-4500 to complete the application 1 7 Chapter 4 Function Library 1 8 Appendix A Register Structure 3 0 Appendix B Safety Instructions 32 Chapter 1 General Information 1.1 Introduction The ADAM-4500 is a fully functional standalone controller, designed for industrial automation and control, enclosed in a small package. It provides an ideal means of producing an IBM PC compatible hardware platform.
The controller also includes a real-time clock and a watchdog timer function. The real-time clock ensures time recording while events occur. The watchdog timer is designed to automatically reset the microprocessor when the system fails. This feature greatly reduces the level of maintenance required and makes the ADAM-4500 ideal for use in applications that require a high level of system stability. 1.
Mechanical ?? Case: ABS with captive mounting hardware ?? Plug-in screw terminal block: Accepts 0.5 mm2 to 2.5 mm2, 1 - #12 or 2 - #14 to #22 AWG Environment ?? Operating temperature: -10 to 70°C (14 to 158°F) ?? Storage temperature: -25 to 70°C (-13 to 158°F) ?? Humidity: 5 to 95 %, non-condensing 1.
Function Block Diagram SRAM FLASH ROM COM#2 UART Programming Port Tranceiver RTC GND WDT&Reset +5V 16 Bit up GND RS-485 Tranceiver COM#1 UART +5V RS232/485 Tranceiver Power Converter +10V to 30Vdc Figure 1-2: ADAM-4500 Function Block Diagram Chapter 2 Installation Guidelines This chapter provides guidelines to set up and install the ADAM-4500 communication controller.
into the ADAM-4500, can function as the host computer. Power supply For ease of use in industrial environments, the ADAM-4500 will accept industry standard +24 VDC unregulated power. The ADAM-4500 was designed to operate using any power supply voltage between +10 and +30 VDC . Power ripples must be limited to 5 V peak to peak while the voltage in all cases must be maintained between +10 and +30 VDC .
HOST PC DOWNLOAD CABLE RS-232 and ADAM-4500 RS-232 White (RS-232 Red PC) Black Host PC Male DB-9 Female DB-9 Figure 2-2: Download Cable Connections Step 3: Run utility software in host computer Together with the ADAM-4500 you will find a utility disk containing an ADAM4500.EXE file. This file is a menu-driven software utility provided for downloading user's programs. It uses a screen simulating operation of the ADAM-4500 communication controller.
PC, then press . The Baudrate is set to a default value of 57600 bps and cannot be changed. The screen is as shown in figure 2.4. Figure 2-4: Select Communication Port Step 4: Power on ADAM-4500 Highlight the "Terminal" option, then press . Power on the ADAM-4500. After 5 seconds, the screen shown in figure 2.5 will appear. The ADAM-4500 system is successfully started up.
Figure 2-5: Emulating Screen of ADAM-4500 2.3 Jumper Setting We designed the ADAM-4500 with ease-of-use in mind. It has three jumper settings. The following sections explain how to configure the module. You may want to refer to the figure below for help in identifying card components. The following diagram shows the locations of the jumpers: Figure 2-6:Jumper Layout COM1 Port Setting (JP1) Jumper JP1 lets you configure the COM1(3F8) port as an RS-232 or as an RS-485 interface for different applications.
The ADAM-4500 has a DB-9 pin connector as its RS-232 port connector. Since the connection for an RS-232 interface is not standardized, different devices implement the RS-232 connection in different ways. If you are having problems with a serial device, be sure to check the pin assignments for the connector. The following table shows the pin assignments for the ADAM4500's RS-232 port. Pin No.
mini BIOS of ADAM-4500 only provides 10 function calls. Since the user's program can not use other BIOS function calls, the ADAM-4500 may not work as intended. Additionally, certain language compilers such as QBASIC directly call BIOS functions that are not executable in ADAM-4500. The ADAM-4500 mini BIOS function calls are listed in the following table.
Figure 3-1: Converting Program Codes Other Limitations 1. The ADAM-4500 does not support the standard PC function "8253". Therefore, the C language function call "delay ( )" cannot be used in ADAM-4500 applications. 2. Certain critical files are always kept in flash ROM, such as the operating system files, BIOS, and monitoring files. Aside from the storage space needed for these critical files, the ADAM-4500 has an additional 170 KB of free ROM space for downloading user applications.
The following table shows the memory mapping of the ADAM-4500 controller. 0xF8000 -- 0xFFFFF 0xF6C00 -- 0xF7FFF 0xCC000 0xC0000 0x40000 -- 0xBFFFF 0x00400 -- 0x3FFFF 0x00000 -- 0x003FF 0x003F8 -- 0x003FF 0x002F8 -- 0x002FF 0x00070 -- 0x00071 Monitor program Mini BIOS Start of Application ROM Disk (about 171 K) Start of ROM-DOS (about 48 K) No Use SRAM area System area COM1 COM2 Real time clock 3.
executing, select the COMport of the host PC that has been connected to ADAM-4500. Then select "Program" from the bar menu and press to begin downloading. The screen shown in figure 3-2 will appear. Figure 3-2: Program downloading Follow the instructions shown on the screen. Power off the ADAM-4500 and then re-power on. Then press any key within 7 seconds to burn the files contained in ALLFILE into the ADAM4500's flash ROM.
Figure 3-3: Download Complete Transferring files to SRAM (ADAM-4500's D-drive) The ADAM-4500 provides 234 KB of free SRAM for use in program operation, and as working memory space in the event you want to test your system control logic or simulate system performance before downloading the execution code to the flash ROM. You can transfer files from a host-PC to the ADAM-4500's SRAM (D drive). Execute the utility software, select terminal mode, and press Alt-T.
Step 3: Convert and download codes to flash ROM Within the host computer, convert the application program into 80186 or 80188 compatible code. Create an AUTOEXEC.BAT file for the application program and write the application program's name in the AUTOEXEC.BAT file. Also create COMMAND.COM and CONFIG.SYS files for the application program. Load the ADAM-4500 utility software into the host-PC. Load the converted application program and the files AUTOEXEC.BAT, COMMAND.COM, and CONFIG.SYS into directory ALLFILE.
Syntax: int comm_init(int buf_size) Function description: Initializes the communication port and interrupt routine before other function calls use the communication port. Parameter int buf_size Description Sets the buffer size of every communication port for storage of received data. The unit of size is bytes. Return: Returns a 1 if command succeeds. Returns a 0 if it fails.
int stop Stop bits setting 1, 2 (stop bit = 1 is for data bits = 5,6,7, or 8) (stop bit = 2 is for data bits = 6,7, or 8) For details, refer to RS-232 chip set data book int cmd_type Received data format setting. 0: single byte mode. The data format is a single byte character. User can use comm_get_rec_datas to receive single byte data. 1: command mode. The data format is a string. User can use comm_get_rec_str to receive string data. Return: Returns a 1 if command succeeds. Returns a 0 if it fails.
data buffer ( Use comm_int function call ). Before exiting program, user must free this buffer ( Use comm_exit function call ). unsigned char port Specifies communication port (COM1 or COM2) 1: COM1 port 2: COM2 port Return: Returns a 1 if command succeeds. Returns a 0 if it fails. comm_get_rec_str Syntax: int comm_get_rec_str(unsigned char **data, unsigned char port) Function Description: This function call is employed to received string data.
Function Description: LED ON/OFF control Parameter int type Description 0: LED OFF 1: LED ON wdt_enable Syntax: wdt_enable() Function Description: This function enables the watchdog timer function. After a user calls this function, the user must call the wdt_clear() function to refresh the watchdog timer; otherwise the CPU resets, or a nonmaskable interrupt is generated.
BASE+0 BASE+0 BASE+0 BASE+1 Receiver buffer register when DLAB=0 and the operation is a read. Transmitter holding register when DLAB=0 and the operation is a write. Divisor latch bits 0 - 7 when DLAB=1 Divisor latch bits 8-15 when DLAB=1. The two bytes BASE+0 and BASE+1 together form a 16-bit number, the divisor, which determines the baud rate. Set the divisor as follows: Baud rate 50 75 110 133.
BASE+4 Modem Control Register (MCR) bit 0 DTR bit 1 RTS BASE+5 Line bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7 in the Status Register (LSR) Receiver data ready Overrun error Parity error Framing error Break interrupt Transmitter holding register empty Transmitter shift register empty At least one parity error, framing error or break indication FIFO BASE+6 Modem Status Register (MSR) bit 0 Delta CTS bit 1 Delta DSR bit 2 Trailing edge ring indicator bit 3 Delta received line signal detect bit 4 C
e. The equipment has dropped and damaged. f. If the equipment has obvious sign of breakage. 15.DO NOT LEAVE THIS EQUIPMENT IN AN ENVIRONMENT UNCONDITIONED, STORAGE TEMPERATURE BELOW -20° C (-4° F) OR ABOVE 60°C (140°F), IT MAY DAMAGE THE EQUIPMENT. The sound pressure level at the operators position according to IEC 704-1:1982 is equal to or less than 70dB(A). DISCLAIMER: This set of instructions is provided according to IEC 704-1.