1 / 20

Introduction To CodeWarrior - For MC9S12DP256

Introduction To CodeWarrior - For MC9S12DP256. Jilin Zhou Jan. 21, 2009. MC9S12DP256. General Description. 16-bit CPU, 16-bit data bus Memory 256K bytes flash EEPROM 12K bytes of RAM 4K bytes of EEPROM Functionalities 2 asynchronous SCI, 3 SPI

kenny
Download Presentation

Introduction To CodeWarrior - For MC9S12DP256

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. Introduction To CodeWarrior -For MC9S12DP256 Jilin Zhou Jan. 21, 2009

  2. MC9S12DP256

  3. General Description • 16-bit CPU, 16-bit data bus • Memory • 256K bytes flash EEPROM • 12K bytes of RAM • 4K bytes of EEPROM • Functionalities • 2 asynchronous SCI, 3 SPI • 8-channel IC/OC enhanced capture timer • 2 10-bit ADC • 8-channel PWM • and more ……

  4. D-Bug12 EVB Mode Memory Map

  5. Different Registers • Address ($0000 - $03FF) • Data registers • Control registers • Status registers

  6. RAM Interrupt Vector Table

  7. Power up • Two methods • Take a careful look of Pin diagram • H2 expansion: Pin 49 (ground) and Pin 50 (+5v) • External DC power 6 ~ 12 V • Do not power both • Bypass capacitor should be put as close to the MCU as possible because fast signal transitions place high, short-duration current demands on the power supply

  8. Administrative • email: jzhou@discover.uottawa.ca • Subject: ELG4911 • www.discover.uottawa.ca/~jzhou • www.discover.uottawa.ca/~qchen • Try to solve problems by yourselves. • Work as a team. • Clean up before you leave the lab.

  9. Metrowerks CodeWarrior • Important directories: • C:\Program Files\Metrowerks\CodeWarrior CW12_V2.0\ • Application Notes, CodeWarrior Manuals • C:\Program Files\Metrowerks\CodeWarrior CW12_V2.0\lib\HC12c\INCLUDE

  10. Create a project in CodeWarrior (1) • FileNew HC12 Stationary

  11. Create a project in CodeWarrior (2) • Select Legacy Sdi Target Interface  9S12Dp256

  12. Create a Project in CodeWarrior (3)

  13. Project Files • Go to the stored location of the project • You should see some directories: • bin • cmd • prm • sources • *.ini • …… • Your source codes should go to sources directory.

  14. Set Memory Parameters • Select Prm directory open ram.prm

  15. Communication with MCU • Open MiniIDE

  16. Communication with MCU • Terminal  options • COM1 or COM2 • No flow control

  17. Communication with MCU • Power the mcu  reset it

  18. Load the program • Terminal show terminal window • Reset the microcontroller • You should see the prompt Dbug-12 command window • Type Help to see all the commands • Type load go to Terminal Download Files  choose the .s19 file • Run the program (be careful with start address)

  19. Run the program • Find the start address of program in /bin/*.map

  20. .s19 header problem • The .s19 generated by Code Warrior cannot be downloaded to board directly since it has a long header that D-Bug12 cannot recognize. Check it. • Go to my website and download the converter • Put it in /bin and create a .bat file to do it • SRecChgHdr oldname.s19 newname.s19

More Related