The necessary software, “Special Edition: CodeWarrior for Microcontrollers”, is already installed on the computers in this lab, so we won’t be installing it today. However, if you want to download and install the free IDE/Assembler/C compiler on your own PC, you should go to www.freescale.com and search for keywords “codewarrior for microcontrollers special edition download”, then look for the Download link. The installation process is quite easy, though it may take the better part of an hour.
Note: If you purchased a demonstration board, that package may include a CD or DVD with an earlier version of the IDE that does not include the C compiler. This should not be installed.
If you purchase a development board like the one used in this lab, you will also need to install the USB drivers to enable the PC to communicate with the board.
Demo board hardware is described in the demonstration board user’s manual on various pages. Click the link and/or go to the manual, read the pages listed below, and answer these questions:
Referring to the user’s manual section 1.3, what devices are supported by the DEMO9RS08KA2 development board? ____________________________________________________
From PDF pages 9 & 10 (manual pages 7-8), briefly review the location of the various items on the demo board, comparing your actual board to the drawing and description. Note that the programming target microcontroller is a socketed DIP that may be removed after it is programmed. This is convenient for stand-alone applications. Also, realize that the majority of the board exists simply to support communication with the PC and demo I/O (LEDs, pushbuttons, and NTC resistor). As a side note, Zilog handles this in a different way that some designers prefer.
Section 8 in the manual outlines the various jumper and connector settings. Review it briefly at this time and locate the connectors on your demo board. If you are not familiar with this type of jumper, ask your lab instructor to demonstrate how it works.
Read through section 4.1, entitled “First Connection”, and go through the steps to verify the demo board jumper settings and connect the board to the PC USB port.
Emphasizing again, the microcontroller is one small chip on the development board. The rest of the board is fairly complex and exists to support USB communication with the host PC. Without getting too concerned with the abbreviations right now, consider this example of a simple, stand-alone microcontroller application:
Understanding the RS08 I/O
Look at Figure 2-2 in the RS08 data sheet. Most of the pins are multi-purpose, described by terms such as “PTA3/ACMPO/BKGD/MS”. Refer to Table 2-1 and fill in the blanks below with the functions associated with each of these terms:
PTA3 (Port A, bit 3): ___________________________________
The data sheet table describes each of the RS08 pins and not just the PTA3 pin. Refer to this as necessary throughout the lab if you are having problems understanding the pin names and functions.
While you’re on that page, right above Table 2-1 is a paragraph that says:
NOTE To avoid extra current drain from floating input pins, the reset initialization routine in the application program should either enable on-chip pullup/pulldown devices or change the direction of unused pins to outputs.
Two important points should be made here. First, typical of CMOS integrated circuits with their high input impedance MOSFETs, the RS08 will possibly oscillate and/or draw excess current if an input is left floating. Normally this is solved by tying any unused inputs high or low. However, and this is the second point, the RS08 contains internal pullup and pulldown resistors (approx. 50-60 kilohms each) that may either be connected or disconnected, depending upon the configuration (initialization) settings, which will be examined in more detail shortly. Any pins configured as inputs should have their internal pullup or pulldown resistors connected unless the external circuitry makes provision for pullup/pulldown. Remember that when you make configuration settings in the software. Section 2.4 in the data sheet provides a detailed explanation of each of the pins on the chip. Glance through it now.
Statements such as the following may be ignored unless you plan to handle device initialization yourself through program code: “To use as an output-only port, BKGDPE in SOPT must be cleared.” This refers to initializing the device, or telling it which pins are inputs, outputs, etc., which is not normally a concern since device initialization is handled through a very nice GUI (Graphical User Interface) in the IDE. That tool enables RS08 programmers to easily generate device initialization code, which runs once when the microcontroller begins program execution.
Refer to the schematic for the demo board, which is in a separate document, and draw lines in the following table connecting each microcontroller pin listed in the left column to its corresponding development board component on the right. The first one has been done for you.
The bold items in the list above are the settings required for connection to the devices listed on the right. These settings would be made using the Device Initialization tool.