User Tools

Site Tools


lab1

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lab1 [2010/02/23 22:03] natalialab1 [2010/02/24 17:14] (current) natalia
Line 1: Line 1:
-==== Lab Objectives ==== 
-The purpose of this lab is to familiarize you with the development process of applications using //CodeWarrior IDE// for the //MC9S12DP256B// microcontroller. 
- 
 ==== Background information ==== ==== Background information ====
 === Embedded Systems === === Embedded Systems ===
Line 34: Line 31:
 provide Emulated EEPROM.  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 MCUs [1]. 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.+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 MCUs((http://gcc-hcs12.com)). 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: 
 +  * CAN controller 
 +  * 16X2 LCD display module with LED backlight 
 +  * it can be replaced by any size of LCD display module via a 16 pin cable assembly 
 +  * 4-digit, 7-segment display module 
 +  * Can be used to learn multiplexing techniques 
 +  * 4 X 4 keypad 
 +  * Eight LEDs connected to port B 
 +  * An 8-position DIP switch connected to port H 
 +  * Four pushbutton switches 
 +  * IR transceiver with built-in 38KHz oscillator 
 +  * RS485 communication port 
 +  * speaker driven by timer, or PWM, or DAC for alarm, voice and music applications 
 +  * Potentiometer trimmer pot for analog input 
 +  * Dual SCIs with DB9 connectors 
 +  * Dual 10-bit DAC for testing SPI interface and generating analog waveforms 
 +  * I2C expansion port for interfacing external I2C devices 
 +  * Fast SPI expansion port for interfacing external SPI devices 
 +  * Abort switch for stopping program when program is hung in a dead loop 
 +  * MC9S12DP256 MCU includes the following on-chip peripherals: 
 +    * 3 SPIs 
 +    * 2 SCIs 
 +    * 2 CANs 
 +    * I2C interface 
 +    * 8 16-bit timers 
 +    * 8 8-bit PWMs or 4 16-bit PWMs 
 +    * 16-channel 10-bit A/D converter 
 +  * Bus speed up to 25 MHz 
 +  * The 112-Pins on-board MCU (MC9S12DP256B) with 89 I/O-Pins is included 
 +  * BDM-in connector to be connected with a BDM from multiple vendors for debugging. 
 +  * BDM-out connector for making this board as a HCS12 / 9S12 BDM or programmer. 
 +  * PC board size 8.4" X 5.3" 
 + 
 +==== 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 
 + 
 +  * Launch the Freescale CodeWarrior IDE. The shortcut may look like: {{:icon.jpg}} 
 +  * Start a new project and use the following settings: 
 +{{ :setting1.jpg }} 
 +{{ :setting2.jpg }} 
 +  * We will use Data Direction Register for Port B (DDRB) to mark all the Port B's pins to output which can be done by calling DDRB = 0xff. On the main.c file add the following: 
 +<code> 
 +DDRB=0xff; 
 +PORTB=0x5e; // sample value just to turn some of the LEDs on 
 +</code> 
 +{{ :code1.jpg }} 
 +  * To compile the project use: {{:icon2.jpg}} 
 +  * To upload the compiled program to the board use: {{:icon3.jpg}} 
 +    * Make sure the board is powered up and connected to serial port on the PC (COM1). Please use only the top-left serial port as shown in the picture below. {{ :board1.jpg }} 
 +    * If it is the first time you are running the the program you may need to setup the PC's serial port: {{ :setting3.jpg }} 
 + 
 +  * Please demonstrate the program to your TA and make sure to understand how use the simulation and debugging tools as shown in the above picture. 
 + 
 +==== 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
lab1.1266962608.txt.gz · Last modified: 2010/02/23 22:03 by natalia

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki