Safekipedia

Intel MCS-48

Adapted from Wikipedia ยท Discoverer experience

A close-up of an Intel 8749H microcontroller chip, showing its intricate design and components.

The MCS-48 microcontroller series was Intel's first microcontroller, released in 1976. It included important models like the 8048, 8035, and 8748, with the 8048 being the most well-known. These tiny computers were made using a special kind of technology called NMOS at first, and later they used CMOS technology in the early 1980s. People kept making them until the 1990s to help older machines still work.

Intel 8048 microcontroller

The MCS-48 series used a special design called a modified Harvard architecture. It had its own memory for programs, called ROM, and a small amount of memory for temporary information, called RAM. It also had special areas for controlling devices, called I/O, which were separate from where programs and data were kept address space.

Even though newer models like the MCS-51 came along, the MCS-48 stayed popular into the year 2000. This was because it cost very little, was easy to find, and used memory very efficiently. Because of these advantages, it was used in many everyday items like TV remotes, computer keyboards, and toys.

Uses

The MCS-48 series was often used in computer and terminal keyboards. It helped turn key presses into signals that digital circuits could understand. This made it easier to connect keyboards with fewer wires.

The 8048 was used in many devices, like the Magnavox Odysseyยฒ video game console and several music machines. The TRS-80 Model II also used this series in its keyboard. The first IBM PC keyboard used an 8048 as well. Later computers used similar chips to control the keyboard and other functions.

Instruction set

The MCS-48 microcontroller has instructions that are one or two bytes long, with most being just one byte. It can handle 4096 bytes of program memory, 256 bytes of RAM, and 256 bytes of extra memory. It also has eight ports for connecting to other devices. Many math and logic tasks use a special area called the accumulator. Eight special memory spots act like quick-access registers, and two of these can point to other memory locations.

The code can jump to different parts of the program, but to reach all parts it needs a special instruction. It supports interruptions well, allowing it to quickly switch tasks and return to where it left off. Each instruction takes one or two steps to complete, and each step lasts for 15 clock signals.

Example code

Here is some assembler code for a routine called add32 that adds two 32-bit numbers stored in little endian order. One number is pointed to by R0, and the other number and the result are pointed to by R1.

OpcodeOperandMnemonicCyclesDescription
76543210
00000000โ€”NOP1No operation
00000010โ€”OUTL BUS,A2Bus latch โ† A
ALUI0011dataADD ADDC MOV ORL ANL XRL2A โ† A ALU #
addhi00100addloJMP add2PC โ† DBF:addhi:addlo
000I0101โ€”EN/DIS I1I โ† 0 (EN) or I โ† 1 (DIS)
00000111โ€”DEC A1A โ† A - 1
00001000โ€”INS A,BUS2A โ† bus
000010PPโ€”IN A,Pp2A โ† Port(p) (Ports 1-2)
00001PPโ€”MOVD A,Pp2A0-3 โ† 8243 Port(p); A4-7 โ† 0 (Ports 4-7)
ALU000Rโ€”INC XCH ORL ANL ADD ADDC
MOVaA XRL MOVAa
1dest โ† dest ALU @Rr (@R0, @R1 only; no DEC)
ALU1RRRโ€”INC XCH ORL ANL ADD ADDC
MOVaA DEC XRL MOVAa
1dest โ† dest ALU Rr
BIT10010addrJBb addr2If A โˆง (1 0-7 โ† addr
addhi10100addloCALL add2(SP) โ† PSW4-7:PC; SP โ† SP + 1; PC โ† DBF:addhi:addlo
00010110addrJTF addr2If TF = 1 then PC0-7 โ† addr (timer flag set)
00010111โ€”INC A1A โ† A + 1
001T0101โ€”EN/DIS TCNTI1TCNTI โ† 0 (EN) or TCNTI โ† 1 (DIS) (timer/counter interrupt)
001F0110addrJNT0 JT0 addr2If F = T0 then PC0-7 โ† addr (test input 0)
00100111โ€”CLR A1A โ† 0
00110111โ€”CPL A1A โ† ยฌA
001110PPโ€”OUTL Pp,A2Port(p) โ† A (Ports 1-2)
00111PPโ€”MOVD Pp,A28243 Port(p) โ† A0-3 (Ports 4-7)
01000010โ€”MOV A,T1A โ† T (Move timer to A)
010T0101โ€”STRT CNT/T1If T = 0 start count else start timer
010F0110addrJNT1 JT1 addr2If F = T1 then PC0-7 โ† addr (test input 1)
01000111โ€”SWAP A1A0-3 โ†” A4-7
01010111โ€”DA A1If A0-4 > 9 OR AC = 1 then A โ† A + 6;
then if A4-7 > 9 OR C = 1 then A โ† A + 0x60
01100010โ€”MOV T,A1T โ† A (Move A to timer)
01100101โ€”STOP TCNT1Stop timer and count
01100111โ€”RRC A1C โ† A0; A0-6 โ† A1-7; A7 โ† C
01110101โ€”ENT0 CLK1Set T0 as a clock output
01110110addrJF1 addr2If F1 = 1 then PC0-7 โ† addr
01110111โ€”RR A1A0-6 โ† A1-7; A7 โ† A0
1000000Rโ€”MOVX A,@Rr2A โ† external @Rr (@R0, @R1 only)
10000011โ€”RET2SP โ† SP - 1; PC โ† (SP)
10N00101โ€”CLR Fn1Fn โ† 0
10000110addrJNI addr2If I input = 0 then PC0-7 โ† addr (test interrupt input low)
10001000dataORL BUS,#2A โ† bus โˆจ #
100010PPdataORL Pp,#2A โ† Port(p) โˆจ # (Ports 1-2)
10001PPโ€”ORLD Pp,A28243 Port(p) โ† 8243 Port(p) โˆจ A0-3 (Ports 4-7)
1001000Rโ€”MOVX @Rr,A2external @Rr โ† A (@R0, @R1 only)
10010011โ€”RETR2SP โ† SP - 1; PC โ† (SP); PSW4-7 โ† (SP)
10N10101โ€”CPL Fn1Fn โ† ยฌFn
10010111โ€”CLR C1C โ† 0
10011000dataANL BUS,#2A โ† bus โˆง #
100110PPdataANL Pp,#2A โ† Port(p) โˆง # (Ports 1-2)
10011PPโ€”ANLD Pp,A28243 Port(p) โ† 8243 Port(p) โˆง A0-3 (Ports 4-7)
10100011โ€”MOVP A,@A2A โ† ROM(PC8-11:A) (read program memory)
10100111โ€”CPL C1C โ† ยฌC
10110011โ€”JMPP @A2PC0-7 โ† A (indirect JMP)
10110110addrJF0 addr2If F0 = 1 then PC0-7 โ† addr
110N0101โ€”SEL RBn1BS โ† n (select register bank)
11000110addrJZ addr2If A = 0 then PC0-7 โ† addr
11000111โ€”MOV A,PSW1A โ† PSW
11010111โ€”MOV PSW,A1PSW โ† A
11100011โ€”MOVP3 A,@A2A โ† ROM(0011:A) (read page 3 program memory)
111N0101โ€”SEL MBn1DBF โ† n (select memory bank: PC11)
111F0110addrJNC JC addr2If F = C then PC0-7 โ† addr
11100111โ€”RL A1A1-7 โ† A0-6; A0 โ† A7
11101RRRaddrDJNZ Rr,addr2Rr โ† Rr - 1; If Rr โ‰  0 then PC0-7 โ† addr
11110111โ€”RLC A1C โ† A7; A1-7 โ† A0-6; A0 โ† C
76543210OperandMnemonicCyclesDescription
RRR or R3210ALUALUI #immed
R0 @R00000ADD A,# (A โ† A + #)
R1 @R10001INC arg (arg โ† arg + 1)ADDC A,# (A โ† A + # + C)
R20010XCH A,arg (A โ†” arg)MOV R,# (R โ† #)
R30011
R40100ORL A,arg (A โ† A โˆจ arg)ORL A,# (A โ† A โˆจ #)
R50101ANL A,arg (A โ† A โˆง arg)ANL A,# (A โ† A โˆง #)
R60110ADD A,arg (A โ† A + arg)
R70111ADDC A,arg (A โ† A + arg + C)
1010MOV arg,A (arg โ† A)
1100DEC arg (arg โ† arg - 1)
1101XRL A,arg (A โ† A โŠป arg)XRL A,# (A โ† A โŠป #)
1111MOV A,arg (A โ† arg)
RRR or R3210ALUALUI #immed

Variants

The 8049 model had a special type of memory called masked ROM, with space for 2 KB, which could be swapped for a larger 4 KB external ROM. It also included 128 bytes of RAM and 27 I/O ports for connecting to other devices. The chip used an oscillator to manage its timing, turning the clock frequency into different steps for processing.

The UPI-41 series was a version of the MCS-48 made for use with peripheral devices. These chips included a buffered parallel data-bus interface and some changed instructions to help them work with this setup.

An Intel 8049 microcontroller, as used in a HP3478A multimeter. This chip was manufactured in the second week of 1984.
The 8749 with UV EPROM
Microcontroller
DeviceProgram memoryData memoryRemarks
80201K ร— 8 ROM64 ร— 8 RAMsubset of 8048, 20 pins, only 13 I/O lines
80211K ร— 8 ROM64 ร— 8 RAMsubset of 8048, 28 pins, 21 I/O lines
80222K ร— 8 ROM64 ร— 8 RAMsubset of 8048, A/D-converter
8035none64 ร— 8 RAM
8038none64 ร— 8 RAM
8039none128 ร— 8 RAM
8040none256 ร— 8 RAM
80481K ร— 8 ROM64 ร— 8 RAM27ร—ย I/O ports
80492K ร— 8 ROM128 ร— 8 RAM27ร—ย I/O ports
80504K x 8 ROM256 ร— 8 RAM
86481K ร— 8 OTP EPROM64 ร— 8 RAMFactory OTP EPROM
87481K ร— 8 EPROM64 ร— 8 RAM4K program memory expandable, 2ร—ย 8-bit timers, 27ร—ย I/O ports
87492K ร— 8 EPROM128 ร— 8 RAM2ร—ย 8-bit timers, 27ร—ย I/O ports
87P50ext. ROM socket256 ร— 8 RAMHas piggy-back socket for 2758/2716/2732 EPROM
Universal Peripheral Interface
DeviceProgram memoryData memoryRemarks
80411K ร— 8 ROM64 ร— 8 RAMUniversal Peripheral Interface (UPI)
8041AH1K ร— 8 ROM128 ร— 8 RAMUPI
8741A1K ร— 8 EPROM64 ร— 8 RAMUPI, EPROM version of 8041
8741AH1K ร— 8 OTP EPROM128 ร— 8 RAMUPI, OTP EPROM version of 8041AH
8042AH2K ร— 8 ROM256 ร— 8 RAMUPI
82422K ร— 8 ROM256 ร— 8 RAMUPI, preprogrammed with keyboard controller firmware
87422K ร— 8 EPROM128 ร— 8 RAMUPI, EPROM version
8742AH2K ร— 8 OTP EPROM256 ร— 8 RAMUPI, OTP EPROM version of 8042AH

Derived microcontrollers

Philips Semiconductors, now known as NXP, had permission to make copies of this series. They created their MAB8400-family using the same design. These were the first microcontrollers to include an IยฒC connection and were used in the first Philips (Magnavox in the US) Compact Disc players, like the CD-100.

Other companies also made versions of this design, including:

Images

An Intel P8242 keyboard controller chip, used in older computers to manage keyboard functions.
An EPROM microcontroller chip showing its pins and package, used for storing computer programs.
A close-up of a Mitsubishi aircraft engine component, showcasing engineering details.
An 8-bit microcomputer used for learning about early computer technology and electronics.
An old Soviet-era microcontroller chip, similar to modern computer components.
An early microcontroller setup used before single-chip controllers were developed.
A magnified view of an integrated circuit showing its tiny electronic components.
A detailed close-up of an integrated circuit, showing tiny electronic components and pathways.
An illustration of the NEC D8749HD microcontroller, showing its design and structure.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Intel MCS-48, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.