Acrosser AR-B1631 User Manual

AR-B1631 User’s Guide
AR-B1631
AMD GX3 , VGA , LAN ,
PC104+ , 4COM , 4 USB
User’ s Guide
1
AR-B1631 User’s Guide

1. INTRODUCTION

Welcome to the AR-B1631 Single Board Computer. The AR-B1631 board Low power GX3 series Processors with the advanced chipset CS5536(CS5535). This product is designed for the system manufacturers, integrators, or VARs that want to provide all the performance, reliability, and quality at a reasonable price.
In addition, the AR-B1631 provides on chip VGA. The VGA, which provides up to True Color (32 bit) 1024x768, or High Color (16 bit) 1280x1024 resolution. The VGA memory is share main memory (2M, 4M, or 8M). AR-B1631 also has 18-bit LVDS function in the system.
The AR-B1631 is loaded with special on-board features that rival full-size systems. It has one network controller on board, uses Realtek RTL8100BL LAN controller, a fully integrated 10/100BASE-TX solution with high performance networking functions. Supports Compact Flash™ Type II interface. Plus optional support for AC97 sound with CD-input. The AR-B1631 also includes one 200-pin SO-DIMM DDR sockets for up to 512 MB total on-board memory. The AR-B1631 has four on-board serial ports; COM1 with RS232C,COM2, COM3 and COM4 with RS232C, 4 USB ports, and tough industrial grade construction. All these features make the AR-B1631 a very "system integrator friendly" solution, perfect for handling applications in the harshest unmann ed environments.
lvds
(24Bit)
CRT OUT TO ETX CON
CRT
MEMORY BUS
LX Processor
TFT
SODIMM200 DDR
14.318 MHz Crystal
IDE AND CF CARD
USB x 2
Clock
Synthesizer (MK1491-09F)
PRIMARY IDE
ATA-66
USB2.0
PCI(33/66 MHz)
66 MHz
48 MHz
REFCLK
PCI BUS(33MHz or 66MHz)
10/100M Ethernet
South Bridge
(CS5535/CS5536)
LPC BUS
COM1 AND COM2
W83627
KB/MS
Flash BIOS
(SST FWH)
AR-B1631 System Block Diagram
AC97 CODEC
F81216D
COM3 AND COM4
2
AR-B1631 User’s Guide

SPECIFICATIONS

CPU: GX3 Chipset: CS5536 or CS5535 RAM memory: Supports DDRA, on-board 200-pin SO-DIMM up to 512MB DDRAM memory module Display Interface: CRT – D-SUB 15-pin female connector
LVDS – for 18 bit TFT LCD Panel.
Ultra A TA/33/66/100 IDE Interface: Floppy disk drive interface: 2.88 MB, 1.44MB, 1.2MB, 720KB, or 360KB floppy disk drive. Series ports: On-board one D-SUB 9-pin male connector for COM1 with RS-232C. On-board one
2x5x2.00mm pin-header connector for COM2, COM3 and COM4with RS-232C.
Parallel Port: On-board one supports SPP/EPP/ECP modes USB port: Four USB 2.0 Audio: onboard AC’97 Codec, Supports IN/OUT, and Left/Right speaker out, MIC IN, CD IN. Ethernet: On-board one RTL8100BL, supports 10/100Mbps Base-T with RJ-45 connector built-in LED K/B & Mouse: On-board PS/2 Keyboard and Mouse connector Power Req.: +5V 2A and +12V 1A maximum PC Board: 6 layers, EMI considered GPIO :8pin (4 output and 4 input) TTL compatible Dimensions: 6.5” x 4.5”
Operating Temperature: 0
o
C~ 60
3
AR-B1631 User’s Guide

2. SETTING UP SYSTEM

This chapter describes how to install the AR-B1631. At first, the layout of AR-B1631 is sho wn, and the unpacking information that you should be careful is described.
Overview System Settings

2.1 AR-B1631 OVERVIEW

CS5536
PC104+
BIOS
W83627HF
IDE
RTL8100
DDR SODIMM
GX3
TOP PLACEMENT
BOTTOM PLACEMENT
4
AR-B1631 User’s Guide
JP4 CN9 J5 IR1
CN8 JP5
LPT1
J3
J2

2.2 SYSTEM SETTINGS

Jumper pins allow you to set specific system parameters. Set them by changing the pin location of the jumper blocks. (A jumper block is a small plastic-encased conductor that slips over the pins.) To change a jumper setting, remove the jumper from its current location with your fingers or small needl e-nosed pliers. Place the jumper over the two pins designated for the desired setting. Press the jumper evenly onto the pins. Be careful not to bend the pins.
We will show the locations of the AR-B1631 jumper pins, and the factory-default settings.
CAUTION: Do not touch any electronic components unless you are safely grounded. Wear a grounded wrist strap or touch an exposed metal pa rt of the system unit chassi s. The static discharges from your fingers can permanently damage electronic components.
2.2.1 JP5 (SERIRQ)
CLOSE SERIRQ
2.2.2 JP1 (POWER ON)
POWER BUTTON
PIN HEADER
AUDIO1
CDIN1
COM2
JP1
JRS1
JP6
CN10
COM4 CN4
COM3
5
AR-B1631 User’s Guide
2.2.3 DIO1 (GPIO)
1 2
9 10
1 GND 2 +5V 3 XOUT0 4 XOUT1 5 XOUT2 6 XOUT3 7 XIN0 8 XIN1 9 XIN2 10 XIN3
2.2.4 AUDIO1 (AUDIO)
1 2
9 10
1 3 5 7 9
LINE OUT R
GND
LINE IN R
MIC IN
GND
10
2 4 6 8
LINE OUT L
GND
LINE IN L
GND GND
2.2.5 COM2, COM3, COM4 (RS232)
1 2
9 10
1 DCD 2 DSR 3 RX 4 RTS 5 TX 6 CTS 7 DTR 8 RI 9 GND 10 NC
2.2.6 J2 (CHASSIS CONTROL) J2
POWER LED
+ -
+ -
HD LED
AT
ATX
RESET
2.2.7 IR1
1
5
1 5V 2 NC 3 IRRX 4 GND 5 IRTX
6
2.2.8 J3 (CLEAR CMOS)
1
3
1-2 NORMAL 2-3 CLEAR
CMOS
2.2.9 CN10 (LCD SETTING)
1 2
5 6
1-3 -SHFCLK 3-5 SHFCLK 2-4 3.3V LCD 4-6 5V LCD
2.2.10 CDIN1 (CDIN)
1
4
1 CD_L 2 GND 3 GND 4 CD_R
2.2.11 CN9 (POWER)
2 1
1 +12V 2 GND
2.2.12 CN8 (STAND BY POWER)
3
1
1 +5V STANDBY 2 PSON# 3 GND
2.2.13 J5 (LCD BACKLIGHT)
1
5
1 +12V 2 +12V 3 GND 4 BLT 5 GND 6 NC
AR-B1631 User’s Guide
7
AR-B1631 User’s Guide
2.2.14 JP4 (LCD LVDS)
2 1
2 GND 1 POWER 4 NC 3 NC 6 NC 5 GND
8 GND 7 NC 10 NC 9 NC 12 NC 11 NC 14 NC 13 NC 16 LVDS_TXC+ 15 GND 18 GND 17 LVDS_TXC­20 LVDS_TX2- 19 LVDS_TX2+ 22 LVDS_TX1+ 21 NC 24 NC 23 LVDS_TX1­26 LVDS_TX0- 25 LVDS_TX0+ 28 LVDS_TX3- 27 LVDS_TX3+ 30 POWER 29 POWER
30 29
2.2.15 LPT1 (PARALLEL PORT)
1 14
1 STB- 14 AFD­2 D0 15 ERROR­3 D1 16 INIT­4 D2 17 SLIN­5 D3 18 GND 6 D4 19 GND 7 D5 20 GND 8 D6 21 GND
9 D7 22 GND 10 ACK- 23 GND 11 BUSY 24 GND 12 PE 25 GND 13 SELECT 26 NC
13 26
2.2.16 BUZZER EXTERNAL
8
A
A
2.2.17 J4 (PC104+)
1 B1 C1 D1
A B C D 1 2 3 4 5 6 7 8 9
10 11 12 13 14 15 16 17 18 19 20 21
C/BE0# AD7 GND AD6
GND AD9 AD8 GND AD11 NC AD10 NC AD14 AD13 GND AD12
+3.3V C/BE1# AD15 +3.3V
SERR# GND PULL UP PAR
GND PERR# +3.3V PULL UP
STOP# +3.3V LOCK# GND
+3.3V TRDY# GND DEVSEL#
FRAME# GND IRDY# +3.3V
GND AD16 +3.3V C/BE2#
AD18 +3.3V AD17 GND AD21 AD20 GND AD19 +3.3V AD23 AD22 +3.3V
IDSEL0 GND IDSEL1 AD22
AD24 C/BE3# NC AD23
GND AD26 AD25 GND
AD29 +5V AD28 AD27
22 23 24 25
REQ0# GND REQ1# NC
GND REQ2# +5V GNT0#
GNT1# NC GNT2# GND
26 27 28 29
GND INTD# +5V PCIRST# +12V INTA# INTB# INTC#
30
30 B30 C30 D30
2.2.18 JP6IDE Cable SelectNOTE 2
Open ATA33 Close ATA66 above
AR-B1631 User’s Guide
NC SERIRQ +5V AD0 NC AD2 AD1 +5V
AD5 GND AD4 AD3
+5V AD30 GND AD31
+5V CLK GND CLK CLK +5V NC GND
NC NC NC NC
9
AR-B1631 User’s Guide
2.2.19 USBA_1 & USBA_2NOTE 2
1 2
1 5V 2 5V 3 USB1­4 USB2­5 USB1+ 6 USB2+ 7 GND 8 GND
9 GND
10 GND
2.2.20 USB1 & USB2NOTE 2
1 5V 2 USB­3 USB+ 4 GND 5 5V 6 USB­7 USB+
8 GND
2.2.21 JRS1
1 2
5 6
1-2 RS422 3-4 RS485 5-6 RS232
2.2.22 CN4RS422 & RS485
1
4
1 RS422TX+/RS485TRX+ 2 RS422TX-/RS485TRX­3 RS422RX+ 4 RS422RX-
2.2.22 CF1NOTE 1
10
NOTE 1
For using both of Hard Disk And Compact Flash, y ou have to use the ATA33 IDE cable. IF you want to use ATA66/100 mode with Hard Disk, you must put jumper on JP6 and use the special IDE cable.
The cable is like below
IDE HOST
In usual ATA66/100 cable the Pin 34 at host side is defined as CABLE ID and connected to ground.
In special cable, the Pin 34 is defined as PDIAG. And cannot connect to ground
NOTE 2
USB connectors (USB1 & USB2) and USB Pin headers cannot use together. And if you want to use USB connectors, you must take the USB cable on Pin Header.
AR-B1631 User’s Guide
In usual ATA66/100 cable, the Pin 34 between host and device side are disconnected.
The special cable must connect this PDIAG signal from host side to device side.
PDIAG
PIN34
IDE DEVICE

3. LCD FLAT PANEL DISPLAY

This chapter describes the configuration and installation procedures for LCD displays.
AR-B1631
Please visit our web site or contact with our technical support department for supports of LCD connecting.
LVDS1
Backlight connect to J5
Inverter
LCD Panel Block Diagram
LCD Panel
Backlight Power
11
AR-B1631 User’s Guide

4. BIOS CONSOLE

This chapter describes the AR-B1631 BIOS menu displays and explains how to perform common tasks needed to get up and running, and presents detailed explanations of the eleme nts found in each of the BIOS menus. The following topics are covered:
BIOS Setup Overview Advanced CMOS Setup Perip heral Setup Boot BIOS Exit

4.1 BIOS SETUP OVERVIEW

The BIOS is a program used to initialize and set up the I/O system of the computer, which includes the ISA bus and con nected devices such as the video display, diskette drive, and the keyboard. The BIOS provides a menu-based interface to the console subsystem. The console subsystem contains special software, called firmware that interacts directly with the hardware components and facilitates interaction between the system hardware and the operating system. The BIOS default values ensure that the system will function at its normal capability. In the worst situation the user may have corrupted the original settings set by the manufacturer. After the computer is turned on, the BIOS will perform diagnosti cs on the system and display the size of the memory that is being tested. Press the [Del] key to enter the BIOS Setup program, and then the main menu will show on the screen. The BIOS Setup main menu includes some options. Use the [Up/Down] arrow key to highlight the option that you wish to modify, and then press the [Enter] key to select the option and configure the functions.
Setup Main Menu
The <Main> option allows you to record some basic system hardware configuration and set the system clock and error handling. If the CPU board is already installed in a working system, you will not need to select this option anymore.

Date & Time Setup

Highlight the <Date> field and then press the [Page Up] /[Page Down] or [+]/[-] keys to set the current
12
AR-B1631 User’s Guide
date. Follow the month, day and year format. Highlight the <Time> field and then press the [Page Up] /[Page Down] or [+]/[-] keys to set the current date. Follow the hour, minute and second format.

Hard Disk Setup

The BIOS supports 2 types for user settings, The BIOS supports <Pri Master> and <Pri Slave>, <Sec Master> and <Sec Slave> so the user can install up to two hard disks.

4.2 ADV ANCED

Standard CMOS Setup

Quick Power On Self Test

Allows the system to skip certain tests while booting. This will decrease the time needed to boot the syst em.

Full Screen Logo Show [Disable]

This allows you to enable or disable the full screen logo dis play feature. Configuration options: [Disabled] [Enabled]

INIT Display First [Onboard]

Initialize the onboard video display before init ializing any other display device on the system. Thus the onboard display becomes the primary display. Configuration options: [Disabled] [Enabled]

Video Memory Size [8M]

Configuration options: [None] [8M] [16M] [32M] [64M] [128M] [254M]

Output Display [CRT]

This allows you to choose output for your system display. Configuration options: [CRT] [Flat Panel] [Panel +CRT]

Flat Panel Type [Auto]

This allows you to choose flat panel type
13
AR-B1631 User’s Guide
Configuration options: [Auto] [LVDS] [TFT]

Resolution [800x600]

This allows you to choose the display resolution.

Refresh Rate [60Hz]

This allows you to choose the display Refresh Rate.

CPU / MEM / PCI Frequency [Auto]

This allows you to setting memory frequency. Configuration options: 100/133/166/200

4.3 POWER

Power Management [ACPI]

This allows you to enable or disable the ACPI function Configuration options: [Disabled] [ACPI]
14
4.3 PERIPHERALS
AR-B1631 User’s Guide
Peripherals
Onboard Serial Port 1 [3F8/IRQ4]
Choose serial port 1 I/O address. Do not set port 1, 2, 3 and 4 to the same address except for Disabled or Auto.

Onboard Serial Port 2 [2F8/irq3]

Choose serial port 2 I/O address. Do not set port 1, 2, 3 and 4 to the same address except for Disabled or Auto.

Onboard Serial Port 3 [3E8/IRQ11]

Choose serial port 3 I/O address. Do not set port 1, 2, 3 and 4 to the same address except for Disabled or Auto.

Onboard Serial Port 4 [2E8/IRQ10]

Choose serial port 4 I/O address. Do not set port 1, 2, 3 and 4 to the same address except for Disabled or Auto.

Onboard Parallel Port [378H/IRQ7]

This field allows you to set the address of the onboard parallel port connector. If you disable this field, the Parallel Port Mode and ECP DMA Select configurations are not available. Configuration options: [Disabled] [378H/IRQ7] [278H/IRQ5]

Parallel Port Mode [SPP]

This field allows you to set the operation mode of the parallel port. [Normal] allows normal-speed operation but in one direction only; [EPP] allows bidirectional parallel port operation; [ECP] allows the parallel port to operate in bidirectional DMA mode; [ECP+EPP] allows normal speed operation in a two-way mode. Configuration options: [Normal] [EPP] [ECP] [ECP+EPP]

Parallel port EPP Type [EPP1.7]

The mode depends on your external device that connects to this port.

ECP Mode use DMA [3]

This field allows you to configure the parallel port DMA channel for the selected ECP mode. This selection is available only if you select [ECP] or [ECP+EPP] in Parallel Port Mode above. Configuration options: [1] [3]
15
AR-B1631 User’s Guide

Onboard Audio [Enables]

Should enable for active AC97

USB1 Controller [Enables]

This should be enabled if your system has a USB installed on the system board and you want to use it. Even when so equipped, if you add a higher performance controller, you will need to disable this feature.

USB2 Controller [Enables]

This should be enabled if your system has a USB installed on the system board and you want to use it. Even when so equipped, if you add a higher performance controller, you will need to disable this feature.

Onchip IDE Device

This enter this option you can enable or disable your IDE channel and set PIO mode or UDMA mode.

4.4PnP/PCI

PnP/PCI

Reset Configuration Data [Disable]

Normally, you leave this field Disabled. Select Enabled to reset Extended System Configuration Data (ESCD) when you exit Setup if you have installed a new add-on and the system reconfiguration has caused such a serious conflict that the operating system cannot boot.

Resources Controlled By [Auto (ESCD)]

This field sets control over the IRQ resources by the a utomatic (ESCD) system or manual assignment of IRQ channels. The default enables automatic (ESCD) control. Configuration options: [Auto (ESCD)] [Manual].
16

4.5 BOOT

AR-B1631 User’s Guide
BOOT

First/Second/Third Boot Device

HDD-0 SCSI CDROM HDD-1 USB-FDD USB-ZIP USB-CDROM USB-HDD LAN Disabled

Boot Other Device [Enabled]

Configuration options: [Enabled] [Disabled].

LAN Boot Select [Disabled]

This allows you to enable or disable the LAN Boot function..
17
AR-B1631 User’s Guide

4.6 BIOS EXIT

Exit
When you have made all of your selections from the various menus in the Setup program, save your changes and exit Setup. Select Exit from the menu bar to display the following menu.

Save & Exit Setup

Type “Y” will quit the Setup Utility and save the user setup value to RTC CMOS. Type “N” will return to Setup Utility.
.

Load Optimized Defaults

Selecting this field loads the factory defaults for BIOS and Chipset Features, which the System automatically detects.

Exit Without Saving

Type “Y” will quit the Setup Utility without saving to RTC CMOS.
Type “N” will return to Setup Utility.

Set Password

This allows you to set a password for enter BIOS menu.
18
5. I/O addressIRQ and Memory Mapping
5.1 I/O address Mapping
AR-B1631 User’s Guide
19
AR-B1631 User’s Guide
5.2 IRQ Mapping
5.3 Memory Mapping
20
AR-B1631 User’s Guide
6. GPIO Sample Code
/*[]======================================================================[]*/ /*|| GPIO Test utility for W83627HF. ||*/ /*|| Date : 10/18/2005 ||*/ /*|| Author : Willy ||*/ /*[]======================================================================[]*/
/*[]======================================================================[]*/ /*|| Include files ||*/ /*[]======================================================================[]*/ #include <conio.h> #include <stdio.h>
/*[]======================================================================[]*/ /*|| Assember Types Define ||*/ /*[]======================================================================[]*/ typedef unsigned char BYTE; typedef unsigned short int WORD; typedef unsigned long int DWORD;
void Show_Title(); char YES_NO_Confirm(); void Enter_Config(BYTE IO_PORT_BASE); void Exit_Config(BYTE IO_PORT_BASE); void Init_SIO(BYTE IO_PORT_BASE); int GPI_TEST(BYTE IO_PORT_BASE); int GPO_TEST(BYTE IO_PORT_BASE);
/*[]======================================================================[]*/ /*|| Function : GPI_TEST() ||*/ /*|| Input : BYTE IO_PORT_BASE ||*/ /*|| Change : - ||*/ /*|| Return : Pass return "0", Fail return "1". ||*/ /*|| Description: Test GPI Pins status. ||*/ /*[]======================================================================[]*/ int GPI_TEST(BYTE IO_PORT_BASE) { BYTE Read_Byte,Temp_Word,Show_Byte;
// Set W83627HF GPIO10~17 to Input outportb(IO_PORT_BASE,0xF0); outportb(IO_PORT_BASE+1,0xFF);
printf(">>>>> GPI Test Start <<<<<"); /////// Input High Test ///////////////////////////////////////////////////
printf("\nConnect GPI Pins to High ? [Y/N] ....... ");
if(YES_NO_Confirm() =='n') { printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail
Show_Byte=0x00; // Read W83627HF GPIO10~17 Status outportb(IO_PORT_BASE,0xF1);
21
AR-B1631 User’s Guide
Read_Byte=inportb(IO_PORT_BASE+1); if(Read_Byte&0x01) //GPI10
Show_Byte=Show_Byte|0x01; else Show_Byte=Show_Byte&0xFE; if(Read_Byte&0x02) //GPI11 Show_Byte=Show_Byte|0x02; else Show_Byte=Show_Byte&0xFD; if(Read_Byte&0x04) //GPI12 Show_Byte=Show_Byte|0x04; else Show_Byte=Show_Byte&0xFB; if(Read_Byte&0x08) //GPI13 Show_Byte=Show_Byte|0x08; else Show_Byte=Show_Byte&0xF7; if(Read_Byte&0x10) //GPI14 Show_Byte=Show_Byte|0x10; else Show_Byte=Show_Byte&0xEF; if(Read_Byte&0x20) //GPI15 Show_Byte=Show_Byte|0x20; else Show_Byte=Show_Byte&0xDF; if(Read_Byte&0x40) //GPI16 Show_Byte=Show_Byte|0x40; else Show_Byte=Show_Byte&0xBF; if(Read_Byte&0x80) //GPI17 Show_Byte=Show_Byte|0x80; else Show_Byte=Show_Byte&0x7F;
if(Show_Byte==0xFF) printf("\nGPI Pins input value ==> 0x%002X",Show_Byte); else { printf("\nGPI Pins input value ==> 0x%002X (should be 0xFF)",Show_Byte); printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail
/////// Input Low Test ////////////////////////////////////////////////////
printf("\nConnect GPI Pins to Low ? [Y/N] ........ ");
if(YES_NO_Confirm() =='n') { printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail
Show_Byte=0x00; // Read W83627HF GPIO10~17 Status outportb(IO_PORT_BASE,0xF1); Read_Byte=inportb(IO_PORT_BASE+1);
if(Read_Byte&0x01) //GPI10 Show_Byte=Show_Byte|0x01; else Show_Byte=Show_Byte&0xFE; if(Read_Byte&0x02) //GPI11 Show_Byte=Show_Byte|0x02; else Show_Byte=Show_Byte&0xFD; if(Read_Byte&0x04) //GPI12 Show_Byte=Show_Byte|0x04; else Show_Byte=Show_Byte&0xFB; if(Read_Byte&0x08) //GPI13 Show_Byte=Show_Byte|0x08; else Show_Byte=Show_Byte&0xF7; if(Read_Byte&0x10) //GPI14 Show_Byte=Show_Byte|0x10; else Show_Byte=Show_Byte&0xEF; if(Read_Byte&0x20) //GPI15 Show_Byte=Show_Byte|0x20; else Show_Byte=Show_Byte&0xDF; if(Read_Byte&0x40) //GPI16 Show_Byte=Show_Byte|0x40; else Show_Byte=Show_Byte&0xBF; if(Read_Byte&0x80) //GPI17 Show_Byte=Show_Byte|0x80; else Show_Byte=Show_Byte&0x7F;
if(Show_Byte==0x00) printf("\nGPI Pins input value ==> 0x%002X",Show_Byte); else { printf("\nGPI Pins input value ==> 0x%002X (should be 0x00)",Show_Byte);
22
AR-B1631 User’s Guide
printf("\n>>>>> GPI Test Error <<<<<\n"); return 1; } // return fail printf("\n>>>>> GPI Test End <<<<<\n");
return 0; // return pass }
/*[]======================================================================[]*/ /*|| Function : GPO_TEST() ||*/ /*|| Input : BYTE IO_PORT_BASE ||*/ /*|| Change : - ||*/ /*|| Return : Pass return "0", Fail return "1". ||*/ /*|| Description: Test GPO Pins status. ||*/ /*[]======================================================================[]*/ int GPO_TEST(BYTE IO_PORT_BASE) { // Set W83627HF GPIO10~17 to Output outportb(IO_PORT_BASE,0xF0); outportb(IO_PORT_BASE+1,0x00);
printf(">>>>> GPO Test Start <<<<<"); /////// Output High Test /////////////////////////////////////////////////
printf("\nSet GPO Pins to High ...............");
// Set W83627HF GPIO10~17 to High outportb(IO_PORT_BASE,0xF1); outportb(IO_PORT_BASE+1,0xFF);
printf("\nGPO Pins is High ? [Y/N] ........... ");
if(YES_NO_Confirm() =='n') { printf("\n>>>>> GPO Test Error <<<<<\n"); return 1; } // return fail
/////// Output Low Test //////////////////////////////////////////////////
printf("\nSet GPO Pins to Low ................");
// Set W83627HF GPIO10~17 to Low outportb(IO_PORT_BASE,0xF1); outportb(IO_PORT_BASE+1,0x00);
printf("\nGPO Pins is Low ? [Y/N] ............ ");
if(YES_NO_Confirm() =='n') { printf("\n>>>>> GPO Test Error <<<<<\n"); return 1; } // return fail
printf("\n>>>>> GPI Test End <<<<<\n"); return 0; // return pass }
/*[]======================================================================[]*/ /*|| Main procedure ||*/ /*[]======================================================================[]*/ int main(int argc, char *argv[]) { BYTE IO_PORT_BASE=0x2E; // DATA_PORT = IO_PORT_BASE + 1; int result;
23
AR-B1631 User’s Guide
if ( argc != 2 ) { Show_Title(); return 1; }
clrscr(); // Enter W83627HF Config
Enter_Config(IO_PORT_BASE); Init_SIO(IO_PORT_BASE); switch(argv[1][0])
{ case 'i': case 'I': //I Key result=GPI_TEST(IO_PORT_BASE); if(result==0) printf("Test Result is Pass."); else printf("Test Result is Fail."); break; case 'o': case 'O': //O Key result=GPO_TEST(IO_PORT_BASE); if(result==0) printf("Test Result is Pass."); else printf("Test Result is Fail."); break; } //switch end
// Exit W83627HF Config Exit_Config(IO_PORT_BASE);
return(0); }
/*[]======================================================================[]*/ /*|| Function : Show_Title() ||*/ /*|| Input : - ||*/ /*|| Change : - ||*/ /*|| Return : - ||*/ /*|| Description: Show Title string. ||*/ /*[]======================================================================[]*/ void Show_Title() { clrscr(); printf("GPIO Control test for W83627HF\n"); printf("1. GPIO.EXE I ==--> Test GPI.\n"); printf("2. GPIO.EXE O ==--> Test GPO.\n"); }
/*[]======================================================================[]*/ /*|| Function : YES_NO_Confirm() ||*/ /*|| Input : - ||*/ /*|| Change : - ||*/ /*|| Return : character 'y' or 'n' ||*/ /*|| Description: Confirm get 'Y' or 'N' key. ||*/ /*[]======================================================================[]*/
24
AR-B1631 User’s Guide
char YES_NO_Confirm() { int X_Axis,Y_Axis; char y_n;
X_Axis=wherex(); /* Get Cursor X Axis */ Y_Axis=wherey(); /* Get Cursor Y Axis */
while(1) { y_n=getche(); if(y_n=='y' || y_n=='Y') return('y'); else if(y_n=='n' || y_n=='N') return('n'); else gotoxy(X_Axis,Y_Axis); } }
/*[]======================================================================[]*/ /*|| Function : Enter_Config() ||*/ /*|| Input : BYTE IO_PORT_BASE ||*/ /*|| Change : - ||*/ /*|| Return : - ||*/ /*|| Description: Enter chip configuration key. ||*/ /*[]======================================================================[]*/ void Enter_Config(BYTE IO_PORT_BASE) { outportb(IO_PORT_BASE,0x87); outportb(IO_PORT_BASE,0x87); }
/*[]======================================================================[]*/ /*|| Function : Exit_Config() ||*/ /*|| Input : BYTE IO_PORT_BASE ||*/ /*|| Change : - ||*/ /*|| Return : - ||*/ /*|| Description: Exit chip configuration key. ||*/ /*[]======================================================================[]*/ void Exit_Config(BYTE IO_PORT_BASE) { outportb(IO_PORT_BASE,0xAA); }
/*[]======================================================================[]*/ /*|| Function : Init_SIO() ||*/ /*|| Input : - ||*/ /*|| Change : - ||*/ /*|| Return : character 'y' or 'n' ||*/ /*|| Description: Confirm get 'Y' or 'N' key. ||*/ /*[]======================================================================[]*/ void Init_SIO(BYTE IO_PORT_BASE) { /* Set Multi-function Pins to GPIO */ outportb(IO_PORT_BASE,0x2A); outportb(IO_PORT_BASE+1,(inportb(IO_PORT_BASE+1) | 0xFC));
// Select GPIO Port device
25
AR-B1631 User’s Guide
outportb(IO_PORT_BASE,0x07); outportb(IO_PORT_BASE+1,0x07);
// Set GPIO Port Active outportb(IO_PORT_BASE,0x30); outportb(IO_PORT_BASE+1,0x01); }
26
Loading...