Table of Contents

Background information

Embedded Systems

An embedded system, as opposed to a general purpose computer, is a special purpose system in which the computer is completely encapsulated by or dedicated to the device or system it controls. Unlike a general purpose computer, such as a personal computer, an embedded system performs one or a few predefined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. Embedded systems are often mass produced, benefiting from economies of scale.

Usually intermediate developers face the following issues while working on embedded platforms:

Freescale Semiconductor Inc.

Freescale Semiconductor, Inc. is an semiconductor manufacturer created by the divestiture of the Semiconductor Products Sector of Motorola in 2004. Freescale focuses on the automotive, embedded and communications markets for their semiconductor products. Freescale is among the Worldwide Top 50 Semiconductor Sales Leaders.

The 68HC12 (6812 or HC12 for short) is a 16 bit micro-controller family from Freescale Semiconductor. Originally introduced in 1994, the architecture is an enhancement of the previous Freescale 68HC11. Programs written for the HC11 are usually compatible with the HC12, which has a few extra instructions. The first 68HC12 derivatives had a maximum bus speed of 8 MHz and flash memory sizes up to 128 KBytes.

Like the 68HC11, the 68HC12 has two 8 bit accumulators A and B (sometimes referred to as a single 16 bit register D), also two 16bit registers X and Y, a 16 bit program counter, a 16bit stack pointer and an 8 bit Condition Code Register.

Motorola has launched the new HCS12 (also known as MC9S12) product line in 2000. The bus speed was improved up to 25MHz and flash sizes up to 512 KBytes. The MC9S12NE64 was introduced by Freescale in September 2004, claiming to be the “industry's first single-chip fast-Ethernet Flash microcontroller.” It features a 25 MHz HCS12 CPU, 64 KBytes of FLASH EEPROM, 8 KBytes of RAM, and an Ethernet 10/100 Mbit/s controller. Since the HCS12 was a direct upgrade to the existing HC12 family, most of the links and information provided here are suitable for both lines.

Latest addition in 2004 was the advanced HCS12X, providing even more features, including the XGATE DMA co-processor. HCS12X is fully backward-compatible with HCS12 CPU. The S12X family utilizes the latest process technology. It boasts higher speed (40 MHz), more functionality, reduced power consumption and cost, and enhanced performance with the new XGATE on-chip memory-management and DMA module. The XGATE peripheral co-processor allows for some tasks to be offloaded from the CPU also allows several new instructions to increase performance.

Freescale announced the MC9S12XEP100 in May 2006 to further extend the S12X family to 50MHz bus speed and add a Memory protection unit (based on segmentation) and a hardware scheme to provide Emulated EEPROM.

Freescale HC1x platform has been around from 1990s which makes it affordable, well tested and stable candidates for embedded projects. Documentations can be downloaded free of charge from Freescale Semiconductor's website. GNU tool chain has been ported and tested on HC1x MCUs1). BDM features of HC12 series provide ease of transfer, testing and debugging codes to MCUs. We have decided to use HCS12 hardware as the host system for μC/OS.

Dragon12 Evaluation Board

Dragon12 is the name of the evaluation board made by evbplus.com. The board is using 9S12 family of Freescale 16-bit microcontrollers. Revision D of the Dragon12 board is using MC9S912DP256B processor with the following capabilities:

Evaluation

Demonstrate your program to your T.A.

Procedure

In this lab we are going to make a simple C program to turn on the LEDs on the 7-segment display module of Dragon12 board. The 7-segment display is connected to PORTB of microprocessor. We will use Data Direction Register for Port B (DDRB) to mark all the Port B's pins to output. This can be done by calling DDRB = 0xff

setting1.jpg setting2.jpg

DDRB=0xff;
PORTB=0x5e; // sample value just to turn some of the LEDs on

code1.jpg

Reference Manuals

Please note all the drivers to run the subsystems of the Dragon12 board will be provided and you don't need to write any driver code. However, in case you want to look at the official manuals of MC9S12DG256B they can be found in the course directory or on-line at http://gcc-hcs12.com/documnets/Freescale/motorolaindex.html