Code Mercenaries
1
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr55556666
1. Features• Full speed USB interface (12MBit/sec)• Full USB V2.0 compliant full speed device• Full USB HID 1.1 compliance• 50 general purpose I/O pins• Supports IIC compatible devices with 50, 100 or
400kbit/sec• Supports a wide range of alphanumeric and
graphic LCD modules• SPI master up to 12MBit/sec• Drives a LED matrix up to 8x64 with a few
external shift registers• Drives a 8x8 key or switch matrix.• Easy to use starter kit• Software support for Mac(10.2 and up), Linux
(Kernel 2.6), and Windows (2K/XP, notcompatible with 98)
• No USB knowledge necessary to use• Single +5V power supply• Available in MLFP56 package or 100mil spaced
through hole module.• Extended temperature range: -40°C to +85°C
1.1 VariantsRight now the IO-Warrior chip family is availablein two low speed and one full speed variant.This data sheet describes the full speed variantIOW56. For the low speed IO-Warrior chips pleaserefer to the separate data sheet.
1.2 Custom variantsCustom adaptions are available on request.
1.3 Supported OSesW2K, WXP98SE and ME should work but are not tested andno support availableLinux kernel 2.6 and upMacOS X 10.2 and up
2. Functional overviewIO-Warrior offers a simple access to the USB.Many projects that formerly used the parallel portor some other kind of direct I/O interface todayface the problem that getting simple things to workon the USB is quite complex.With a serial or parallel port you needed only asimple circuit to control an external relay or read asingle switch. With USB you need amicrocontroller that handles all the protocol workto do the same thing. Several standard commandsneed to be supported to get a device accepted as aUSB device, let alone implementing any realfunction.IO-Warrior brings simplicity to the USB. Theprotocol is encapsulated in the IO-Warrior Chip.You only have to care about the I/O pins and haveto write only a few simple lines of code to accessthem.IO-Warrior also supports a range of industrialstandard interfaces to simplify interfacing tocertain chips or modules. These interfaces arehandled internally in IO-Warrior removing thebandwith wasting controlling of individual pins.
V 1.0.1, June 4th 2007 for chip version V1.0.0.1
Generic universal I/O Controllerfor USB
Code Mercenaries
2
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566662.1 Product selection matrix
2.2 Starter Kits
With the IO-Warrior Starter Kits you can make your first steps with IO-Warrior 56. A few elements on thekit allow first experiments with inputs and outputs, the bread board area provides space to test yourindividual circuit.The starter kits are sold unassembled. A few minutes soldering will provide you with a working unit.
Actual components supplied with the kit may vary from those shown here.
Type USB Speed I/O Pins LCD IIC SPI RC5 IR Keys LEDs DIL40 SSOP48 DIL24 SOIC24 MLFP56 ModuleIO-Warrior40IO-Warrior24
lowlow
3216
√√
√√ √ √
√ 8x328x32
√ √√ √
IO-Warrior56 full 50 √ √ √ √ 8x64 coming √
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
3
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566663.0 Pin Configurations
IO-Warrior56-LFXIMLFP56 Package
All drawings: TOP VIEW!
1
2
3
4
5
7
6
8
9
10
11
12
13
14
42
41
40
39
38
36
37
35
34
33
32
31
30
29
15 16 17 18 19 2120 22 23 24 25 26 27 28
56 55 54 53 52 5051 49 48 47 46 45 44 43
P2.2
P2.0
P4.6
P4.4
P4.2
P3.6
P4.0
P3.4
P3.2
P3.0
P5.6
P5.4
P5.2
P5.0
P2.5
P2.7
P0.1
P0.3
P0.5
Gnd
P0.7
Vcc
P0.6
P0.4
P0.2
P0.0
P2.6
P2.4
P2.3
P2.1
P4.7
P4.5
P4.3
P3.7
P4.1
P3.5
P3.3
P3.1
P5.7
P5.5
P5.3
P5.1
P1.7
P1.5
P1.3
P1.1
Gnd D-
D+
Vcc
P6.7
P6.0
P1.0
P1.2
P1.4
P1.6
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
4
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr55556666IO-Warrior56-MOD
Module
Pin numbers
All drawings: TOP VIEW!
12345 67 89 10
11 1213 1415 1617 1819 2021 2223 2425 2627 2829 30 3132
333435363738394041424344454647484950515253545556
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
5
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr55556666IO-Warrior56-MOD
Module
Pin names
All drawings: TOP VIEW!
P1.3
P1.7
P5.3
P5.7
P3.3
P4.3
P3.7
P4.7
P2.3
P2.7
P0.3
P0.7
NC
P1.5
P5.1
P5.5
P3.1
P3.5
P4.5
P4.1
P2.1
P2.5
P0.1
P0.5
P0.6
NC
P6.7
P1.1
P1.4
P5.0
P5.4
P3.4
P3.0
P4.0
P4.4
P2.0
P2.4
P0.0
P0.4
P1.0
P1.2
P1.6
P5.2
P3.2
P5.6
P3.6
P4.2
P4.6
P2.2
P2.6
P0.2
P6.0
Gnd
D-
D+
Vcc
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
6
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566664.0 Pin Assignments IO-Warrior56
Pi # MLFP56 Pin# Module Type Name Special function12
2219
I/OI/O
P2.3P2.1
X3X2
3456
2017
I/OI/O
1815
I/OI/O
P4.7P4.5 LCD-CS1 (not driven by special mode function)P4.3P4.1
LCD-E-/RELCD-RS
78910
1613
I/OI/O
1411
I/OI/O
11121314
129
I/OI/O
107
I/OI/O
P3.7P3.5
LCD-Data7LCD-Data5
P3.3P3.1
LCD-Data3LCD-Data1
P5.7P5.5P5.3P5.1
SPI-/DRDYSPI-/SS
15161718
85
I/OI/O
653
I/OI/O
19202122
43
powerUSB
21
USBpower
P1.7P1.5
IIC-SCLIIC-SDA
P1.3P1.1
LED-/OELED-Clk, undefined state during start up
GndD+D-Vcc
23242526
5655
I/OI/O
5452
I/OI/O
27282930
5150
I/OI/O
4948
I/OI/O
P6.7P6.0 Power select during start upP1.0P1.2
LED-Data, undefined state during start upLED-Strobe
P1.4P1.6P5.0P5.2
SPI-SCKSPI-MOSI
31323334
4746
I/OI/O
4544
I/OI/O
35363738
4342
I/OI/O
4140
I/OI/O
P5.4P5.6
SPI-MISO
P3.0P3.2
LCD-Data0LCD-Data2
P3.4P3.6
LCD-Data4LCD-Data6
P4.0P4.2
LCD-/OnLCD-R/W-/WE
39404142
3938
I/OI/O
3736
I/OI/O
43444546
3534
I/OI/O
3332
I/OI/O
P4.4P4.6
LCD-E2-/RESLCD-CS2 (not driven by special mode function)
P2.0P2.2
X0X2
P2.4P2.6
X4X6
P0.0P0.2
Y0Y2
47484950
3127
I/OI/O
--
powerpower
51525354
2825
I/OI/O
2623
I/OI/O
P0.4P0.6
Y4Y6
VccGndP0.7P0.5
Y7Y5
P0.3P0.1
Y3Y1
5556
2421
I/OI/O
P2.7P2.5
X7X5
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
7
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566664.1 Pin descriptions
D+, D-Differential data lines of USB. Put 24Ω seriesresistors in these lines and connect them to theUSB cable or plug, see application circuit fordetails. The IOW56MOD already has the seriesresistors.For a PCB layout make sure to run these twosignals next to each other. USB data is adifferential signal that produces best signal qualityand lowest RF emission if the two lines are close toeach other.
P0.0..P0.7First I/O port of the chip. These pins correspondwith the lowest 8 bits of the input or output (bits0..7).
P1.0..P1.7Second I/O Port. Corresponds to the bits 8..15.P1.0 and P1.1 are used during production of theIOW56. After power up and during the internalstrat up process of IOW56 these two pins canchange their status a couple times. Take this intoaccount when connecting external circuits.
P2.0..P2.7Third I/O Port. Corresponds to the bits 16..23.
P3.0..P3.7Fourth I/O Port. Corresponds to the bits 24..31.
P4.0..P4.7Fifth I/O Port. Corresponds to the bits 32..39.
P5.0..P5.7Sixth I/O Port. Corresponds to the bits 40..47.
P6.0, P6.7Seventh I/O Port. Corresponds to the bits 48 and55. This port has only two pins. Always write theunused bits as "1".
GNDPower supply ground.
VccSupply voltage.
A 100nF ceramic capacitor is required to beconnected directly to each pair of the power supplypins. The IOW56MOD already has the capacitors.The MLFP56 package has a center ground pad thatmust be connected to ground (Vss).
4.2 Special mode pin functionsIO-Warrior56 supports various higher levelfunctions including IIC, SPI, LED matrix, keymatrix, and driving various LCD modules.Handling IIC via the normal generic I/O would bevery slow as each edge of data and clock wouldhave to be transmitted separately. At a rate of 1000such transactions per second (which is themaximum IO-Warrior56 is allowed by USBspecifications) the maximum bit rate andthroughput would be around 250 bits/sec.To make IIC and other devices usable IO-Warriorimplements the special mode functions. Byhandling the IIC inside IO-Warrior the actual datarate is approaching the theoretical maximum.When any of the special mode functions isactivated some pins will no longer respond asgeneric I/O pins but are under control of theactivated special mode function.
4.2.1 IIC Mode pinsIO-Warrior56 can act as an IIC master with 50,100, or 400kbit/sec data rate. Multi-Master mode isnot supported by IO-Warrior, it has to be the onlymaster on the IIC.IO-Warrior56 supports clock stretching handshakewith slaves that need throttling of the data flow.The following pins get reassigned when the IICfunction is enabled:
These pins will no longer be affected by the datasent via the normal port setting command. Bothpins have internal pull up resistors and can beconnected direct to IIC compatible chips.
Function IOW56SCLSDA
P1.7P1.5
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
8
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566664.2.2 LCD Mode pinsIO-Warrior56 has support for controlling LCDmodules with a wide range of controllers. Refer toApplication Note 5: "Controlling LCDs with IO-Warrior" for more information on compatiblemodules and how to use them.
The following pins get reassigned when the LCDfunction is enabled:
When the LCD function is enabled these pins willno longer be affected by the normal port settingcommand./On should be used to enable power supply to LCDmodules that have high current demand orbacklighting. The /On signal is low when the LCDfunction is enabled, it does go high when IO-Warrior enters suspend mode or when the LCDfunction is disabled.
By default the follwing pins should be used forcontrolling the CS lines of graphic displays withmultiple controller chips:P4.5 - CS1P4.6 - CS2Since the polarity of the CS signals varies betweenLCD modules we decided not to handle them in thespecial mode function.
4.2.3 SPI Mode PinsIO-Warrior56 supports a hardware SPI masterinterface. It can communicate with SPI slavedevices with a data clock speed of up to 12MHz.Actual data throughput depends on a number offactors, including the size of the data packets thatare transmitted. Possible peak rates are around62,000 bytes/sec.The following pins get reassigned when the SPIfunction is enabled:
When the SPI function is enabled these pins willno longer be affected by the normal port settingcommand. The pins have internal pull up resistors.
4.2.4 LED Matrix Mode PinsIO-Warrior supports driving a LED matrix with upto 8x64 LEDs.
When the LED Matrix function is enabled thesepins will no longer be affected by the normal portsetting command./OE is driven high when IO-Warrior enters thesuspend mode. The external driver should thendisable to stay within the USB power limits forsuspend mode.For more details on how to control a LED matrixplease refer to the separate application note.
Function IOW56/OnRS
P4.0P4.1
R/W/WEE/REE2/RESData0
P4.2P4.3P4.4P3.0
Data1Data2Data3Data4
P3.1P3.2P3.3P3.4
Data5Data6Data7
P3.5P3.6P3.7
Function IOW56/DRDY/SS
P5.3P5.1
MOSIMISOSCK
P5.2P5.4P5.0
Function IOW56/OEStrb
P1.3P1.2
ClkData
P1.1P1.0
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
9
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566664.2.5 Switch Matrix Mode PinsIO-Warrior supports scanning of a 8x8 matrix ofkeys or switches. When this function is enabledP0.0..7 will turn off their internal pull up resistorsand will be used as the Y lines that are periodicallydriven to Gnd voltage level. P2.0..7 will serve asthe X matrix inputs, they will keep their internalpull up resistors active so a closed switch in thematrix will pull down the X line when thecorresponding Y line is driven low.To allow more than two switches to be closed atthe same time and still be able to faultlessly detectwhich of the matrix points are closed it isnecessary to insert a diode in series with every keyor switch in the matrix. The kathodes of the diodeshave to be connected to the Y lines (P0.0..7).The following pins get reassigned when the keymode is enabled:
The matrix is scanned every 4msec. Debouncetime is 16msec.When IO-Warrior enters the suspend mode the Xand Y lines will be pulled high by internal pull upresistors. Closing a switch/key does not wake theIO-Warrior.
Function IOW56X0X1
P2.0P2.1
X2X3X4X5
P2.2P2.3P2.4P2.5
X6X7Y0Y1
P2.6P2.7P0.0P0.1
Y2Y3Y4Y5
P0.2P0.3P0.4P0.5
Y6Y7
P0.6P0.7
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
10
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566665.Device OperationDue to the fact that all current operating systemsoffer an especially easy access to devices in theHID class, IO-Warrior was designed as a genericHID device. While this does not exactly fit thedevice it makes using it a lot easier.By identifying as a generic HID class device IO-Warrior avoids being controlled by any of thehigher level system drivers, which makes itpossible to access IO-Warrior from applicationlevel.
5.1 Accessing IO-WarriorA common misconception with people new to theUSB is that they think they can "talk to the USBport". The truth is that you do that as likely as youare going to directly talk to your Ethernet port orPCI bus.Communication on the USB is always with aspecific device attached to the USB. The USBitself is only the medium through which youcommunicate.To get access to a certain device you have to lookfor the VendorID and ProductID of that device.The specific mechanisms for doing so depend onthe individual operating system.For details refer to our sample code.
5.2 IO-Warrior communicationIO-Warrior56 has five USB endpoints. Endpointsare like virtual communication ports into or out ofthe device.An endpoint can be assigned to an interface.Interfaces are like virtual devices or subsystemswithin a device. IO-Warrior uses interface 0 to talkto the pins directly and interface 1 to talk to thespecial mode functions.Endpoint 0 is a standard endpoint that is present onall USB devices. It does use the control transfermode and is used by the system to get informationabout the device and to configure the device.Endpoint zero can also be used to send data to thedevices functions. The low speed IO-Warrior chipsuse Endpoint zero for output data, IO-Warrior56has dedicated Endpoints for the output data toachieve a higher performance.For input data IO-Warrior is using endpoint 1 as aninterrupt-in endpoint. Interrupt in this case is a bitmisleading. For USB interrupt means that data issent when there is new data available. The hostcomputer is periodically asking the device for newdata. The device itself can not initiate the datatransfer. IO-Warrior sends a new report any time it
detects a change to the input pin status.Output data to the I/O pins is send to Endpoint 2which is also an interrupt type endpoint. A sevenbyte report directly sets the status of the port pins.Special mode functions receive their commandsvia Endpoint 4, also interrupt mode. The reportsize for the special mode functions is 63 bytes plusthe report ID. This enables a single IOW56 specialmode command to transport ten times more datathan on the low speed IO-Warrior chips. Reactions to commands to the special modefunctions are sent via endpoint 3, also in interrupttransfer mode.Since IO-Warrior56 uses interrupt out endpoints itcan not be used with Win98.
5.3 IO-Warrior input behaviourIO-Warrior checks the status of all pins once everymillisecond. If it detects a change from the laststatus a new report via endpoint 1 is issued. Pinswhich are currently used by a special modefunction are not checked. Reports are send to thecomputer in 1msec intervals.
5.4 IO-Warrior output behaviourUpon receiving the report IO-Warrior writes thenew data to the output pins in groups of eight pinseach. Pins 0.0 to 0.7 get the new data first, then 1.0to 1.7, 2.0 to 2.7, and last 6.0/ 6.7.The time between the individual ports is about1µsec.
5.5 Using pins as inputs or outputsAll I/O pins on IO-Warrior can be used as input oroutput pins.All pins act as inputs all of the time. Whenreceiving an input report from IO-Warrior youalways get the current status on all pins except forthose currently used by special mode functions..Writing a 0 as output value to any pin causes it todrive the pin low with an open drain driver.Usually this will result in this pin being read as azero input as well, unless so much current has to bedrained by the pin that the voltage at it gets abovethe threshold level.Writing a 1 to a pin causes the open drain driver tobe turned off. The pin will be pulled high by aninternal pull up resistor. Now the pin acts either asan output with a high level, or can be used as aninput.
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
11
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566665.6 Power supplyUSB does allow a device to be "Bus Powered".This means the device does get its power off theUSB port. To avoid overloading on the USB portsdevices need to advertise their power requirements.There are two power classes for devices: Lowpower and high power. Low power devices maydraw up to 100mA off the USB, high powerdevices up to 500mA.Likewise there are high power and low powerports. Usually high power ports are those on themotherboard and on hubs with external powersupply or hubs in a monitor. Low power ports aretypically on hubs that get their power off the USB,like hubs in keyboards.If the system decides that there is not sufficientpower to supply a high power decive that devicedoes not get enabled.IO-Warrior can operate either as a high power orlow power device. Pulling the P6.0 pin high or lowat reset sets the desired power rating.This allows to configure IO-Warrior optimally forsupporting external circuits.
5.7 Using external powerIf an external power source is used to supply powerfor an IO-Warrior based circuit there are twooptions.The IO-Warrior can be powered from the USB andonly the external circuit gets its power off anexternal source. If this is a feasible design option itshould be used. An I/O pin may be used to checkthe presence of the external power so anycontrolling application knows if the device is in aworking configuration.The second option is to also power IO-Warriorfrom an external source. This is not therecommended option since IO-Warrior assumesthat the USB is active if it has power. In this caseset the current request of IO-Warrior to 100mA
5.8 SuspendAll devices on the USB port need to support thesuspended state. When the host computer stops toperiodically access the USB, like when it goes tosleep, all devices need to enter the suspended stateand drop their power draw to less than 500µA forlow power devices or less than 2.5mA for highpower devices.When entering suspended state IO-Warrior pullsall pins high. Care must be taken in designingexternal circuits so that they will draw no morethan the allowed suspend power rating while all
pins of IO-Warrior are high.
5.9 Remote WakeupIO-Warrior chips support the remote wakeupfeature. They are able to wake the host computerfrom sleep state if the host operating system hasenabled this feature.Remote wakeup is initiated by IO-Warrior56 if anypin changes its state while the chip is in suspendedstate.
5.10 Special mode I/OTo enable IO-Warrior to talk to devices that havemore complex demands it has the special modefunctions. When any of these functions is enabledsome pins of IO-Warrior turn into special functionpins.Talking to the special mode functions is handeledvia the USB interface 1, which is also configuredas generic HID compliant.Commands to the functions are sent as interruptout reports via endpoint 4. Replies from thefunctions are returned as interrupt in reports viaendpoint 3.To talk to the various functions and to handledifferent requests to them ReportIDs are usedwhich enable multiple functions to use the sameendpoint. All reports to and from special modeinterfaces are always 64 bytes long, including theReportID.The following chapters describe the individualspecial mode functions.
5.10.1 IIC Special mode functionThe IIC function is enabled and disabled bysending a report with the following structure withReportID=1 to interface 1:
"enable"=$01 enables the IIC function, $00disables it. Other values are reserved for future use.Upon enabling IIC the SDA and SCL pins arepulled high and are no longer under control ofinterface 0. Disabling IIC does return the pinsunder control of interface 0 and pulls them highinitially."speed" selects the IIC clock speed.0 = 100kHz1 = 400kHz2 = 50kHz
ReportID$01 out
1 2enable speed
3 4$00 $00
... 62$00 $00
63$00
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
12
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr55556666A write request to the IIC is send with ReportID=2and has the following format:
flags contains the following bits:7 - Generate Start6 - Generate Stop5 - data count MSB4 - data count3 - data count2 - data count1 - data count0 - data count LSB
If bit 7 - "Generate Start" is set a start signal (SDAfalling edge while SCL is high) is generated on theIIC prior to sending out the first data byte.Bit 6 - "Generate Stop" causes a stop signal (SDAgoes high while SCL is high) to be generated aftersending the last valid data byte of this report."data count" gives the number of valid data bytesin the report. The number may range from 1 to 62,higher values cause the report to be ignored.To do write transactions that are longer than 62bytes, send the first report with just the "GenerateStart" bit set, then send additional reports withneither bit 6 or 7 set until the last report is sendwhich has the "Generate Stop" bit set.Clock stretching by the slave to slow down datatransfer is supported by IO-Warrior56.
Any write transactions are acknowledged by areport via interrupt-in endpoint 3:
flags contains the following bits:7 - Error bit, 1=error6 - unused, zero5 - data count MSB4 - data count3 - data count2 - data count1 - data count0 - data count LSB
"data count" indicates the last byte that wassuccessfully transfered and acknowledged by theslave (if any). An error is indicated when the slavedoes not acknowledge a transfer.
Reading data off the IIC is initiated with aReportID=3. The initiating report has the followingformat:
"command" holds the command byte to be send tothe IIC. "count" is the number of bytes that shouldbe read off the IIC after sending the commandbyte, values 0 to 255 are valid, 0 reads 256 bytes.A start signal is automatically generated beforesending the command byte and a stop is generatedafter the last data byte is received.Data is returned in input reports with ID=3 viaendpoint 3. The data is returned in chunks of up to62 bytes each with an error flag and byte count.Multiple reports may be returned in reaction to aread request:
flags contains the following bits:7 - error, set if slave does not ack command byte6 - unused, zero5 - data count MSB4 - data count3 - data count2 - data count1 - data count0 - data count LSB
Should the IIC slave fail to acknowledge thecommand byte the error flag will be set and thetransaction aborted. IIC does not have an errorcondition during the actual reading of data after thecommand byte was sent.Clock stretching by the slave to slow down datatransfer is supported by IO-Warrior56.
ReportID$02 out
1 2flags data
3 4data data
... 62data data
63data
ReportID$02 in
1 2flags $00
3 4$00 $00
... 62$00 $00
63$00
ReportID$03 out
1 2count command
3 4$00 $00
... 62$00 $00
63$00
ReportID$03 in
1 2flags data
3 4data data
... 62data data
63data
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
13
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566665.10.2 LCD Special mode functionThe LCD special mode function supports a widerange of alphanumeric and graphic LCD modules.The LCD function is enabled by sending an outputreport with ID 4 to the USB interface 1:
enable = $00 disables the LCD function. enable = $01 enables the LCD function, othervalues are reserved.
"mode" contains a number of bits that determinethe behaviour of the LCD interface:7 - unused, zero6 - unused, zero5 - unused, zero4 - LC79813 - T69632 - No44780Busy1 - Reset0 - Dual44780
"Dual44780" enables the second E signal to controlmodules with two HD44780 controllers on them.
"No44780Busy" must be set for controllers thatdon't have the busy flag in bit 7 of register 0 likethe HD44780 or KS0108 controllers. Setting thisflag does disable checking for the busy flag in bit 7of the LCD register 0.
"Reset" enables the /RES pin. Upon issuing theenable report with this bit set the LCD functionwill pull the /RES pin low for approximately 2µsecbefore it is released to high again.
"T6963" switches to a mode compatible with theT6963C controllers. Make sure to also set the"No44780Busy" bit. The T6963 specific busy flagsare checked in this mode. The T6963C is the onlycontroller for which IOW56 implements the 8080bus protocol.
"LC7981" switches to a mode compatible with theLC7981 and HD61830 controllers. Make sure toalso set the "No44780Busy" bit. The LC7981specific busy flag is checked in this mode.
Upon enabling the LCD function the Pins are putunder control of the LCD function and can nolonger be controlled by interface 0.The /On pin is pulled low when the LCD functionis enabled, it will go high when the IO-Warrior
enters suspend state.
To write data to the connected LCD module anoutput report with ReportID 5 is written with thefollowing format:
"flags" contains the following bits:7 - RS, Register Select bit6 - Select Special5 - data count MSB4 - data count3 - data count2 - data count1 - data count0 - data count LSB
The status of the "RS" bit is used to set the RS orA0 line to the LCD module.With "data count" the number of bytes to bewritten is specified. IO-Warrior will write up to 62data bytes to the register specified by the "RS" bit.If the "No44780Busy" flag has not been set theBusy bit of the LCD module is automaticallychecked and data written only when the LCDmodule is ready to accept it.When in "Dual44780" mode the "Select Special"bit selects which of the E lines is used for thisrequest. "Select Special" = 0 uses E1, "SelectSpecial" = 1 uses E2.In T6963 mode the "Select Special" bit selects ifthe normal busy flag or the auto mode busy flagshould be checked. "Select Special" = 0 checksSTA0, 1 before writing to the LCD, "SelectSpecial" = 1 checks STA3.
To read data from the LCD module an outputreport with ID 6 is sent to interface 1:
"flags" contains the following bits:7 - RS, Register Select bit6 - Select special5 - data count MSB4 - data count3 - data count2 - data count1 - data count0 - data count LSB
ReportID$04 out
1 2enable mode
3 4$00 $00
... 62$00 $00
63$00
ReportID$05 out
1 2flags data
3 4data data
... 62data data
63data
ReportID$06 out
1 2flags $00
3 4$00 $00
... 62$00 $00
63$00
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
14
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr55556666"RS" specifies which register is to be accessed."data count" sets the number of bytes to be read offthe LCD.
When in "Dual44780" mode the "Select Special"bit selects which of the E lines is used for thisrequest. "Select Special" = 0 uses E1, "SelectSpecial" = 1 uses E2.In "T6963" mode the "Select Special" bit selects ifthe normal busy flag or the auto mode busy flagshould be checked. "Select Special" = 0 checksSTA0, 1 before writing to the LCD, "SelectSpecial" = 1 checks STA2.
Up to 63 bytes can be read with one request. Thedata read from the LCD module is returned in inputreports with ID 6:
"count" specifies the number of bytes returned inthis report. If more than 62 bytes are requested thedata will be returned in multiple reports.
Following is a list of the LCD controllers that haveby now been tested with IOW56 and the mode bytethat is used for them. Additional chip types will beadded when tested.
ReportID$06 in
1 2count data
3 4data data
... 62data data
63data
ChipHD44780ST7920
mode Remarks$00 / $01$00
mode = $01 for dual chip
HD61202KS0108S6B0108S1D15xxxSED152xAX1520NJU6450S1D133xxSED133xT6963
$02
$02
May have two chips,which means two CSlines, either polarityMay have two chips, two/CS lines, active low.May require 18kHz clockSuperset of KS0108
$06
$0A
Select 6800 bus mode onthe moduleMay have a Font selectline
LC7981HD61830
$16
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
15
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566665.10.3 SPI Special mode functionIO-Warrior56 has a hardware SPI interfaceenabling it to talk to many peripheral devices.IOW56 supports SPI master mode.
To enable the SPI function a report with ID 8 issent to interface1:
"enable" = $00 disables the SPI and $01 enables it."mode" contains flags specifying the operatingmode for the SPI:7 - LSBfirst6 - unused, write zero5 - unused, write zero4 - unused, write zero3 - unused, write zero2 - CPHA1 - CPOL0 - unused, write zero
"LSBfirst" selects which bit of the data byte getsshifted first. "LSBfirst" = 0 shifts MSB first,"LSBfirst" = 1 shifts LSB first."CPHA" works together with "CPOL" to specifywhich clock edges are used to drive and sampledata bits."CPOL" = 0 causes SCK to idle low between databytes," CPOL" = 1 makes SCK idle high."CPHA" = 0 causes data to be sampled on the firstclock edge and driven on the second edge."CPHA" = 1 causes data to be driven on the firstedge and sampled on the second edge (this is theopposite behaviour of IOW24 CPHA bit).Enabling SPI takes P5.0..P5.4 out of the control ofinterface zero.
clock sets the clock divider. The master clock rateis 24 MHz which is divided by clock+1. The validrange for clock is 1 to 255. So the fastest SCLKrate is 12MHz, the slowest 93.75kHz.
SPI does always shift data in and outsimultaneously. So there is only one command tosend data out of SPI that does also result in thesame number of bytes being read in and returned tothe host. If the intention is to only read data froman external device it is still necessary to shift outthe same number of dummy bytes to that device.
Data transfers on the SPI are initiated by a reportwith ID 9:
"flags" contains the following bits:7 - useDRDY, 1 = do handshake6 - SSactive, 1 = /SS stays active5 - ignoreDRDY, 1 = first byte ignores /DRDY4 - unused, zero3 - unused, zero2 - unused, zero1 - unused, zero0 - unused, zero
"useDRDY" enables a handshaking signal thatallows the slave to signal if and when it is ready toaccept or send data.If "useDRDY" = 1 IO-Warrior will check for the /DRDY signal to be low before it starts shifting adata byte. If the slave wants to pause the datatransmission it has to pull /DRDY high before theend of the current byte transfer.Upon starting a data transfer it may be desired tosend the first byte without the slave signalling /DRDY low. By setting "ignoreDRDY" to 1 thefirst byte of this report is sent to the slave withoutchecking /DRDY. Prior to shifting the next byteIO-Warrior will check the status of /DRDY.
"count" has the number of bytes to shift, values 1-61 are valid, others will be ignored.
IO-Warrior assertes /SS before starting to shift thefirst data byte of this report and will deassert itafter completing the last byte, unless bit 6"SSactive" is = 1. If "SSactive" is set /SS will stayasserted after the last byte of the report has beentransfered, allowing more than 61 bytes to take partof a single transfer.
Data shifted in by IO-Warrior during a transactionis returned in a report with ID 9:
"count" holds the number of valid bytes in thereport.
ReportID$08 out
1 2enable mode
3 4clock $00
... 62$00 $00
63$00
ReportID$09 out
1 2count flags
3 4data data
... 62data data
63data
ReportID$09 in
1 2count data
3 4data data
... 62data data
63$00
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
16
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566665.10.4 Driving a LED matrixIO-Warrior56 has the capability to drive a matrixof up to 8x64 LEDs with the aid of a few simpleexternal driver chips.To enable the reciever function a report with ID$14 is sent to interface 1:
enable = $01 enables the LED function, enable =$00 disables it again.
Data to be displayed in the matrix is written in twoblocks of 32 bytes:
"block" = 0 writes to the first four lines, "block" =1 to the second four lines.
5.10.5 Switch Matrix ModeIO-Warrior 56 can handle a matrix of 8x8 switchesor keys. Other than with a keyboard controller it ispossible to read out all possible combinations ofclosed switches. Since the switch status is reportedas a bitmap there is no limitation to the number ofswitches that can be closed at the same time(diodes are required in the matrix though).
To enable the switch matrix function a report withID $18 is sent to interface 1:
"enable" = $01 enables the switch matrix function,"enable" = $00 disables it again.
The status of the matrix is returned when ever thereis a change of status or it can be requestedimmediately by sending a report with ID $19:
The status of the matrix is returned in an inputreport with ID $19. A set bit denotes a closedswitch:
5.10.8 Getting current pin statusDue to the way Windows implements HID supportIO-Warrior is unable to continuously send itsstatus. HID class devices do have a function thatallows the host to set the rate at which reportsshould be repeated if there is no change to the data.Windows does set this rate to zero for IO-Warrior,which means IO-Warrior may send data only ifthere are changes.To be able to get the current status from IO-Warrior it does support a Special Mode Functionthat always returns the current status of all pins.
To get the port status just send a report with ID$FF to interface 1:
This will result in the current pin status to bereturned immediately in an input report with ID$FF with the following format:
ReportID$14 out
1 2enable $00
3 4$00 $00
... 62$00 $00
63$00
ReportID$15 out
1 2block data0
... 33datan data31
34 ...$00 $00
63$00
ReportID$18 out
1 2enable $00
3 4$00 $00
… 62$00 $00
63$00
ReportID$19 out
1 2$00 $00
3 4$00 $00
… 62$00 $00
63$00
ReportID$19 in
1 2Y0 Y1
3 4Y2 Y3
5 6Y4 Y5
7 8Y6 Y7
… 63$00 $00
ReportID$FF out
1 2$00 $00
3 4$00 $00
... 62$00 $00
63$00
ReportID$FF in
1 2Prt0 Prt1
3 4Prt2 Prt3
5 6Prt4 Prt5
7 ...Prt6 $00
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
17
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566666. Absolute Maximum Ratings
Storage Temperature ........................................................................................-55°C to +100°CAmbient Temperature with power applied.........................................................-40°C to +85°CAmbient Temperature using USB ......................................................................-10°C to +85°CSupply voltage on Vcc relative to Gnd ..................................................................-0.5V to +6VDC input voltage....................................................................................Gnd-0.5V to Vcc+0.5VMaximum current into any port pin..........................................................................-25/+50mAMaximum combined output low current for all port pins ...............................................150mAStatic discharge voltage..................................................................................................>2000VLatch-up current ..............................................................................................................200mA
6.1 DC Characteristics
Parameter Min Max Units RemarksVccIcc
Operating VoltageOperating Supply Current
4.35 5.2550
VmA Depending on operating mode
IsbIolRupVith
Suspend mode currentSink current on output pinsPull-up ResistanceInput threshold voltage
445%
2525
µAmA
865%
kΩVcc
Oscillator offVout = 0.75V
All ports, low to high edgeVH
VohVol
Input hysteresis voltageUSB Interface
6%
Static output highStatic output low
2.8
VdiVcmVseCin
Differential Input sensitivityDifferential Input common Mode Range
0.20.8
Single Ended Transceiver ThresholdTransceiver capacitance
0.8
12% Vcc
3.60.3
VV
15kΩ±5% to GND
2.5VV
2.020
VpF
|(D+)-(D-)|
RextZoVCcrs
External USB series resistorUSB driver output impedance
2328
D+/D- crossover voltage 1.3
2544
ΩΩ
2.0 V
In series with each USB pinIncluding Rext
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
18
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566667. Ordering information
The chips listed here are standard products.Customized chips are available on request.
7.1 Packaging infoMLFP56 chips are packaged in trays with 250chips each. Only complete trays are available dueto mechanical handling as well as moisturesensitivity of the package. IOW56-LFXI has MSL 3.IOW56 modules are available in any quantity,packaging units are 1 and 15.
7.2 USB VendorID and ProductIDBy default all IO-Warrior chips are shipped withthe USB VendorID of Code Mercenaries ($7C0 ordecimal 1984) and a fixed ProductID.On request chips can be equipped with thecustomers VendorID and ProductID. VendorIDscan be obtained from the USB ImplementersForum <www.usb.org>Customized chips may be subject to minimumorder quantities, contact <[email protected]>for details.
Following are the ProductIDs for the IO-Warriorcontrollers:IO-Warrior56 $1503
ProductIDs are independent of the package type.
7.3 Serial numbersAll IO-Warrior chips do have unique serialnumbers in their device descriptors. These serialnumbers can be used to simplify programming formultiple IO-Warriors connected to a singlecomputer.
The serial numbers are factory programmed andcan not be changed. Serial numbers are 8 digithexadecimal numbers. No two chips of a type willbe produced with identical serial numbers. Thoughit can be that a IOW24 has the same serial numberas a IOW40 or IOW56 chip.
It is not possible to order chips with a specificserial number unless they are ordered as customchips which are subject to minimum order volumesand setup charges.
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Partname Order Code Description PackageIO-Warrior56IO-Warrior56
IOW56-LFXIIOW56-MOD
IO-Warrior 50 I/O pinsIO-Warrior 50 I/O pins
MLFP56Module
Code Mercenaries
19
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566668. IO-Warrior56 basic circuit(MLFP56 package)
GNDD+D-
+5V
4321
USB
P4.7P4.6P4.5P4.4P4.3P4.2P4.1P4.0
P5.7P5.6P5.5P5.4P5.3P5.2P5.1P5.0
P6.7P6.0
D+D-
P3.7P3.6P3.5P3.4P3.3P3.2P3.1P3.0
P2.7P2.6P2.5P2.4P2.3P2.2P2.1P2.0
P1.7P1.6P1.5P1.4P1.3P1.2P1.1P1.0
P0.7P0.6P0.5P0.4P0.3P0.2P0.1P0.0
IIII OOOO---- WWWWaaaarrrr rrrr iiii oooorrrr 55556666---- LLLLFFFFXXXXIIII
VccVcc
GNDGND
340
439
538
637
1132123113301429
2324
2021
22 49
7368359341033
55445643142241
1528162717261825
5148524753465445
19 50
100nFC2
100nFC1
24ΩR1
24ΩR2
100K
R3
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
4V
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566668.1 IO-Warrior56 Starterkit Circuit
GNDD+D-
+5V
4321
USB
J 1 R1
100K
470Ω
R2
D1
J 2
S1
P4.7P4.6P4.5P4.4P4.3P4.2P4.1P4.0
P5.7P5.6P5.5P5.4P5.3P5.2P5.1P5.0
P6.7P6.0
D+D-
P3.7P3.6P3.5P3.4P3.3P3.2P3.1P3.0
P2.7P2.6P2.5P2.4P2.3P2.2P2.1P2.0
P1.7P1.6P1.5P1.4P1.3P1.2P1.1P1.0
P0.7P0.6P0.5P0.4P0.3P0.2P0.1P0.0
IIII OOOO---- WWWWaaaarrrr rrrr iiii oooorrrr 55556666---- MMMMOOOODDDD
Vcc
GND
2038173918401541
1246
9471048
749
5655
32
1
1642134314441145
2434213122361937
8505516525354
2827253126322333
4
10µF
C1
1. 0V0V,1June1t h214VV71for1c2ip1version1 . 0V0V0.
Code Mercenaries
21
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr555566669. Package Dimensions
Module
The module contains the bypass capacitors as well as the USB series resistors.
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
22
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr5555666610. ESD ConsiderationsIO-Warrior has an internal ESD protection towithstand discharges of more than 2000V withoutpermanent damage. However ESD may disruptnormal operation of the chip and cause it to exhibiterratic behaviour.For the typical office environment the 2000Vprotection is normally sufficient. Though forindustrial use additional measures may benecessary.When adding ESD protection to the signals specialcare must be taken on the USB signal lines. TheUSB has very low tolerance for additionalresistance or capacitance introduced on the USBdifferential signals.In any case the USB 2.0 specification chapter 6and 7 should be read for detailed specification ofthe electrical properties.
10.1 EMC ConsiderationsIO-Warrior uses relatively low power levels and soit causes few EMC problems. The most importantissue is to provide a very clean layout for thepower supply. IO-Warrior56 runs at 24MHzinternal clock rate, this can cause current spikes ifthe supply lines are not carefully layed out.To avoid any EMC problems the following rulesshould be followed:• Keep the PCB traces from the resonator to the
chip pins as short as possible.• Put the 100nF ceramic capacitors right next to
the power supply pins of the chip and make surethe PCB traces between the chips power pinsand the capacitor are as short as possible.
• Run the power supply lines first to the capacitor,then to the chip.
• Connect the second ground and supply pin inthe shortest possible way to the first ground andsupply pin. No other things may haveprecedence over this.
• Keep the two USB signal lines close to eachother, route no other signal between them. USBuses differential signalling so the best signalquality with lowest RF emission is achieved byputting these lines very close to each other.
11. Revision History
IO-Warrior 56 does not use the same code base asIO-Warrior24 and IO-Warrior40, so the versionnumbers are not identical.
1.0.0.1Initial release
1.0.0.0Not released due to a bug.
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Code Mercenaries
23
IIIIOOOO----WWWWaaaarrrrrrrriiiioooorrrr55556666Legal StuffThis document is ©1999-2007 by CodeMercenaries.
The information contained herein is subject tochange without notice. Code Mercenaries makesno claims as to the completeness or correctness ofthe information contained in this document.
Code Mercenaries assumes no responsibility forthe use of any circuitry other than circuitryembodied in a Code Mercenaries product. Nordoes it convey or imply any license under patent orother rights.
Code Mercenaries products may not be used in anymedical apparatus or other technical products thatare critical for the functioning of lifesaving orsupporting systems. We define these systems assuch that in the case of failure may lead to thedeath or injury of a person. Incorporation in such asystem requires the explicit written permission ofthe president of Code Mercenaries.
Trademarks used in this document are properties oftheir respective owners.
Code MercenariesHard- und Software GmbHKarl-Marx-Str. 147a12529 Schönefeld OT GrossziethenGermanyTel: x49-3379-20509-20Fax: x49-3379-20509-30Mail: [email protected]: www.codemercs.com
HRB 16007 PGeschäftsführer: Guido Körber, Christian Lucht
V 1.0.0, June 4th 2007 for chip version V1.0.0.1
Top Related