1 / 17

The miniDragon+ Board and CodeWarrior

The miniDragon+ Board and CodeWarrior. Lecture L2.1. 2 pushbutton switches. Serial cable. A/D Pot. Run/Load switch. Reset button. 7-segment display. Power plug. I/O headers. miniDragon+. Table 1.1 Parallel Ports in the MC9SDP256. Registers associated with parallel I/O ports.

zhen
Télécharger la présentation

The miniDragon+ Board and CodeWarrior

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The miniDragon+ Boardand CodeWarrior Lecture L2.1

  2. 2 pushbutton switches Serial cable A/D Pot Run/Load switch Reset button 7-segment display Power plug I/O headers miniDragon+

  3. Table 1.1 Parallel Ports in the MC9SDP256

  4. Registers associated with parallel I/O ports Port Data Register Port Data Direction Register DDx[7:0]: Data Direction for Port x 0 – Input 1 – Output

  5. Turning on an LED

  6. A 7-segment display contains seven light emitting diodes (LEDs)

  7. The miniDragon+ board has a common-cathode 7-segment display. This means that all the cathodes are tied together and connected to ground. The output pins 6:0 of Port H are connected through a 1 kW current-limiting resistor to each of the anodes, g – a. In the common-cathode case, an output 1 will turn on a segment and an output 0 will turn it off. Port H: bit 6 5 4 3 2 1 0 g f e d c b a

  8. Programming in Cusing CodeWarrior

  9. LBE_DP256 is a stationery project that we have created that contains the file main.asm which includes over 80 assembly language routines to perform many I/O functions for the MC9S12DP256 microcontroller on the miniDragon+ board.

  10. Example 1a is the default main.c program for a LBE_DP256 project.

  11. Example 1a // Example 1a: Turn on every other segment on 7-seg display #include <hidef.h> /* common defines and macros */ #include <mc9s12dp256.h> /* derivative information */ #include "main_asm.h" /* interface to the assembly module */ #pragma LINK_INFO DERIVATIVE "mc9s12dp256b" void main(void) { PLL_init(); // set system clock frequency to 24 MHz DDRH = 0xff; // Port H is output PTH = 0x55; // switch on every other segment for(;;) {} /* wait forever */ }

  12. Lab 1 Go through the CodeWarrior tutorial in Appendix A. In this tutorial you will compile and run the C programs for Examples 1 – 4.

More Related