Welcome to the training module on Freescale HSC08 microcontroller family. The intent of this training module is to provide an overview of the HCS08 microcontroller family. We will discuss the general role of the HCS08, peripherals and devices such as Flash, internal clock generator module, and the internal clock source module, security features and protection, and low voltage protection features.
The S08 fits into the highest level of the Freescale 8-bit family, which originated with the HC05 family. The S08 seamlessly bridges from the HC08 family into the S12 family and beyond. In addition, Freescale offers a full range of other products and tools that are compatible with the S08 family as well as the HC08 and S12 families.
The S08 is to complement microcontrollers that already exist and to expand features and performance into a higher range than where the HC08 was originally targeted. The S08 has technology to extend battery life, low power enhancements, and increased performance at low voltage. The S08 uses the third generation of 0.25μ Flash technology, which is one of the fastest programming, densest arrays available in the 8-bit MCU market. The S08 also introduces an innovative on-chip debugger. This system eliminates the traditional need for a separate hardware emulator, and it allows users to emulate the systems using the actual silicon you will use in the final applications. The S08 also has robust EMC performance. Several enhancements improve the chip’s performance in noisy environments; EMC susceptibility has been reduced and minimized. Furthermore, S08 is 100 percent backwards code compatible with HC08, but it also has some expanded instructions and some addressing modes to improve C code generation efficiency. In addition, S08 has integrated a wide variety of peripherals, including serial communication ports, timers and ADCs.
The HCS08 family offers several features that should drastically improve the low-power performance of user applications. One of the first things that it offers is a true 1.8V operation. 1.8V is significant because it is basically equal to two alkaline batteries. More features include the multiple power-saving modes. There are up to three Stop modes and a Wait mode built into all HCS08s to improve power consumption while the CPU is not required. The HCS08s offer an extremely low-power real-time interrupt (RTI) with several different interrupt and timeout options. The clock sources permit switching to different frequencies, which allows the application to run the CPU at a speed that is beneficial for power savings yet fast enough to do the calculations and computation required for the application. Flash reprogrammability down to 1.8V allows the application to use Flash as EEPROM.
The S08 CPU executes all HC08 instructions, as well as a background (BGND) instruction and additional addressing modes on the LDHX, STHX, and CPHX instructions to improve compiler efficiency. The maximum clock speed for the CPU is 40 MHz (typically generated from a crystal or internal clock generator). The CPU performs operations at this 40 MHz rate and the maximum bus rate is 20 MHz (half the CPU clock frequency). The core includes support for up to 32 interrupt or reset sources with separate vectors. The peripheral modules provide local interrupt enable circuitry and flag registers.
The programmer’s model for the HCS08 CPU shown here includes the same registers as the M68HC08. These registers are not located in the memory map of the microcontroller. They are built directly inside the CPU logic. These include one 8-bit accumulator (A), a 16-bit index register made up of separately accessible upper (H) and lower (X) 8-bit halves, a 16-bit stack pointer (SP), a 16-bit program counter (PC) and an 8-bit condition code register (CCR) which includes five processor status flags (V, H, N, Z, and C) and the global interrupt mask (I).
Here is the product numbering system for HCS08 family.
Here shows basic connections that are common to typical application systems. The details are provided for power, oscillator, reset, mode and background interface connections. The example system uses the MC9S08Gb60, which is a representative device in the HCS08 family. VDD and VSS are the primary power supply pins for the HCS08 MCU. This voltage source supplies power to all I/O buffer circuitry and to an internal voltage regulator. This internal voltage regulator provides regulated 2.5-volt (nominal) power to the CPU and other internal circuitry of the MCU. Typically, application systems have two separate capacitors across the power pins. HCS08 derivatives can be operated with no external crystal or oscillator. When this occurs, the MCU uses an internally generated self-clocked rate equivalent to about 8-MHz crystal rate. The oscillator in the MC9S08GB60 is a traditional Pierce oscillator that can accommodate a crystal or ceramic resonator in either of two frequency ranges selected by the RANGE bit in the ICGC1 register. The low range is 32 kHz to 100 kHz and the high range is 1 MHz to 16 MHz. Not all HCS08 derivatives have a reset pin. When there is no reset pin, you can cause a reset by cycling power to force power-on reset (POR), using a background command to write to the BDFR bit in the SBDFR register, or using software to force something like an illegal opcode reset. In the MC9S08GB60, the reset pin is a dedicated pin with a pullup device built in. The background/mode select (BKGD/MS) pin includes an internal pullup device, input hysteresis, a 2-mA output driver, and no output slew rate control. If nothing is connected to this pin, the MCU will enter normal operating mode at the rising edge of reset.
An on-chip voltage regulator is a key feature of MCUs in Freescale’s HCS08 Family. The primary function of this regulator is to produce an internal 2.5-volt logic power supply from the MCU’s VDD power supply. This regulator has standby, passthrough, and power-down modes, which are used to place an 9S08GB/GT into stop1, stop2, and stop3 modes. Run mode is the normal operating mode for the HCS08 family. In this mode, the CPU execute code from internal memory with execution beginning at the address $FFFE:$FFFF after reset. The active background mode functions are managed through the background debug controller (BDC) in the HCS08 core. The S08s have four standard, low-power modes: Stop 1, Stop 2, Stop 3, and Wait. Stop 1 is the lowest power mode and, in this mode, the internal circuitry is powered off completely and just a very basic level of leakage current is all that's consumed by the device. In Stop 2 and Stop 3, the amount of functionality that is available within these low-power modes starts improving. Wait mode allows most of the peripherals to run while just shutting off clocks to the CPU.
The five major memory spaces that are defined by the core are shown in the Table. You may need to refer to the data sheet for a particular derivative for exact information about the size and boundaries of each of these blocks. Direct-page registers include the I/O port registers and most peripheral control and status registers. The RAM memory block starts immediately after the end of the direct-page register block and extends to higher addresses. High-page registers are located at $1800 to $182B. These are registers that are used less often than the direct-page registers so they are not located in the more valuable direct address space. FLASH memory fills the 64-Kbyte memory map to $FFFF. The starting address of this block depends on how much FLASH memory is included in the MCU. The vector space is part of the FLASH memory at $FFC0–$FFFF but it is separately decoded so that other HCS08 modules can recognize when an interrupt vector is being fetched.
Here is the block diagram for the internal clock generation module. The ICG generates the clocks used by the CPU and chip peripherals. The ICG is composed of Frequency-locked loop or FLL for short and the clock selection circuitry. There are two clock references available, an external clock input and oscillator, and a very accurate internal reference generator. The ICG module has four modes of operation: Self-clock mode (SCM), FLL engaged, internal clock (FEI) mode, FLL bypassed, external clock (FBE) mode, and FLL engaged, external clock mode (FEE). SCM is a simple, internally clocked mode. It's the default mode out of reset, and it provides a very reliable start-up from a power-off situation, or for wakeup from some Stop modes. Although it provides a very reliable clock source, is not the most accurate option available. The FEI mode is more accurate than the SCM. The third mode is FBE. This mode simply takes an external clock source presented at the MCU pins and uses that clock source directly to generate the system clocks. The fourth mode, FEE, is very similar to the FEI mode except instead of using an internal reference for the FLL, it uses an external clock reference. SCM and FEI require no external components, which reduces your system's cost and increases its reliability by not having additional components on your board. All four modes are software selectable; the user program can switch between modes as necessary within the system. The ICG module also has a clock monitor that automatically switches modes if a clock is lost.
Here is the block diagram for the internal clock source module. The ICS is very similar to the ICG module used on some other HCS08s. Like the ICG, the ICS is composed of FLL and the clock selection circuitry. There are two clock references available, an external clock input and oscillator, and a very accurate internal reference generator. The ICS module has four modes of operation, three of which are basically the same as the ICG: FEI mode, a new FLL bypassed, internal clock (FBI) mode, FBE mode, and FEE mode. Of the four modes, two modes (FEI, and FBI) require no external components, thereby increasing the system’s reliability and freeing up board space for other use. The internal reference of the ICS is trimmable, with a typical resolution of 0.1 percent. All of these modes are software selectable. The software can select between any of the four modes at any time, again allowing for very flexible clock applications to switch between high frequency, low frequency, and internal or external as needed by the application. The oscillator portion of the ICS has the same low power or high gain oscillator options as the ICG's oscillator. Finally, like the ICG, the bus frequency is one-half of the ICSOUT frequency.
The serial communication interface (SCI) module provides a basic two-wire, asynchronous communications interface that can connect to a PC, other peripherals, or controllers in an application. The maximum baud rate is 1.25 Mbps, with a maximum bus frequency of 20 MHz for most of the S08 family. The SCI module has a flexible, independent 13-bit modulo-based baud rate generator, which allows a wide variety of baud rates to match the bus frequency to external communication standards accurately. Advanced data sampling at 16x over sampling, which provides very reliable communications. When communicating through a cable to another board several feet away, you will still see reliable communications. Both the receive and transmit are double buffered. Double buffering allows the SCI to queue up an extra byte for transmit. Upon reception, it also allows the flexibility to wait until reading the data. The SCI also has a hardware parity and receiver wakeup to align the SCI with standard communications protocols on the market.
Here are main features of the TPM module. They include various configurations for the multiple channels on each timer: input capture, output compare, or buffered edge-aligned PWM. The input capture trigger can be rising edge, falling-edge, or any-edge. The output compare function has set, clear, and toggle options. PWM outputs have selectable polarity. Each TPM can also be configured for buffered, center-aligned PWM (CPWM) for all channels on a timer. The TPM has several clock source options: bus clock, fixed system clock, or a clock connected to an external pin. The clock source to prescaler for each TPM is independently selectable. Finally, the TPM module has these key features: a 16-bit free running counter with an up/down counting option, a 16-bit modulus register to control counter range, the ability to enable the timer system, and one interrupt per channel plus a terminal count interrupt.
The S08 has several security and system protection features. For enhanced security, two NVM bits have been reserved in a special register. If the security is enabled, then an 8-byte security code is required to access and read the Flash contents. This feature prevents a hacker from trying to get into an MCU to read out the code or any sort of data contents that are within the Flash. If security is not broken, the only Flash function that can be executed is a mass erase. With regards to system protection features on S08 MCUs, a Computer Operating Properly (COP) watchdog is available, and it has a periodic timeout if the COP is not fed by writing to a specific register within the timeout period. The COP can operate off of the bus clock or an internal clock source independent of the bus clock. When using the internal clock source, the COP can time out if the bus clock is lost and the CPU is not operating properly at the time. Another protection feature is illegal address and illegal opcode detect/reset. If an unimplemented address or unimplemented opcode attempts to execute, the system will reset. The Flash also has a protection feature that prevents unintentional changes to Flash memory.
Two features provide low voltage protection. The low voltage detect (LVD) module can be configured as a reset, an interrupt, or a software flag. The nominal trip point is 1.8V; this is the default out of a power on reset (POR). LVD can also be reconfigured to trip at 2.1V as a second software selectable trip point. In addition, this module can be set to function in Stop mode for protection while in the low power state. The second low voltage protection feature is the low voltage warning (LVW). This additional warning that VDD is falling is set at a higher trip point than the LVD. This additional low voltage warning flag allows a system to detect when batteries are getting low but still have enough power to put the MCU into a ready state for replacing batteries.
Thank you for taking the time to view this presentation on HCS08 overview. If you would like to learn more or go on to purchase some of these devices, you may either click on the part list link, or simply call our sales hotline. For more technical information you may either visit the Freescale site – link shown – or if you would prefer to speak to someone live, please call our hotline number, or even use our ‘live chat’ online facility.
Introduction <ul><li>Purpose </li></ul><ul><ul><li>This training module is a general overview of the HCS08 microcontroller family, which is part of Freescale’s total microcontroller solutions. </li></ul></ul><ul><li>Outline </li></ul><ul><ul><li>Describe the HCS08’s role in the Freescale 8-bit MCU family. </li></ul></ul><ul><ul><li>Identify the features and advantages of the HCS08 CPU. </li></ul></ul><ul><ul><li>Identify the features and advantages of the peripheral modules and devices in the S08 </li></ul></ul><ul><ul><li>List the S08 security and protection features. </li></ul></ul><ul><ul><li>List the S08 low voltage protection features. </li></ul></ul><ul><li>Content </li></ul><ul><ul><li>18 pages </li></ul></ul><ul><li>Duration </li></ul><ul><ul><li>20 Minutes </li></ul></ul>
Key Features <ul><li>Evolutionary step in the popular HC08 family </li></ul><ul><li>Multiple power management modes </li></ul><ul><li>High-level performance without compromising low power </li></ul><ul><li>In-application reprogramming and data storage via third-generation 0.25µ flash technology </li></ul><ul><li>Innovative on-chip debugger </li></ul><ul><li>Robust EMC performance </li></ul><ul><li>100 percent object code compatible with HC08 </li></ul><ul><li>High integration including four serial communication ports, up to 8 timer/PWMs, and an 8-channel 10-bit analog-to-digital converter </li></ul>
Power Management <ul><li>1.8V operation </li></ul><ul><li>Multiple power-saving modes </li></ul><ul><li>Extremely low-power real-time interrupt (RTI) </li></ul><ul><li>Flexible multi frequency clock sources </li></ul><ul><ul><li>Highly accurate internal clock generator </li></ul></ul><ul><ul><li>Optional external clock signal with user-defined clock switching </li></ul></ul><ul><li>Flash reprogrammable down to 1.8V </li></ul><ul><ul><li>Able to use Flash as EEPROM </li></ul></ul>
HCS08 Core – S08 CPU <ul><li>High performance HCS08 CPU </li></ul><ul><li>Object code compatible with HC08s but also has added instructions and expanded addressing modes: </li></ul><ul><ul><li>10 to 15 percent increase in C code compiled efficiency </li></ul></ul><ul><ul><li>Single-byte Multiply and Divide instructions </li></ul></ul><ul><li>New addressing modes for the Load HX (LDHX) instruction: </li></ul><ul><ul><li>Extended Addressing mode (EXT) </li></ul></ul><ul><ul><li>Indexed – no offset (IX) </li></ul></ul><ul><ul><li>Indexed – 8-bit offest (IX1) </li></ul></ul><ul><ul><li>Indexed – 16-bit offset (IX2) </li></ul></ul><ul><ul><li>Stack Pointer relative (SP1) </li></ul></ul><ul><li>New addressing modes for Store HX (STHX) and Compare HX (CPHX) instructions: </li></ul><ul><ul><li>Extended Addressing mode (EXT) </li></ul></ul><ul><ul><li>Stack Pointer relative (SP1) </li></ul></ul><ul><li>New background (BGND) instruction </li></ul><ul><li>Instruction queue (or pipeline) </li></ul>
Part Numbering Schema MC 9 S08 GB 60 MC = Fully Qualified PC = Product Engineering Memory Type 9 – Flash 7 – OTP 3 – ROM Core Type S08 – HCS08 Product Family Approximate Memory
Basic Connections <ul><li>Note: </li></ul><ul><li>Not required if using the internal oscillator option. </li></ul><ul><li>These are the same pins as PTG1 and PTG2. </li></ul><ul><li>BKGD/MS is the same pin as PTG0. </li></ul>I/O and peripheral interface to application system
Modes of Operation <ul><li>Run mode for normal user operation </li></ul><ul><li>Active background mode for code development </li></ul><ul><li>Wait mode : </li></ul><ul><ul><li>CPU shuts down to conserve power </li></ul></ul><ul><ul><li>System clocks running </li></ul></ul><ul><ul><li>Full voltage regulation maintained </li></ul></ul><ul><li>Stop modes : </li></ul><ul><ul><li>System clocks stopped; voltage regulator in standby </li></ul></ul><ul><ul><li>Stop1 — Full power down of internal circuits for maximum power savings </li></ul></ul><ul><ul><li>Stop2 — Partial power down of internal circuits, RAM contents retained </li></ul></ul><ul><ul><li>Stop3 — All internal circuits powered for fast recovery </li></ul></ul><ul><ul><li>Separate periodic wakeup clock can stay running in stop2, stop3 </li></ul></ul><ul><ul><li>Oscillator can be left on to reduce crystal startup time in stop3 </li></ul></ul>
Memory Map Up to 32 x 2 bytes $FFC0 - $FFFF Vectors Up to 60Kbytes -$FFFF FLASH Memory System configuration $1800 - $182B High page registers Includes some direct page locations Beginning at $00xx RAM Up to 128 bytes $0000 - $00xx Direct-page registers Comment Address Name
Internal Clock Source (ICS) <ul><li>Two modes (FEI, and FBI) require no external components. </li></ul><ul><li>Internal reference of the ICS is trimmable . </li></ul><ul><li>All of these modes are software selectable. </li></ul><ul><li>There are low power or high gain oscillator options. </li></ul><ul><li>A software selectable bus divider (BDIV), is available in all ICS modes. </li></ul><ul><li>The bus frequency = ½ ICSOUT. </li></ul>
Serial Communication Interface (SCI) <ul><li>Maximum baud rate 1.25 Mbps </li></ul><ul><li>Flexible, independent 13-bit modulo-based baud rate generator </li></ul><ul><li>Advanced data sampling at 16x over sampling </li></ul><ul><li>Receive and transmit double buffered </li></ul><ul><li>Hardware parity and receiver wakeup </li></ul><ul><li>Optional 13-bit break available on some newer S08 MCUs </li></ul>
Timer/PWM (TPM) <ul><li>Multiple channels on timer </li></ul><ul><ul><li>Each channel may be input capture, output compare, or buffered edge-aligned PWM </li></ul></ul><ul><ul><li>Rising-edge, falling-edge, or any-edge input capture trigger </li></ul></ul><ul><ul><li>Set, clear, or toggle output compare option </li></ul></ul><ul><ul><li>Selectable polarity on PWM outputs </li></ul></ul><ul><li>Each TPM may be configured for buffered, center-aligned pulse-width modulation (CPWM) on all channels </li></ul><ul><li>Clock source options: bus clock, fixed system clock, or a clock connected to an external pin </li></ul><ul><li>16-bit free-running counter with an up/down counting option </li></ul><ul><li>16-bit modulus register to control counter range </li></ul><ul><li>Timer system enable </li></ul><ul><li>One interrupt per channel plus a terminal count interrupt </li></ul>
Security/Protection Features <ul><li>Enhanced Security: </li></ul><ul><li>Two NVM bits reserved in a special register </li></ul><ul><ul><li>If security enabled, 8-byte security code required to access and read the Flash contents </li></ul></ul><ul><li>System Protection: </li></ul><ul><li>Computer Operating Properly (COP) watchdog </li></ul><ul><li>Illegal address and illegal opcode detect/reset </li></ul><ul><li>Flash block protection </li></ul><ul><ul><li>Prevents unintentional changes to Flash memory </li></ul></ul><ul><ul><li>Block protection settings loaded at reset and cannot be modified by the user code </li></ul></ul><ul><ul><li>Entire array or just portions of it can be protected </li></ul></ul>
Low Voltage Protection <ul><li>Low Voltage Detection (LVD) </li></ul><ul><li>• Can be configured as a reset, an interrupt, or a software flag </li></ul><ul><li>• Nominal trip is 1.8V </li></ul><ul><li>• Can also be reconfigured to trip at 2.1V </li></ul><ul><li>• Can be set to function in Stop mode </li></ul><ul><li>Low Voltage Warning (LVW) </li></ul><ul><li>• Additional warning that VDD is falling </li></ul><ul><li>• Flag only, not an interrupt </li></ul><ul><li>• 2.1V or 2.4V nominal selectable </li></ul>
Additional Resource <ul><li>For ordering the HCS08 microcontrollers, please click the part list or </li></ul><ul><li>Call our sales hotline </li></ul><ul><li>For additional inquires contact our technical service hotline </li></ul><ul><li>For more product information go to </li></ul><ul><ul><li>http://www.freescale.com/webapp/sps/site/taxonomy.jsp?nodeId=01624684491437 </li></ul></ul>