background image

5.3

Sam ple Pro grams

There are three sam ple pro grams in source code form in cluded on the EBC-LP disk ette in the

UIO48 di rec tory. These pro grams are not use ful by them selves but are pro vided to il lus trate the us age
of the I/O func tions pro vided in UIO48C.

FLASH.C

This pro gram was com piled with Bor land C/C++ ver sion 3.1 on the com mand line with:

bcc flash.c uio48.c

This pro gram il lus trates the most ba sic us age of the WS16C48. It uses three func tions from the

driver code. The io_init() func tion is used to ini tial ize the I/O func tions and the set_bit() and clr_bit()
func tions are used to se quence through all 48 bits turn ing each on and then off in turn.

POLL.C

This pro gram was com piled with Bor land C/C++ ver sion 3.1 on the com mand line with:

bcc poll.c uio48.c

This pro gram il lus trates ad di tional fea tures of the WS16C48 and the I/O li brary func tions.  It

pro grams the first 24 bits for in put, arms them for fal ling edge de tec tion, and then polls us ing the li brary
rou tine get_int() to de ter mine if any tran si tions have taken place.

INT.C

This pro gram was com piled with Bor land C/C++ ver sion 3.1 on the com mand line with:

bcc int.c uio48.c

This pro gram is iden ti cal in func tion to the “poll.c” pro gram ex cept that in ter rupts are ac tive and all

up dat ing of the tran si tion coun ters is ac com plished in the back ground dur ing the in ter rupt serv ice
rou tine.

Sum mary

The source code for all three pro grams as well as the I/O rou tines are in cluded on the ac com pa ny ing

disk ette. The source code is also pro vided in printed form in AP PEN DIX F. These I/O rou tines along
with the sam ple pro gram should pro vide for a good ba sis on which to build an ap pli ca tion us ing the
fea tures of the WS16C48.

Page 5-6

EBC-LP OPERATIONS MANUAL

030530

WinSystems

 - "The Embedded Authority"

Summary of Contents for EBC-LP

Page 1: ...yright 2003 by WinSystems All Rights Reserved NOTE This manual has been designed and created for use as part of the WinSystems Technical Manuals CD and or the WinSystems website If this manual or any...

Page 2: ...REVISION HISTORY P N 403 0306 000B ECO Number Date Code Rev Level ORIGINATED 030110 B 03 59 030530 B1...

Page 3: ...l Time Clock Calendar 2 5 2 9 Keyboard Interface 2 5 2 10 Serial Interface 2 6 2 11 Parallel Printer Port 2 13 2 12 Speaker Sound Interface 2 14 2 13 PC 104 Interface 2 14 2 14 PC 104 Plus Bus Interfa...

Page 4: ...aults 3 21 3 11 Password Setting 3 21 3 12 IDE HDD Auto Detection 3 21 3 13 Save Exit Setup 3 21 3 14 Exit without Saving 3 21 4 DiskOnChip Configuration 4 1 4 1 DiskOnChip Usage 4 1 5 WS16C48 Program...

Page 5: ...nd jumper configuration data i EBC LP OPERATIONS MANUAL 030530 J1 RJ45 Ethernet J2 J3 FP 100 J4 VGA Video J7 Fan Power J9 PC 104 Plus J8 Flat Panel Power J15 J16 PC 104 J17 Interrupt Routing Header J1...

Page 6: ...ector and jumper configuration data ii EBC LP OPERATIONS MANUAL 030530 J5 Panel Backlight Enable J6 CPU Configuration J10 Master Battery Selection J11 J12 COM1 Configuration J13 J14 COM2 Configuration...

Page 7: ...rmance embeddable computer system on a single board It integrates a number of popular I O options including VGA Ethernet Solid State Disk and High Density Parallel I O Four PC compatible serial ports...

Page 8: ...Expansion only 1 3 2 Memory Addressing 256 Megabyte addressing BIOS ROM 128K Flash Memory DIMM Socket 168 pin 3 3V Dimm Module PC 66 or PC 100 SDRAM Module SSD Memory One 32 pin JEDEC standard socket...

Page 9: ...4 pin in line latching Molex type 22 11 2042 PC 104 Bus 64 Pin SAMTEC type ESQ 132 12 G D 40 Pin SAMTEC type ESQ 120 12 G D PC 104 Plus Bus 120 Pin SAMTEC type TS 30 Q IDE Two 40 pin 2mm Molex Type 7...

Page 10: ...ility The Chipset contains the logic for DRAM and bus state control as well as the standard complement of AT class peripherals including Two 82C37 DMA controllers Two 82C59 Interrupt controllers 82C54...

Page 11: ...e base CPU clock frequency The processors available from WinSystems and the jumpering for them are shown below Page 2 2 EBC LP OPERATIONS MANUAL 030530 WinSystems The Embedded Authority 3 2 1 o o o J6...

Page 12: ...he retaining clips moving them outward The DIMM module once released will be forced up to an appropriate removal position 2 5 Interrupt Routing All interrupts on the EBC LP are routed to their respect...

Page 13: ...7 Mouse Interface A PS 2 mouse may be attached via the connector at J23 An adapter cable CBL 225 1 is available from WinSystems to adapt to a conventional PS 2 mouse connector The pinout for J23 is s...

Page 14: ...metomaketheCMOSRAMforgetitscurrentconfigurationand tostartfreshwithfactorydefaults Thismaybeaccomplishedbyremovingpowerfromtheboard Then remove the jumper from pins 2 3 on J10 and place on pins 1 2 fo...

Page 15: ...the jumper block at J21 When J21 pins 1 2 are jumpered COM3 is enabled When J21 pins 3 4 are jumpered COM4 is enabled The interrupts are not disconnected when COM3 or COM4 are disabled Use the interru...

Page 16: ...pts J25 to two standard DB9M connectors The pin definitions for J25 are shown here 030530 EBC LP OPERATIONS MANUAL Page 2 7 WinSystems The Embedded Authority 3 2 1 o o o 1 2 3 o o o U24 Installed U25...

Page 17: ...d for determining the correct resistor valuesisbeyondthescopeofthisdocumentbutitisrecommendedthat trial values of 100 ohms be used in all three locations at the receiver end The following illustration...

Page 18: ...rminated at each end of the run The requiredterminationvaluesaredependentuponanumberoffactorsincluding line impedance line length etc A good trial value is 100 ohms in all three resistor locations The...

Page 19: ...itters are connected in parallel Only one station at a time may transmit or have its transmitter enabled The transmitter Enable Disable is controlled in software using bit 1 intheModemControlRegister...

Page 20: ...BC LP OPERATIONS MANUAL Page 2 11 WinSystems The Embedded Authority 3 2 1 o o o 1 2 3 o o o U28 Not Installed U29 Installed U30 Not Installed 1 o o 6 2 o o 7 3 o o 8 4 o o 9 5 o J13 J14 COM2 DB9 N C T...

Page 21: ...J11 J12 COM1 DB9 N C TX RX TX RX N C GND N C N C N C N C VCC R23 4 7K R18 Absent R22 4 7K TX RX TX RX R20 47 ohm R21 47 ohm C46 0022 uf C47 0022 uf 3 2 1 o o o 1 2 3 o o o U28 Not Installed U29 Insta...

Page 22: ...he pin definitions for the parallel port DB25 connector when using the CBL 247 1 cable are shown below 030530 EBC LP OPERATIONS MANUAL Page 2 13 WinSystems The Embedded Authority 1 o o 14 2 o o 15 3 o...

Page 23: ...B19 o o A19 B20 o o A20 B21 o o A21 B22 o o A22 B23 o o A23 B24 o o A24 B25 o o A25 B26 o o A26 B27 o o A27 B28 o o A28 B29 o o A29 B30 o o A30 B31 o o A31 B32 o o A32 GND RESET 5V IRQ9 5V DRQ2 12V 0...

Page 24: ...SERR GND SB0 PAR 10 GND PERR 3 3V SDONE 11 STOP 3 3V LOCK GND 12 3 3V TRDY GND DEVSEL 13 FRAME GND IRDY 3 3V 14 GND AD16 3 3 V C BE3 15 AD18 3 3V AD17 GND 16 AD21 AD20 GND AD19 17 3 3V AD23 AD22 3 3V...

Page 25: ...ely The pin definitions for J29 and J30 are shown here Page 2 16 EBC LP OPERATIONS MANUAL 030530 WinSystems The Embedded Authority 1 o o 2 3 o o 4 5 o o 6 7 o o 8 9 o o 10 11 o o 12 13 o o 14 15 o o 1...

Page 26: ...ed in software before timing will begin Enabling is accomplished by writing a 1 to I O port 1EEH Writing a 0 to I O port 1EEH will disable the watchdog After enabling petting may be accomplished by wr...

Page 27: ...J10 must be jumpered 1 2 if a battery is not installed 2 20 DiskOnChip Configuration The EBC LP supports the use of M Systems DiskOnChip DOC device to be used as Solid State Disk SSD drive Section 4...

Page 28: ...ejumperblockatJ31 When J31 is jumpered the parallel I O is enabled at I O address 120H When J31 is open the 16 addresses starting at I O address 120H are free for use by other devices 2 21 2 Parallel...

Page 29: ...44 45 o o 46 47 o o 48 49 o o 50 1 o o 2 3 o o 4 5 o o 6 7 o o 8 9 o o 10 11 o o 12 13 o o 14 15 o o 16 17 o o 18 19 o o 20 21 o o 22 23 o o 24 25 o o 26 27 o o 28 29 o o 30 31 o o 32 33 o o 34 35 o...

Page 30: ...eusedasaninput Whenused in the inputmode areadreflectstheinvertedstateoftheI Opin suchthatahighonthepinwillread as a 0 in theregister Writinga 1 toabitpositioncausestheoutputpintosinkcurrent upto12mA...

Page 31: ...Displays using optional Flat Panel Adapter FPA kits The video on the EBC LP uses the Asiliant 69000 series of high performance VGA controllers The Asiliant controller supports standard and super VGA a...

Page 32: ...n is made via the connector at J8 The pinout for J8 is shown here for reference 030530 EBC LP OPERATIONS MANUAL Page 2 23 WinSystems The Embedded Authority 1 o o 2 3 o o 4 5 o o 6 7 o o 8 9 o o 10 11...

Page 33: ...1024 x 768 16 60 75 85 1280 x 1024 8 60 Page 2 24 EBC LP OPERATIONS MANUAL 030530 WinSystems The Embedded Authority FP12 FP13 FP14 FP15 FP16 FP17 FP18 FP19 FP20 FP21 FP22 FP23 FP24 FP25 FP26 FP27 FP28...

Page 34: ...to the IEEE 802 3x Flow Control specification Half duplex performance is enhanced by a proprietary collision reduction mechanism The 82559 includes a simple PHY interface to the wire transformer at r...

Page 35: ...Embedded Authority 1 o o 2 3 o o 4 5 o o 6 7 o o 8 9 o o 10 11 o o 12 13 o o 14 15 o o 16 17 o o 18 19 o o 20 21 o o 22 23 o o 24 25 o o 26 27 o o 28 29 o o 30 31 o o 32 33 o o 34 35 o o 36 37 o o 38...

Page 36: ...ill wish to enter setup restart the system by turning it OFF and then ON or by pressing the RESET button if so equipped or by pressing the CTRL ALT and DEL key simultaneously Alternately under certain...

Page 37: ...he month JAN through DEC year The year from 1900 to 2099 Time The time is hour minute second The time is calculated on the 24 hour military time clock such that 1 00PM is 13 00 00 Page 3 2 EBC LP OPER...

Page 38: ...5 17 None 855 12 49 855 7 17 None 855 030530 EBC LP OPERATIONS MANUAL Page 3 3 WinSystems The Embedded Authority ROM PCI ISA BIOS 2A59IA2N STANDARD CMOS SETUP Award SOFTWARE INC Drive A 1 44M 3 5 in...

Page 39: ...6 8 33 None 775 46 203 684 16 38 None 685 Press PgUp or PgDn to select a numbered hard disk type or type the number and press ENTER Most manufacturers supply type information with their drives that ca...

Page 40: ...ether the system will halt if a non fatal error is detected during the power up self test The choices are No Errors The system will not be stopped for any error that may be detected All Errors Wheneve...

Page 41: ...e Embedded Authority ROM PCI ISA BIOS 2A59IA2N BIOS FEATURES SETUP Award SOFTWARE INC Virus Warning Disabled Video BIOS Shadow Enabled CPU Internal Cache Enabled C8000 CBFFF Shadow Disabled External C...

Page 42: ...isoption whenenabled furtherenhancesperformancebycachingrecentlyusedinstructions and data into fast SRAM Quick Power On Self Test POST This option when enabled speeds up the POST during power up If it...

Page 43: ...A20 Option This option allows for the selection of the source for the gate A20 signal The choices are Normal Sourced from the keyboard controller Fast Sourced from the Chipset Typematic Rate Setting T...

Page 44: ...ed if the correct password is not entered at the prompt NOTE Todisablesecurity select PasswordSetting attheSetupMainMenuandthenyouwillbe asked to enter a password Do not type anything just hit ENTER O...

Page 45: ...IOS locatedinROMintoDRAM Thisshadowingfroman8 bitEPROMintofast32 bitDRAMresultsin a Multi magnitude increase in performance The main BIOS is shadowed automatically but there are other areas that may b...

Page 46: ...CMOS RAM Each of the options for the Chipset Features Menu will be briefly discussed in the sections that follow 030530 EBC LP OPERATIONS MANUAL Page 3 11 WinSystems The Embedded Authority ROM PCI ISA...

Page 47: ...video BIOS 8 Bit I O Recovery Enables and defines 8 bit I O recovery time in number of clocks 16 Bit I O Recovery Enables and defines 16 bit I O recovery time in number of clocks Memory Hole At 15M 1...

Page 48: ...his option when enabled allows the user to set a shutdown temperature through ACPI capable operating systems The available shutdown temperatures Celsius and Fahrenheit are listed below 60 C 140 F 65 C...

Page 49: ...isabled IRQ 3 7 9 15 NMI Disabled PM Control by APM No Primary IDE 0 Disabled Video Off Method Blank Screen Primary IDE 1 Disabled Video Off After NA Secondary IDE 0 Disabled MODEM Use IRQ NA Secondar...

Page 50: ...is option allows selection of the interrupt to use for wake up on modem activity The interrupt choices are NA 3 4 5 7 9 10 11 Doze Mode This option when power management is enabled allows the user to...

Page 51: ...m will wait with no activity before entering Suspended mode The choices are Disabled 1 minute 2 minutes 4 minutes 8 minutes 12 minutes 20 minutes 30 minutes 40 minutes 1 hour HDD Power Down This optio...

Page 52: ...A for power management CPUFAN Off In Suspend This option when enabled shuts off power to the CPU fan when the system is in suspended mode PowerOn by Ring This option is not supported on the EBC LP Con...

Page 53: ...reset the power management timer when the secondary IDE drive is accessed Secondary IDE 1 This option when enabled will reset the power management timer when the secondary IDE drive is accessed Floppy...

Page 54: ...t Configuration Data Disabled Secondary IDE INT A IRQ 3 assigned to PCI ISA PnP IRQ 4 assigned to PCI ISA PnP Used MEM base addr N A IRQ 5 assigned to Legacy ISA IRQ 6 assigned to PCI ISA PnP IRQ 7 as...

Page 55: ...ption allows the selection of the PCI IDE IRQ map The options are ISA PCI AUTO PCI SLOT 1 PCI SLOT 2 PCI SLOT 3 PCI SLOT 4 Used MEM Base Address This option allows selection of the base address used b...

Page 56: ...tion completely 3 12 IDE HDD Auto Detection This function allows modern IDE fixed disks to be used to their maximum potential by interrogating the driver as to its preferredconfiguration of tracks hea...

Page 57: ...nstalled into the socket at U17 Refer to the section 2 20 for correct device jumpering and enabling of the DOC 4 1 1 DOC Initialization The DOC is initialized in an identical fashion to a fixed disk D...

Page 58: ...ions should include the header file uio48 h which includes the function prototypes and the needed constant definitions Note that all of the functionsutilizetheconceptof bit_number The bit_number isava...

Page 59: ...in is high WRITE_BIT Write a 1 or 0 to an I O pin Syntax void write_bit int bit_number int value Description This function takes two arguments bit_number This is value from 1 to 48 which is the bit to...

Page 60: ...o return value and other bits in the same I O port are unaffected CLR_BIT Clear the specified I O Bit Syntax void clr_bit int bit_number Description This function takes a single argument bit_number a...

Page 61: ...terrupt controller install vectors or handle interrupts when they occur There is no return value and only the specified bit is affected DISAB_INT Disable Edge Detect Interrupt Detection Syntax void di...

Page 62: ...unction with no interrupt pending will have no adverse affect Only the specified bit is affected GET_INT Retrieve bit number of pending interrupt Syntax int get_int void Description This function requ...

Page 63: ...io48 c This program illustrates additional features of the WS16C48 and the I O library functions It programsthefirst24bitsforinput armsthemforfallingedgedetection andthenpollsusing the library routine...

Page 64: ...et Registers 024 03F FREE 040 043 8254 Timer 044 05F FREE 060 06F 8042 Keyboard Controller 070 071 CMOS RAM RTC 072 07F FREE 080 08F DMA Page Registers 090 09F FREE 0A0 0BF 8259 PIC 2 0C0 0DF 8237 DMA...

Page 65: ...3B0 3BB DMA 3C0 3CF EGA 3E8 3EF COM3 3F0 3F6 Floppy Disk 3F8 3FF COM1 Page 6 2 EBC LP OPERATIONS MANUAL 030530 WinSystems The Embedded Authority...

Page 66: ...Q5 XT Hard Disk AT Free 286 Protection fault exception E 38 Hardware IRQ6 Floppy Disk Interrupt 386 Page fault exception F 3C Hardware IRQ7 LPT1 10 40 BIOS Video BIOS functions 286 Coprocessor excepti...

Page 67: ...meter table 42 108 BIOS EGA Chain 43 10C BIOS EGA Parameter table pointer 44 110 BIOS EGA graphics character font 4A 128 BIOS AT Alarm exit address 50 140 BIOS AT Alarm interrupt 51 144 BIOS Mouse fun...

Page 68: ...APPENDIX C Mechanical Drawing...

Page 69: ......

Page 70: ......

Page 71: ...APPENDIX D WS16C48 I O Routines and Sample Program Listings...

Page 72: ...implied In no case shall WinSystems be liable for any direct or indirect loss or damage real or consequential resulting from the usage of this source code It is the user s sole responsibility to dete...

Page 73: ...t or indirect loss or damage real or consequential resulting from the usage of this source code It is the user s sole responsibility to determine fitness for any considered purpose Name uio48 c Projec...

Page 74: ...ge 2 access for interrupt enables outportb base_port 7 0x80 Clear all interrupt enables outportb base_port 8 0 outportb base_port 9 0 outportb base_port 0x0a 0 Restore normal page 0 register access ou...

Page 75: ...is specified by bit_number 1 to 48 val The setting for the specified bit either 1 or 0 This function sets the specified I O pin to either high or low as dictated by the val argument A non zero value...

Page 76: ...ed bit is affected outportb port temp SET_BIT This function takes a single argument bit_number The bit number to set This function sets the specified bit void set_bit int bit_number write_bit bit_numb...

Page 77: ...ess based uppon the bit number port bit_number 8 base_port 8 Calculate a bit mask based on the specified bit number mask 1 bit_number 8 Turn on page 2 access outportb base_port 7 0x80 Get the current...

Page 78: ...mask Adjust the bit_number for 0 based numbering bit_number Calculate the I O Address for the enable port port bit_number 8 base_port 8 Calculate the proper bit mask for this bit number mask 1 bit_nu...

Page 79: ...he correct I O address for our enable register port bit_number 8 base_port 8 Calculate a bit mask for this bit number mask 1 bit_number 8 Set access to page 2 for the enable register outportb base_por...

Page 80: ...nding register mask off undefined bits temp inportb base_port 6 0x07 If there are no interrupts pending return a 0 if temp 7 0 return 0 There is something pending now we need to identify what it is Se...

Page 81: ...rt 2 int id temp inportb base_port 0x0a Read port 2 status If any pending return the appropriate bit number if temp 0 for x 0 x 7 x if temp 1 x outportb base_port 7 0 Turn off access return x 17 Retur...

Page 82: ...resulting from the usage of this source code It is the user s sole responsibility to determine fitness for any considered purpose include stdio h include conio h include dos h include uio48 h This is...

Page 83: ...loss or damage real or consequential resulting from the usage of this source code It is the user s sole responsibility to determine fitness for any considered purpose include stdio h include conio h i...

Page 84: ...nsitions and update the counts check_ints Display the current count values for x 1 x 25 x gotoxy 16 x printf 05u int_counts x getch void check_ints int current Get the bit number of a pending transiti...

Page 85: ...ource code It is the user s sole responsibility to determine fitness for any considered purpose include stdio h include dos h include conio h include uio48 h define BASE_PORT 0x120 This program like t...

Page 86: ...rtb 0xa1 0xfb Unmask IRQ 10 Reenable interrupts enable Set up the display clrscr Clear the Text Screen for x 1 x 25 x gotoxy 1 x printf Bit Number 02d x We will continuously print the transition total...

Page 87: ...ould be one here or we shouldn t even be executing this function current get_int We will continue processing pending edge detect interrupts until there are no more present In which case current 0 whil...

Page 88: ...100 Ethernet Controller Linux Kernels 2 2 x and 2 4 x e100 2 1 6 tar gz NDIS4 Windows 98 82559erWin98 zip NDIS4 Windows NT 4 2000 e100ndis4 zip Windows NT Embedded 4 0 e100ent zip Windows XP 2000 e10...

Page 89: ...WARRANTIES BY WINSYSTEMS EXCEPT AS STATED HEREIN THERE ARE NO OTHER WARRANTIES EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR P...

Reviews: