Ps 2 Usb
Ps 2 Usb
Ps 2 Usb
freescale.com
Revision History
Date 04/2006 03/2003 Revision Level 1 0 Replaced unclear schematic. Initial release Description Page Number(s) 26 N/A
USB and PS/2 Multimedia Keyboard Interface, Rev. 1.0 Freescale Semiconductor 3
Revision History
USB and PS/2 Multimedia Keyboard Interface, Rev. 1.0 4 Freescale Semiconductor
Table of Contents
Chapter 1 USB and PS/2 Multimedia Keyboard Interface
1.1 1.2 1.3 1.4 1.4.1 1.4.2 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.5.10 1.6 1.7 1.8 1.8.1 1.8.2 1.9 1.10 1.10.1 1.11 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 44-pin QFP MC68HC908JB8 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Hardware Descriptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Key Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 In-Circuit Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Firmware Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 USB and PS/2 Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 PS/2 Main Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 PS/2 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Host to Device Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Device to Host Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 PS/2 Keyboard Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Host to Keyboard Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Keyboard to Host Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 PS/2 Scan Codes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 USB Main Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Firmware Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Test Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Firmware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Extra Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Further Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Appendix A. Glossary
Table of Contents
1.2 Overview
The Freescale MC68HC908JB8 is a member of the HC08 Family of microcontrollers (MCUs). The features of the MC68HC908JB8 include a configured Universal Serial Bus (USB) or PS/2 interface, which makes this MCU suited for personal computer Human Interface Devices (HID), such as mice and keyboards. The MC68HC908JB8 is available in several packages to fit into various applications. A multimedia keyboard with USB and PS/2 interface is demonstrated using the MC68HC908JB8 with a 44-pin QFP package. The main features of the keyboard include: Fully USB specification 1.1 compliant USB or PS/2 interface auto detect Windows 98, ME and 2000 compatible Power management keys (power, wake and sleep) support Multimedia key support In-circuit programming for firmware modification
USB Plug
6 1 2 4
USB Plug
PS/2 Plug
Figure 1-2. USB and PS/2 Connections Figure 1-1 shows the block diagram of the keyboard. The solution includes the JB8, key button inputs and LED indicator outputs only. The connections of the corresponding USB and PS/2 signals are shown in Figure 1-2 The USB to PS/2 converter standard connections are the USB D and D+ pins connected to the PS/2 Data and Clock pins respectively. Figure 1-3. shows the printed circuit board and Figure 1-16 shows the schematic of the keyboard. J1 is used for USB connection J2 is used for PS/2 mouse connection (for future development) J3 and J7 are used for in-circuit programming 8 rows x 18 columns key matrix is implemented 8 rows implemented in PTA[7:0] 18 columns implemented in PTB[7:0], PTC[7:0], PTE0 and PTE2 Keyboard LEDs Scroll Lock at PTD2 Caps Lock at PTD3 Num Lock at PTD4 Figure 1-4 shows the key matrix for the 107 standard keyboard with power management keys (Power, Wake and Sleep). Figure 1-5 shows the key matrix for multimedia keyboard with function key.
Hardware Descriptions
PTA0
End
8 + =
1 ~ `
F5
0 _ ? /
F10
PTA1
Home
F8
F2
F1
INS
DEL
Lctrl
F9
PTA2
N M H J
B
Num Lck
RALT
F12
V G
C F4
Z
ESC
*
. 3
RCTRL
ENT RGUI : ; [{
0 2
SPC
LALT
F11 | \
Bck Spc
S
Caps Lck
RSFT
PTA6
F7
]}
F3 E
TAB
4 7
LSFT
Scrl Lck
LGUI
PTA7
WAKE
Pause
PTA0
JPN3
F4
ESC
Fn
PTA1
INS
F5
F1
MK3
PTA2
MK6 LSFT
MK9
DEL
Num Lck
F6
F2
SLEEP
*
4 5
0 U I $64
JPN1
F7 F8 F10
V A S
R 1 2
F3
MK8
Caps Lck
B 6 Y
[{ ]}
| \
Prnt Scr Scrl Lck
~ `
TAB
LALT
LANG 1
MK11
PTA6
RALT
LANG 2
$85
F11
SPC
H RGUI
$32
PTA7
/F
< ,
F9
Firmware Description
INITIALIZATION
YES
PS/2
NO YES USB
OVER 10 SECONDS ? NO NO
USB RESET?
NO YES
SETUP DETECTED ? NO NO
USB
OVER 10 SECONDS ?
YES USB
Table 1-1 shows the setting of the registers for controlling the PTE3 (Clock) and the PTE4 (Data) pins. Instead of setting DDR3/DDR4 as high to output a high signal, we set DDR3/DDR4 as an input with internal pullup to perform the same function. In the PS/2 routines, the values of PTE3 and PTE4 are cleared to zero and the values of PTE3P and PTE4P are set to one. Set DDR3 or DDR4 to one to force it as output low, or clear DDR3 or DDR4 to zero to make it high impedance and pulled high by the 5K internal resistor.
USB and PS/2 Multimedia Keyboard Interface, Rev. 1 12 Freescale Semiconductor
Firmware Description
PS/2 INITIALIZATION
SELF TEST PASS ? YES SEND SELF TEST PASS CODE ($AA)
NO
STOP
NO
NO
START DATA0 DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 PARITY STOP ACK
Figure 1-9. Host to Device Communication KBD_IN is the IRQ1 interrupt routine for receiving data from host. The interrupt is configured to execute when a falling edge at the PTE4 (Data) pin is detected.
Firmware Description
6. Device reads the Clock line and aborts communication if the Clock line is low. 7. Repeat steps 4 to 6 for Data 0 to Data 7, the parity bit and the stop bit. 8. Device releases the Clock line high.
STEP 1,2 CLOCK 4 7 8 5,6
DATA 3 START DATA0 DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 PARITY STOP
Figure 1-10. Device to Host Communication KBD_OUT is the routine for transmitting data to the host. The data to be transmitted is put into V_TxByte before calling this routine.
Firmware Description
USB INITIALIZATION
NO
NO YES USB IDLE FOR 6 ms ? SUSPEND DEVICE KEY PRESSED OR RESUME FROM HOST ? YES
Firmware Description
NO EOP ?
YES SETUP ?
SETUP HANDLER
NO EP1 TX COMPLETED ? YES DISABLE EP1 TRANSMIT & CLEAR EP1 TX FLAG
EP2 TX COMPLETED ?
NO RESUME FORM HOST? NO RETURN FROM INTERRUPT YES CLEAR RESUME FLAG
SETUP HANDLER
1.UNSTALL EP 0 IN & OUT 2.COPY 8 BYTE SETUP DATA TO RAM BUFFER 3.CLEAR EP0 RX FLAG 4.SET NAK TO IN EP0
YES
YES
RETURN
STATUS STAGE ?
YES
1. SET NAK TO EP0 IN 2. SET STALL TO EP0 OUT (CONTROL TRANSFER COMPLETED)
VALID DATA
Firmware Description
IN EPO HANDLER
STATUS STAGE ?
YES
NO [DATA STAGE] ALL DATA SENT? NO PREPARE FOR NEXT DATA STAGE RETURN YES PREPARE FOR OUT STAGE
Figure 1-15. . IN EPO HANDLER USB Key Codes The key codes or usage IDs for a basic 104 keyboard are defined in the USB HID Usage Tables. In addition to the basic key codes, Microsoft has published standards for the Windows keys, Power Management keys (sleep, wake, and power), and the audio control keys. ACPI Power Management Control Table 1-7. Consumer Page HID Controls in Windows ME and 2000
USAGE $81 $82 $83 USAGE NAME Power Sleep Wake DATA TYPE Relative Relative Relative
Consumer Page Audio Control Table 1-8. Consumer Page HID Controls in Windows ME and 2000
USAGE $B5 $B6 $B7 $CD $E0 $E2 $E3 USAGE NAME Scan Next Track Scan Previous Track Stop Play/Pause Volume Mute Bass USAGE TYPE One Shot Control One Shot Control One Shot Control One Shot Control Linear Control On/Off Control Linear Control DATA TYPE Relative Relative Relative Relative Relative Relative Relative
Table 1-8. Consumer Page HID Controls in Windows ME and 2000 (Continued)
USAGE $E $E5 $E9 $EA $152 $153 $154 $155 $18A $221 $223 $224 $225 $226 $227 $183 $192 $194 Treble Bass Boost Volume Increment Volume Decrement Bass Increment Bass Decrement Treble Increment Treble Decrement AL Email Reader Bass Increment Bass Increment Bass Increment Bass Increment Bass Increment Bass Increment AL Consumer Control Configuration AL Calculator(1) AL Local Browser
(1) (1)
USAGE NAME
USAGE TYPE Linear Control On/Off Control Re-Trigger Control Re-Trigger Control Re-Trigger Control Re-Trigger Control Re-Trigger Control Re-Trigger Control Selector Selector Selector Selector Selector Selector Selector Selector Selector Selector
DATA TYPE Relative Relative Absolute Absolute Absolute Absolute Absolute Absolute Relative Relative Relative Relative Relative Relative Relative Relative Relative Relative
NOTES:
1. Currently supported in Windows ME only.
USB Keyboard Report The keyboard implements two HID interfaces on endpoint 1 and 2 in a USB composite-device fashion. HID interface 0 (endpoint 1) implements a standard HID keyboard with identical report and boot protocols. HID interface 1 (endpoint 2) implements multimedia and power management keys. This implementation ensures the keyboard works in BIOS setup and in DOS mode. Interface 0 will issue 8-byte input reports that are identical to the standard keyboard boot protocol report (see Table 1-9) as documented in the Device Class Definition for Human Interface Device (HID) version 1.1. This interface also allows the host system to turn on and off the respective LED state indicators, as specified by the 1-byte output report (see Table 1-10). Table 1-9. Interface 0 Input Report
Byte 0 1 2 3 4 5 6 7 Bit 7 Right GUI Bit 6 Right ALT Bit 5 Right Shift Bit 4 Right Control Bit 3 Left GUI Bit 2 Left ALT Bit 1 Left Shift Bit 0 Left Control
Reserved Keyboard Usage ID (Key Code) Keyboard Usage ID (Key Code) Keyboard Usage ID (Key Code) Keyboard Usage ID (Key Code) Keyboard Usage ID (Key Code) Keyboard Usage ID (Key Code)
Firmware Description
Interface 1 issues power management key or multimedia key input reports, which are distinguished by a unique Report ID. The power management key uses Report ID number 1 and the multimedia key uses Report ID number 2 (see Table 1-11 and Table 1-12). Table 1-11. Interface 1 Power Key Input Report
Byte 0 1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Power Bit 1 Wake Bit 0 Sleep Report ID = 1
Table 1-13 shows some input report examples. Report ID is not used in interface 0. The first byte is the modifier byte and is set on bit basis. Whenever a modifier key is pressed, the corresponding bit is set to one. For example, if the Left Control and the character A keys are pressed, the first byte of the report equals $01, the second byte is reserved, the third byte equals $04, and the forth to the eight bytes equal $00. Power Management keys are reported through interface 1 with report ID 1. For example, if the Wake key is pressed, the first byte of the report ID equals $01, and the second byte equals $02 since the Wake key is defined as bit 2 of the second byte Hot keys are reported through interface 1 with reported ID 2. For example, if hot key 0 and hot key 17 are pressed, the first byte of report ID equals $02, the second byte equals $01 since hot key 0 is pressed, the third byte equals $00 since hot keys 8 to 16 are not pressed, and the forth byte equals $02 since the hot key 17 is pressed. Table 1-13. Input Report Examples
Keys Pressed Left Control, A Left Control, Right Alt, A, B Wake Hot Key 0 & Hot Key 17 Endpoint 1 1 2 2 In Report Data $01,$00,$04,$00,$00,$00,$00,$00 $41,$00,$04,$05,$00,$00,$00,$00 $01,$02 $02,$01,$00,$02
JB8-PSU.ASM
PS2-SCAN.ASM PS2-KEY.ASM
JB8-USB.ASM
1.8 Customization
1.8.1 Hardware
Leave unused row and column lines unconnected since they are pulled high by internal resistors.
Extra Features
1.8.2 Firmware
Modify the key matrix tables in "ps2-key.asm" and "usb-key.asm" according to customized key matrix layout Change vendor ID, product ID and product revision number in the device descriptor table in "usb-key.h" Change vendor name and product name in the string descriptor table in "usb-key.h" Change the report descriptor in "usb-key.h" if necessary.
1.11 Schematics
Figure 1-16 shows the schematics for the reference design.
Appendix A. Glossary
A See accumulator (A). accumulator (A) An 8-bit general-purpose register in the CPU08. The CPU08 uses the accumulator to hold operands and results of arithmetic and logic operations. acquisition mode A mode of PLL operation during startup before the PLL locks on a frequency. Also see "tracking mode." address bus The set of wires that the CPU or DMA uses to read and write memory locations. addressing mode The way that the CPU determines the operand address for an instruction. The M68HC08 CPU has 16 addressing modes. ALU See arithmetic logic unit (ALU). arithmetic logic unit (ALU) The portion of the CPU that contains the logic circuitry to perform arithmetic, logic, and manipulation operations on operands. asynchronous Refers to logic circuits and operations that are not synchronized by a common reference signal. baud rate The total number of bits transmitted per unit of time. BCD See binary-coded decimal (BCD). binary Relating to the base 2 number system. binary number system The base 2 number system, having two digits, 0 and 1. Binary arithmetic is convenient in digital circuit design because digital circuits have two permissible voltage levels, low and high. The binary digits 0 and 1 can be interpreted to correspond to the two digital voltage levels. binary-coded decimal (BCD) A notation that uses 4-bit binary numbers to represent the 10 decimal digits and that retains the same positional structure of a decimal number. For example, 234 (decimal) = 0010 0011 0100 (BCD) bit A binary digit. A bit has a value of either logic 0 or logic 1. branch instruction An instruction that causes the CPU to continue processing at a memory location other than the next sequential address. break module A module in the M68HC08 Family. The break module allows software to halt program execution at a programmable point in order to enter a background routine. breakpoint A number written into the break address registers of the break module. When a number appears on the internal address bus that is the same as the number in the break address registers, the CPU executes the software interrupt instruction (SWI). break interrupt A software interrupt caused by the appearance on the internal address bus of the same value that is written in the break address registers.
USB and PS/2 Multimedia Keyboard Interface, Rev. 1 Freescale Semiconductor 27
bus A set of wires that transfers logic signals. bus clock The bus clock is derived from the CGMOUT output from the CGM. The bus clock frequency, fop, is equal to the frequency of the oscillator output, CGMXCLK, divided by four. byte A set of eight bits. C The carry/borrow bit in the condition code register. The CPU08 sets the carry/borrow bit when an addition operation produces a carry out of bit 7 of the accumulator or when a subtraction operation requires a borrow. Some logical operations and data manipulation instructions also clear or set the carry/borrow bit (as in bit test and branch instructions and shifts and rotates). CCR See condition code register. central processor unit (CPU) The primary functioning unit of any computer system. The CPU controls the execution of instructions. CGM See clock generator module (CGM). clear To change a bit from logic 1 to logic 0; the opposite of set. clock A square wave signal used to synchronize events in a computer. clock generator module (CGM) A module in the M68HC08 Family. The CGM generates a base clock signal from which the system clocks are derived. The CGM may include a crystal oscillator circuit and or phase-locked loop (PLL) circuit. comparator A device that compares the magnitude of two inputs. A digital comparator defines the equality or relative differences between two binary numbers. computer operating properly module (COP) A counter module in the M68HC08 Family that resets the MCU if allowed to overflow. condition code register (CCR) An 8-bit register in the CPU08 that contains the interrupt mask bit and five bits that indicate the results of the instruction just executed. control bit One bit of a register manipulated by software to control the operation of the module. control unit One of two major units of the CPU. The control unit contains logic functions that synchronize the machine and direct various operations. The control unit decodes instructions and generates the internal control signals that perform the requested operations. The outputs of the control unit drive the execution unit, which contains the arithmetic logic unit (ALU), CPU registers, and bus interface. COP See "computer operating properly module (COP)." counter clock The input clock to the TIM counter. This clock is the output of the TIM prescaler. CPU See central processor unit (CPU). CPU08 The central processor unit of the M68HC08 Family. CPU clock The CPU clock is derived from the CGMOUT output from the CGM. The CPU clock frequency is equal to the frequency of the oscillator output, CGMXCLK, divided by four. CPU cycles A CPU cycle is one period of the internal bus clock, normally derived by dividing a crystal oscillator source by two or more so the high and low times will be equal. The length of time required to execute an instruction is measured in CPU clock cycles.
CPU registers Memory locations that are wired directly into the CPU logic instead of being part of the addressable memory map. The CPU always has direct access to the information in these registers. The CPU registers in an M68HC08 are: A (8-bit accumulator) H:X (16-bit index register) SP (16-bit stack pointer) PC (16-bit program counter) CCR (condition code register containing the V, H, I, N, Z, and C bits) CSIC customer-specified integrated circuit cycle time The period of the operating frequency: tCYC = 1/fOP. decimal number system Base 10 numbering system that uses the digits zero through nine. direct memory access module (DMA) A M68HC08 Family module that can perform data transfers between any two CPU-addressable locations without CPU intervention. For transmitting or receiving blocks of data to or from peripherals, DMA transfers are faster and more code-efficient than CPU interrupts. DMA See "direct memory access module (DMA)." DMA service request A signal from a peripheral to the DMA module that enables the DMA module to transfer data. duty cycle A ratio of the amount of time the signal is on versus the time it is off. Duty cycle is usually represented by a percentage. EEPROM Electrically erasable, programmable, read-only memory. A nonvolatile type of memory that can be electrically reprogrammed. EPROM Erasable, programmable, read-only memory. A nonvolatile type of memory that can be erased by exposure to an ultraviolet light source and then reprogrammed. exception An event such as an interrupt or a reset that stops the sequential execution of the instructions in the main program. external interrupt module (IRQ) A module in the M68HC08 Family with both dedicated external interrupt pins and port pins that can be enabled as interrupt pins. fetch To copy data from a memory location into the accumulator. firmware Instructions and data programmed into nonvolatile memory. free-running counter A device that counts from zero to a predetermined number, then rolls over to zero and begins counting again. full-duplex transmission Communication on a channel in which data can be sent and received simultaneously. H The upper byte of the 16-bit index register (H:X) in the CPU08. H The half-carry bit in the condition code register of the CPU08. This bit indicates a carry from the low-order four bits of the accumulator value to the high-order four bits. The half-carry bit is required for
binary-coded decimal arithmetic operations. The decimal adjust accumulator (DAA) instruction uses the state of the H and C bits to determine the appropriate correction factor. hexadecimal Base 16 numbering system that uses the digits 0 through 9 and the letters A through F. high byte The most significant eight bits of a word. illegal address An address not within the memory map illegal opcode A nonexistent opcode. I The interrupt mask bit in the condition code register of the CPU08. When I is set, all interrupts are disabled. index register (H:X) A 16-bit register in the CPU08. The upper byte of H:X is called H. The lower byte is called X. In the indexed addressing modes, the CPU uses the contents of H:X to determine the effective address of the operand. H:X can also serve as a temporary data storage location. input/output (I/O) Input/output interfaces between a computer system and the external world. A CPU reads an input to sense the level of an external signal and writes to an output to change the level on an external signal. instructions Operations that a CPU can perform. Instructions are expressed by programmers as assembly language mnemonics. A CPU interprets an opcode and its associated operand(s) and instruction. interrupt A temporary break in the sequential execution of a program to respond to signals from peripheral devices by executing a subroutine. interrupt request A signal from a peripheral to the CPU intended to cause the CPU to execute a subroutine. I/O See input/output (I/0). IRQ See "external interrupt module (IRQ)." jitter Short-term signal instability. latch A circuit that retains the voltage level (logic 1 or logic 0) written to it for as long as power is applied to the circuit. latency The time lag between instruction completion and data movement. least significant bit (LSB) The rightmost digit of a binary number. logic 1 A voltage level approximately equal to the input power voltage (VDD). logic 0 A voltage level approximately equal to the ground voltage (VSS). low byte The least significant eight bits of a word. low voltage inhibit module (LVI) A module in the M68HC08 Family that monitors power supply voltage. LVI See "low voltage inhibit module (LVI)." M68HC08 A Motorola family of 8-bit MCUs. mark/space The logic 1/logic 0 convention used in formatting data in serial communication.
mask 1. A logic circuit that forces a bit or group of bits to a desired state. 2. A photomask used in integrated circuit fabrication to transfer an image onto silicon. mask option A optional microcontroller feature that the customer chooses to enable or disable. mask option register (MOR) An EPROM location containing bits that enable or disable certain MCU features. MCU Microcontroller unit. See microcontroller. memory location Each M68HC08 memory location holds one byte of data and has a unique address. To store information in a memory location, the CPU places the address of the location on the address bus, the data information on the data bus, and asserts the write signal. To read information from a memory location, the CPU places the address of the location on the address bus and asserts the read signal. In response to the read signal, the selected memory location places its data onto the data bus. memory map A pictorial representation of all memory locations in a computer system. microcontroller Microcontroller unit (MCU). A complete computer system, including a CPU, memory, a clock oscillator, and input/output (I/O) on a single integrated circuit. modulo counter A counter that can be programmed to count to any number from zero to its maximum possible modulus. monitor ROM A section of ROM that can execute commands from a host computer for testing purposes. MOR See "mask option register (MOR)." most significant bit (MSB) The leftmost digit of a binary number. multiplexer A device that can select one of a number of inputs and pass the logic level of that input on to the output. N The negative bit in the condition code register of the CPU08. The CPU sets the negative bit when an arithmetic operation, logical operation, or data manipulation produces a negative result. nibble A set of four bits (half of a byte). object code The output from an assembler or compiler that is itself executable machine code, or is suitable for processing to produce executable machine code. opcode A binary code that instructs the CPU to perform an operation. open-drain An output that has no pullup transistor. An external pullup device can be connected to the power supply to provide the logic 1 output voltage. operand Data on which an operation is performed. Usually a statement consists of an operator and an operand. For example, the operator may be an add instruction, and the operand may be the quantity to be added. oscillator A circuit that produces a constant frequency square wave that is used by the computer as a timing and sequencing reference. OTPROM One-time programmable read-only memory. A nonvolatile type of memory that cannot be reprogrammed. overflow A quantity that is too large to be contained in one byte or one word. page zero The first 256 bytes of memory (addresses $0000$00FF).
USB and PS/2 Multimedia Keyboard Interface, Rev. 1 Freescale Semiconductor 31
parity An error-checking scheme that counts the number of logic 1s in each byte transmitted. In a system that uses odd parity, every byte is expected to have an odd number of logic 1s. In an even parity system, every byte should have an even number of logic 1s. In the transmitter, a parity generator appends an extra bit to each byte to make the number of logic 1s odd for odd parity or even for even parity. A parity checker in the receiver counts the number of logic 1s in each byte. The parity checker generates an error signal if it finds a byte with an incorrect number of logic 1s. PC See program counter (PC). peripheral A circuit not under direct CPU control. phase-locked loop (PLL) A oscillator circuit in which the frequency of the oscillator is synchronized to a reference signal. PLL See "phase-locked loop (PLL)." pointer Pointer register. An index register is sometimes called a pointer register because its contents are used in the calculation of the address of an operand, and therefore points to the operand. polarity The two opposite logic levels, logic 1 and logic 0, which correspond to two different voltage levels, VDD and VSS. polling Periodically reading a status bit to monitor the condition of a peripheral device. port A set of wires for communicating with off-chip devices. prescaler A circuit that generates an output signal related to the input signal by a fractional scale factor such as 1/2, 1/8, 1/10 etc. program A set of computer instructions that cause a computer to perform a desired operation or operations. program counter (PC) A 16-bit register in the CPU08. The PC register holds the address of the next instruction or operand that the CPU will use. pull An instruction that copies into the accumulator the contents of a stack RAM location. The stack RAM address is in the stack pointer. pullup A transistor in the output of a logic gate that connects the output to the logic 1 voltage of the power supply. pulse-width The amount of time a signal is on as opposed to being in its off state. pulse-width modulation (PWM) Controlled variation (modulation) of the pulse width of a signal with a constant frequency. push An instruction that copies the contents of the accumulator to the stack RAM. The stack RAM address is in the stack pointer. PWM period The time required for one complete cycle of a PWM waveform. RAM Random access memory. All RAM locations can be read or written by the CPU. The contents of a RAM memory location remain valid until the CPU writes a different value or until power is turned off. RC circuit A circuit consisting of capacitors and resistors having a defined time constant. read To copy the contents of a memory location to the accumulator. register A circuit that stores a group of bits.
reserved memory location A memory location that is used only in special factory test modes. Writing to a reserved location has no effect. Reading a reserved location returns an unpredictable value. reset To force a device to a known condition. ROM Read-only memory. A type of memory that can be read but cannot be changed (written). The contents of ROM must be specified before manufacturing the MCU. SCI See "serial communication interface module (SCI)." serial Pertaining to sequential transmission over a single line. serial communications interface module (SCI) A module in the M68HC08 Family that supports asynchronous communication. serial peripheral interface module (SPI) A module in the M68HC08 Family that supports synchronous communication. set To change a bit from logic 0 to logic 1; opposite of clear. shift register A chain of circuits that can retain the logic levels (logic 1 or logic 0) written to them and that can shift the logic levels to the right or left through adjacent circuits in the chain. signed A binary number notation that accommodates both positive and negative numbers. The most significant bit is used to indicate whether the number is positive or negative, normally logic 0 for positive and logic 1 for negative. The other seven bits indicate the magnitude of the number. software Instructions and data that control the operation of a microcontroller. software interrupt (SWI) An instruction that causes an interrupt and its associated vector fetch. SPI See "serial peripheral interface module (SPI)." stack A portion of RAM reserved for storage of CPU register contents and subroutine return addresses. stack pointer (SP) A 16-bit register in the CPU08 containing the address of the next available storage location on the stack. start bit A bit that signals the beginning of an asynchronous serial transmission. status bit A register bit that indicates the condition of a device. stop bit A bit that signals the end of an asynchronous serial transmission. subroutine A sequence of instructions to be used more than once in the course of a program. The last instruction in a subroutine is a return from subroutine (RTS) instruction. At each place in the main program where the subroutine instructions are needed, a jump or branch to subroutine (JSR or BSR) instruction is used to call the subroutine. The CPU leaves the flow of the main program to execute the instructions in the subroutine. When the RTS instruction is executed, the CPU returns to the main program where it left off. synchronous Refers to logic circuits and operations that are synchronized by a common reference signal. TIM See "timer interface module (TIM)." timer interface module (TIM) A module used to relate events in a system to a point in time. timer A module used to relate events in a system to a point in time.
toggle To change the state of an output from a logic 0 to a logic 1 or from a logic 1 to a logic 0. tracking mode Mode of low-jitter PLL operation during which the PLL is locked on a frequency. Also see "acquisition mode." twos complement A means of performing binary subtraction using addition techniques. The most significant bit of a twos complement number indicates the sign of the number (1 indicates negative). The twos complement negative of a number is obtained by inverting each bit in the number and then adding 1 to the result. unbuffered Utilizes only one register for data; new data overwrites current data. unimplemented memory location A memory location that is not used. Writing to an unimplemented location has no effect. Reading an unimplemented location returns an unpredictable value. Executing an opcode at an unimplemented location causes an illegal address reset. V The overflow bit in the condition code register of the CPU08. The CPU08 sets the V bit when a two's complement overflow occurs. The signed branch instructions BGT, BGE, BLE, and BLT use the overflow bit. variable A value that changes during the course of program execution. VCO See "voltage-controlled oscillator." vector A memory location that contains the address of the beginning of a subroutine written to service an interrupt or reset. voltage-controlled oscillator (VCO) A circuit that produces an oscillating output signal of a frequency that is controlled by a dc voltage applied to a control input. waveform A graphical representation in which the amplitude of a wave is plotted against time. wired-OR Connection of circuit outputs so that if any output is high, the connection point is high. word A set of two bytes (16 bits). write The transfer of a byte of data from the CPU to a memory location. X The lower byte of the index register (H:X) in the CPU08. Z The zero bit in the condition code register of the CPU08. The CPU08 sets the zero bit when an arithmetic operation, logical operation, or data manipulation produces a result of $00.
Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document. Freescale Semiconductor reserves the right to make changes without further notice to any products herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. Typical parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including Typicals, must be validated for each customer application by customers technical experts. Freescale Semiconductor does not convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur. Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part. Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their respective owners. Freescale Semiconductor, Inc. 2003, 2004, 2006. All rights reserved.