DevSter's 8041 / 8042 Microprocessors Technical
Information Page

Intel P8042AH
-- Index --
1) Abstract
2) CPU Overview
3) CPU Pinouts
4) External Access Connections
5) Programming
6) That's all!

1) Abstract

Everyone knows about the popular Zilog Z-80, the Intel 8086, the 6800 cpu, and whatever. People know how to interface these cpu's, program them, and make cool little applications with these. And wait, there's one cpu family that doesn't stand out between these popular hobbyist cpu's, and that's the 8041, or 8042. Not many sites on the net present a solution on how to interface external memory, control I/O's, or even program these cpu's. The challenge of this website is to do just the above, and whatever bullshit that needs to be done.

The 8041 and 8042 did have one application in their times, and that was to interface the PS/2 keyboard protocol to the IBM computer. Many places the 8042 are found are on old 8036, 80486 motherboards =). These cpu's can also be called "slave" microcontrollers. AMD, Intel, NEC, and Mitsubishi manufactured these chips (there could be other manufacturers, but I guess I don't have these chips ;o!).

2) CPU Overview


8041 cpu

8042 cpu
Speed 6 MHz 12.5 MHz
Internal OTP ROM Space 1024 bytes 2048 bytes
RAM 128 bytes 256 bytes
Features
  • 8-Bit CPU
  • 8-Bit Data Bus Interface Registers
  • Interval Timer/Event Counter
  • Two 8-bit TTL Compatable I/O Ports
  • Resident Clock Oscillator Circuits
  • External Memory Access using Data Register + I/O Ports
  • Single Step Input
  • Resident Clock Oscillator Circuits
  • Two Test/Input bits (Taking the chip to 16 Inputs/Outputs + 2 Inputs)

3) CPU Pinouts

Note: All inputs need to be connected in some way! (even pin PROG)

4) External Access Connections

Why use external access while there's an internal OTP ROM? The OTP ROM can only be programmed once, meaning after being programmed, it can't be programmed again. Also, many 8042 microcontrollers pulled from 80x86 motherboards are already programmed with the keyboard interface firmware. Trying to buy a blank 8042 isn't easy either.

External access mode is initialized when pin 7 (EA) is tied to VCC. On the trailing edge (going from HI to LOW) of SYNC (pin 11), the program counter contents are present on ports P10-P17 and P20-P22 (going to memory A0-A10). Using SYNC as a chip enable for memory is okay (SYNC low = chip enabled) as long as data is presented on the data bus on time for the S1 state. On the rising edge of SYNC (going from LOW to HI), port data can be strobed from/to P10-P17 and P20-P22.

For basic program memory interface:
* Memory D0-D7 => 8042/8041 D0-D7
* Memory A0-A7 <= 8042/8041 P10-P17
* Memory A8-A10 <= 8042/8041 P20-P22

For strobing outputs on P10-P17, or P20-P22:
Use a 74LS374 or equivalent flip-flop to output the data (equivalent flip-flop as in data is strobed on the rising edge of the clock. A 74LS373 won't work).

* 8042/8041 SYNC => Enable/Clock input (pin 11) of 74LS374
* 8042/8041 P10-P17 or P20-P22 => Data inputs (pins 2-9) of 74LS374
* GND Potential => Output Enable (pin 1) of 74LS374
* Data is presented on Q outputs of flip-flop (pins 12-19) of 74LS374


5) Programming + Datasheets

I won't go over programming. Just find yourself the microcontroller datasheet to use as a reference for programming. The 8042 and 8041 is code compatable with the 8048, except that there are no external program memory instructions, and that data bus register instructions have been added. There's only one assembler that I know of, that will compile for 8042 or 8041 and that's SB Assembler. A modified 8048 TASM table could also be made.

80C41 Datasheet - Download

6) That's all

There's not much to the 8042 and 8041. The microcontrollers were designed to not use external program memory, but in fact does have limited implementations of it (only for reading instruction data).

Sample Projects
Blinking LEDs: Schematic - Source Code - Picture - Used a 4 MHz clock
8 Blinking LEDs: Schematic - Source Code - Picture 1 - Picture 2 - Used a 4 MHz clock
8 LED Binary Addition: Schematic - Source Code - Used a 25 MHz clock on an Intel 8042

Extras

Created by DevSter, aKa Joseph Norman
Visit the author's homepage at http://devster.monkeeh.com/
Last updated: 4/Aug/2005 21:30