ELEC3050 HCS12 Lab2

ELEC3050 HCS12 Lab2 - ELEC 3040/3050 Lab Manual Lab 2...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
ELEC 3040/3050 Lab Manual Lab 2 Revised 8/19/11 ~ 1 ~ LAB 2: Developing and Debugging C Programs in CodeWarrior for the HCS12 Microcontroller The objective of this laboratory session is to become more familiar with the process for creating, executing and debugging application programs, written in the C language, for the Freescale MC9S12C32 (HCS12) microcontroller, using the CodeWarrior Development Studio. You are to design a C program, containing a “main” program and two subroutines, to exercise various I/O ports and elements of the microcontroller. In the lab, you will exercise a number of the debug support elements of CodeWarrior, so that you will be better prepared for debugging larger projects later in the semester. For reference, Chapter 10 of the ELEC 2220 text ( Software and Hardware Engineering: Assembly and C Programming for the Freescale HCS12 Microcontroller, 2 nd Ed. by Frederick M. Cady), introduces program development for the HCS12 in C using CodeWarrior . Other C program examples are provided in Chapters 11-18. Interfacing To and Controlling HCS12 Input/Output (I/O) Pins The MC9S12C microcontroller family block diagram 1 is given in Figure 1. The microcontroller includes the HCS12 CPU, 32K bytes of flash memory, 2K bytes of RAM, analog to digital converter (ATD), timer module (TIM), PWM module, asynchronous (SCI) and synchronous (SPI) serial communication interfaces, controller area network (CAN) interface, clock generator, system integration module (SIM), and a number of parallel I/O ports. Shown in Figure 1 are 60 programmable signal pins, plus power, ground, clock and test pins. The chip comes in 48-pin LQFP, 52 pin LQFP, and 80-pin QFP packages. In the 80-pin package, all signals shown in Figure 1 are bonded to pins on the package. On smaller packages, only a subset of these signals is bonded to pins. The DragonFly12-Plus application module used in this lab contains the 48-pin chip package, shown in Figure 2. Two 20-pin headers, arranged in DIP package format as shown in Figure 3, are used to insert the module into the project board. Therefore, the 40 pins shown in Figures 3 and 4 carry the signals available to users of the DragonFly-Plus modules. As discussed in ELEC 2220, most of the signal pins have multiple functions. The default in most cases is simple parallel I/O; special functions are selected by software. Table 1 lists the functions of the pins on the 48-pin package. 1 Freescale “MC9S12C Family Reference Manual
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ELEC 3040/3050 Lab Manual Lab 2 Revised 8/19/11 ~ 2 ~ Figure 1. MC9S12C-Family Block Diagram 2 2 Freescale “MC9S12C Family Reference Manual
Background image of page 2
ELEC 3040/3050 Lab Manual Lab 2 Revised 8/19/11 ~ 3 ~ Figure 2. Pin assignments on the 48-pin LQFP package 3 Figure 3. 40-pin connector J1 on the DragonFly12-Plus module 4 3 Freescale “MC9S12C Family Reference Manual 4 Application Module Student Learning Kit Users Guide featuring the Freescale HCS12 4 Application Module Student Learning Kit Users Guide featuring the Freescale HCS12
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

ELEC3050 HCS12 Lab2 - ELEC 3040/3050 Lab Manual Lab 2...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online