ST6/ST7
   HOME

TheInfoList



OR:

The ST6 and ST7 are 8-bit microcontroller product lines from STMicroelectronics. They are commonly used in small embedded applications like
washing machines A washing machine (laundry machine, clothes washer, washer, or simply wash) is a home appliance used to wash laundry. The term is mostly applied to machines that use water as opposed to dry cleaning (which uses alternative cleaning fluids and i ...
. Although they use similar peripherals and are marketed as part of the same product line,Datasheet: ST62T00C/T01C from 1998 100616 edn.com the two architectures are actually quite different. Both have an 8-bit accumulator used for most operations, plus two 8-bit index registers (X and Y) used for memory addressing. Also both have 8-bit instructions followed by up to 2 bytes of operands, and both have support for manipulating and branching on individual bits of memory. There, the similarities end. The ST6 is a
Harvard architecture The Harvard architecture is a computer architecture with separate storage and signal pathways for instructions and data. It contrasts with the von Neumann architecture, where program instructions and data share the same memory and pathways. ...
with an 8-bit (256 byte) data address space and a separate 12-bit (4096 byte) program space. Operands are always 1 byte long, and some instructions support two operands, such as "move 8-bit immediate to 8-bit memory address". Subroutine calls are done using a separate hardware stack. Data registers (but not the program counter or flags) are memory-mapped. The ST6's
addressing mode Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how the machine language instructions i ...
s are limited to immediate, 8-bit absolute memory address, and register indirect modes (X) and (Y). The ST7 is a
von Neumann architecture The von Neumann architecture — also known as the von Neumann model or Princeton architecture — is a computer architecture based on a 1945 description by John von Neumann, and by others, in the '' First Draft of a Report on the EDVAC''. T ...
with a single 16-bit (64 kiB) address space. The first 256 bytes of RAM (the
zero page The zero page or base page is the block of memory at the very beginning of a computer's address space; that is, the page whose starting address is zero. The size of a page depends on the context, and the significance of zero page memory versus h ...
) have extra flexibility. There are no two-operand instructions except for "test bit and branch". Its registers are not memory-mapped, and it uses general-purpose RAM (plus a
stack pointer In computer science, a call stack is a stack data structure that stores information about the active subroutines of a computer program. This kind of stack is also known as an execution stack, program stack, control stack, run-time stack, or mach ...
register) for subroutine calls. The ST7 supports a wide variety of addressing modes, including base+index and double-indirect.


ST6 architecture

The ST6 has 64 bytes of
RAM Ram, ram, or RAM may refer to: Animals * A male sheep * Ram cichlid, a freshwater tropical fish People * Ram (given name) * Ram (surname) * Ram (director) (Ramsubramaniam), an Indian Tamil film director * RAM (musician) (born 1974), Dutch * ...
and 4096 bytes of program
ROM Rom, or ROM may refer to: Biomechanics and medicine * Risk of mortality, a medical classification to estimate the likelihood of death for a patient * Rupture of membranes, a term used during pregnancy to describe a rupture of the amniotic sac * ...
. Larger amounts are accessed by bank-switching the low 2K section of the ROM. The RAM address space is actually 256 bytes, divided as follows: * 0–63: Not implemented * 64–127: Bank-switchable window into program ROM and data
EPROM An EPROM (rarely EROM), or erasable programmable read-only memory, is a type of programmable read-only memory (PROM) chip that retains its data when its power supply is switched off. Computer memory that can retrieve stored data after a power s ...
. * 128–191: General-purpose RAM * 192–255: Peripheral control registers (GPIO ports, timers, etc.) The accumulator is mapped at address 255, but is more commonly addressed implicitly. Not mapped into the address space is a 12-bit program counter and an associated hardware stack (four or six levels deep, depending on model). There are only two status bits (
carry Carry or carrying may refer to: People *Carry (name) Finance * Carried interest (or carry), the share of profits in an investment fund paid to the fund manager * Carry (investment), a financial term: the carry of an asset is the gain or cost of h ...
and
zero 0 (zero) is a number representing an empty quantity. In place-value notation such as the Hindu–Arabic numeral system, 0 also serves as a placeholder numerical digit, which works by multiplying digits to the left of 0 by the radix, usual ...
), and they are banked based on processor mode, with separate status bits for normal, interrupt and
non-maskable interrupt In computing, a non-maskable interrupt (NMI) is a hardware interrupt that standard interrupt-masking techniques in the system cannot ignore. It typically occurs to signal attention for non-recoverable hardware errors. Some NMIs may be masked, but ...
operation. The first four general-purpose RAM locations are also known as the X, Y, V and W registers, and some instructions can access them using special short addressing modes. The X and Y registers serve as index registers, and can use indirect addressing modes (X) and (Y). The instruction set consists of one byte of opcode, followed by up to two one-byte operands. The instruction set can be summarized as follows: †: ^ a b Confusingly, different models of the ST6 family use different conventions for the value of the
carry bit In computer processors the carry flag (usually indicated as the C flag) is a single bit in a system status register/flag register used to indicate when an arithmetic carry or borrow has been generated out of the most significant arithmetic logic ...
after a subtraction. ST60 processors use the "carry" convention, which clears the bit if the subtract underflows, while the ST62 and ST63 processors use the "borrow" convention, which sets the bit in that case.


ST7 architecture

The ST7 has six registers: the accumulator, X and Y index registers, stack pointer, program counter, and condition code register. Also, double-indirect addressing allows the zero page of RAM to serve as additional registers. An unusual but useful feature is that an interrupt pushes four of these registers on the stack (A and X as well as the usual PC and CC), and interrupt return restores them. ALU instructions fall into two categories, two-operand and one-operand. Two-operand instructions use the accumulator as the first source. The addressing mode specifies the second source, which may be: * 8-bit immediate * 8-bit absolute address * 16-bit absolute address * Indexed (X) * Indexed plus 8-bit offset (address8,X) * Indexed plus 16-bit offset (address16,X) The destination is usually the accumulator, but a few instructions modify the second source. (Immediate operands are forbidden in such cases.) One-operand instructions use the specified operand for both source and destination. The operand may be: * The accumulator A * The X register * 8-bit absolute address * Indexed (X) * Indexed plus 8-bit offset (address8,X) Register plus offset computes a full-width sum, so the 8-bit form may address memory up to 255+255 = 510. In addition to the above, there are three prefix bytes which may be prepended to any instruction for which they make sense: * PDY (0x90) changes all references to the X register to Y. This allows (Y), (address8,Y) and (address16,Y) addressing modes. This affects implicit operands as well, so the "load X" instruction becomes "load Y". A consequence of this is that load X can only use the X-relative addressing modes, and load Y can only use the Y-relative ones. * PIX (0x92) adds an indirection step to the instruction. The 8- or 16-bit address following the opcode byte is replaced by an 8-bit address of a memory location which holds an 8- or 16-bit address (the latter in
big-endian In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most sig ...
order). This may then be indexed by the X register as usual. This allows (address8), (address16), ( ddress8X) and ( ddress8.wX) addressing modes. * PIY (0x91) combines the above effects. This allows the ( ddress8Y) and ( ddress8.wY) addressing modes. (It may also be used with other modes as part of the "load Y" and "store Y" instructions.)


References

{{DEFAULTSORT:ST6 ST7 Microcontrollers