ESE 350 Lab 0 - Tutorial
4 pages
English

ESE 350 Lab 0 - Tutorial

-

Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres
4 pages
English
Le téléchargement nécessite un accès à la bibliothèque YouScribe
Tout savoir sur nos offres

Description

ESE 350 Microcontroller Laboratory Lab 0: Part A – HC12 Software Tutorial For this tutorial you will execute the traditional “Hello, World!” application on your microcontroller. Let’s get started! 1. To create a new file a. Launch CodeWarrior IDE b. File > New The HC(S)12 New project Wizard will appear c. Select the name and the location of the file you wish to create. d. Click OK After each of the following settings, click Next to progress to the next window. e. Select the MC9S12C128 microcontroller f. Since we are programming in C, ensure that the checkbox next to it is selected g. Select No to Processor Expert h. Select No for OSEKturbo operating system i. Select No to PC-lint j. Select ANSI startup code k. Select None for floating point format l. Select Small memory model m. Select P&E Multilink CyclonePro n. Click Finish 2. Utilizing your newly created project files Now the project window appears. Select P&E Multilink CyclonePro. This ensures serial transmission and reception via the computer. 3. Editing your source code To edit the source code click the + sign next to the sources folder to reveal the files. Double-click on the main.c file. This is where you can actually change the code downloaded to the board. To save your changes select File > Save. For this tutorial you will execute the traditional “Hello, World!” application with the code below. #include #include #include "stdio.h" #include ...

Informations

Publié par
Nombre de lectures 25
Langue English

Extrait

ESE 350 Microcontroller Laboratory Lab 0: Part AHC12 Software Tutorial For this tutorial you will execute the traditional “Hello, World!” application on your microcontroller. Let’s get started!1. Tocreate a new file a. LaunchCodeWarrior IDE b. File>NewThe HC(S)12 New project Wizard will appear c. Selectthe name and the location of the file you wish to create. d. ClickOKAfter each of the following settings, clickNextto progress to the next window. e. Selectthe MC9S12C128 microcontroller f. Sincewe are programming inC, ensure that the checkbox next to it is selected g. SelectNoto Processor Expert h. SelectNofor OSEKturbo operating system i. SelectNoto PClint j. SelectANSIstartup code k. SelectNonefor floating point format l. SelectSmallmemory model m. SelectP&E Multilink CyclonePron. ClickFinish2. Utilizingyour newly created project files Now the project window appears. Select P&E Multilink CyclonePro. This ensures serial transmission and reception via the computer. 3. Editingyour source code To edit the source code click the+sign next to the sources folder to reveal the files. Doubleclick on themain.cfile. This is where you can actually change the code downloaded to the board.To save your changes select File >Save. For this tutorial you will execute the traditional “Hello, World!” application with the code below. #include <hidef.h> #include <mc9s12c128.h> #include "stdio.h" #include "termio.h" void main(void) { TERMIO_Init(); printf("Hello, World!"); while (1);// never return from main() }
1/4
4. AddingLibrary Files Right click on the “Sources” folder and select “Add Files…”to C:\Program Files\Freescale\ NavigateCodeWarrior…\lib\hc12c\src. Selectthe termio.cAn “Add Files” window will open, click “Ok”.” file and click Open.Navigate to C:Right click on the “Libraries” folder and select “Add Files…”.\Program Files\Freescale\CodeWarrior…\lib\hc12c\the “include. SelectTERMIO.h” file and click Open.An “Add Files” window will open, click “Ok”.Do the same for the “STDIO.h” file.
5. DebuggingYour Program First ensure that power is connected to the project board. To start the debugger, select Project from the IDE menu bar and selectDebug. The prompt that comes up will inform you that the debugger will masserase and program the microcontroller with your newly created application. 6. Openingand Configuring Output Terminal In the Debug screen select the “Component” menu.Select “Open”. Scrolldown and find the terminal symbol, select it and click “Ok”.click anywhere in the terminal windo Rightw and select “Configure Connections…”. Select “Serial PortClick “” for the Default Configuration.Ok”.
2/4
7. RunningYour Program Restart the target by clicking on the reset target icon. Next, right click anywhere on the Source window and select Open Source File. Select the appropriate file and click OK. To run the application, in the Run menu, select Start/Continue. You can also click on the start/continue icon in the debugger taskbar, or press F5. To pause execution, in the Run menu, select Halt.You can also click on the halt icon in the debugger taskbar, or press F6. Do you see the “Hello World”?That’s it!
3/4
ESE 350 Microcontroller Laboratory Lab 0: Part BIntroduction to the RCA Detkin Lab Information about the Detkin Lab and the components available there can be found here: http://www.ese.upenn.edu/rca/geninfo.htmPart 1 Build the two circuits shown below on your protoboard. Use 1kresistors.
Measure the values of each resistor, voltage across each resistor, and current through each branch using themultimeter. Part 2 Connect thefunction generatorto theoscilloscopea square wave of 10kHz, 5 Vpp,. Output 25% duty cycle. Display the Vpp, duty cycle and frequency values on the oscilloscope. Save the image using Benchlink Scope (New Image). Notes: Resistors arecolorcoded.
The symbol for a lightemitting diode is The long leg of a diode is the positive end.
4/4
  • Univers Univers
  • Ebooks Ebooks
  • Livres audio Livres audio
  • Presse Presse
  • Podcasts Podcasts
  • BD BD
  • Documents Documents