EVB+

 

Home

Store

Products

Textbooks

Resources

Support

Download

Contact

 

 

 

 
 
 

 

Low cost
Dragonfly12-Plus 40-pin DIP module kit

MC9S12C32 @ $22
MC9S12C128 @ $32

 
 
 

 

The kits are designed to be used in ECE courses or students who already have some experiences in the HCS12 / 9S12 family.  If you would like to learn HCS12 / 9S12 programming by yourself, we recommend you purchase our Dragon12-Light instead.  

 

48-pin QFP, MC9S12C32 / MC9S12C128 MCU standard specifications:

  • Powerful instruction set
  • 32K/128K Bytes of flash memory
  • 2K Bytes of RAM
  • 31 I/O lines
  • One SCI serial port
  • One SPI port
  • Key wake-up interrupts
  • CAN 2.0 port
  • Analog Comparator
  • 8-Ch, 10-bit, ADCs
  • 8-Ch, 16-bit timers with Input Capture, Output Compare and PWM functions
  • Up to 25 MHz bus speed using internal PLL
  • Advanced security features for protecting program memory


Features:

  • 8 MHz crystal, 24 MHz bus speed

  • Installed with the Freescale MC9S12 serial monitor

  • 40-pin DIP module with robust 0.025" square pins which are more robust than fragile round machine pins

  • Standard 40-pin DIP module is snappable into a 32-pin DIP module

  • Each pin is labeled with its signal name and helpful for monitoring signals

  • 6-pin BDM Debug/Program input header

  • Includes the BKGD pin for an off-module BDM connection

  • Includes a slide switch for selecting RUN/LOAD mode

  • Includes a reset button

  • Power on LED indicator

  • One user LED indicator 

  • 2K x 8 I2C EEPROM

  • Combined with a RoadRunner stick for a USB based prototyping system

  • Optional CAN 2.0 interface available

  • Gold plated

  • Small size 2.05" x 0.68" for the module, 0.35" x 0.68" for the switch section

 

Assemble the module:

       
  1. Place two 20x1 male headers on a breadboard.   2. Place the Dragonfly12 module over the headers, then solder all 40 pins.   3. Once all 40 pins are soldered, then solder two switches.  

 

Getting Started:

The Dragonfly12-Plus DIP module is pre-installed with the Freescale Serial Monitor and a test program in the flash memory addresses $C000-$FFFF. The Serial Monitor is located in the highest 2K addresses ($F800-$FFFF).  The test program is located at $E000-$F7FF. The reset and interrupt vectors in the user program are located in normal addresses at $FF8A-FFFF, but the monitor automatically relocated them to $F78A-F7FF during file downloading.

To test the Dragonfly12-Plus module with the RoadRunner module, follow the steps below:

Plug both modules onto a solderless breadboard.

Make 4 connections for the Dragonfly12-Plus module:

    Connect the pin 1 of the Dragonfly12-Plus module to GND.
    Connect the pin 2 of the Dragonfly12-Plus module to VCC.
    Connect the pin 34 (PS0) of the Dragonfly12-Plus module to the TX output of the RoadRunner module.
    Connect the pin 35 (PS1) of the Dragonfly12-Plus module to the RX input of the RoadRunner module.

Plug a USB cable to the USB connector on the RoadRunner module and the other end to a USB port of your PC. The power LEDs on both modules should be lit. Make sure that the 5V power LED on the RoadRunner module is ON and 3V power LED is off. 

Set the slide switch S1 on the Dragonfly12 module in the "LOW" position (DownLOAD mode) and press the reset button (S1) once, the LED indicator (PE4) on the Dragonfly12-Plus module should blink twice.  If it does not occur, the serial monitor is not pre-loaded.

Set the slide switch S2 on the Dragonfly12-Plus module in the "UP" position (RUN mode) and press the reset button (S1) once, the LED indicator (PE4) on the Dragonfly12-Plus module should blink 4 times. If the test program is pre-loaded then the LED will flash rapidly.

 

Diagnostic LED indicator:

The Dragonfly12-Plus module is pre-installed with serial monitor and a simple test program at factory. The state of the slide switch (S2) is tested by the serial monitor for selecting RUN or LOAD mode during power up or reset, and the PE4 LED will blink twice to indicate that the serial monitor is functioning.  If the slide switch is placed in "LOAD" mode the monitor will wait for a command from PC. If the slide switch is placed in "RUN" mode the LED will blink two more times to indicate that the program execution is diverted to the user code. When the user code ( the pre-loaded factory test program) is running the LED indicator will flash rapidly.

If the serial monitor is not installed or is erased by a BDM, the PE4 LED will not blink during power up or reset. This LED indicator allows us visually check if the module is installed with serial monitor before leaving the factory.

 

Software development:

The MC9S12C32 memory map in single chip mode is as follows:

$0000-$03FF            Registers

$3800-$3FFF            RAM, the highest 50 bytes of RAM are reserved for the Serial Monitor.

$4000-$7FFF           16K fixed Flash

$C000-$FFFF           16K fixed Flash, $F800-$FFFF is the Serial Monitor.


 

Three ways to develop code using the Dragonfly12-Plus module:

  • In the lowest cost configuration, the Draginfly12-Plus module is pre-installed with serial monitor and requires a RoadRunner or a RoadRunner-Jr. module to interface to the CodeWarrior IDE on a PC.
     

  • If you would like to use D-Bug12 monitor to debug your code, another approach is to use your TinyBDM, or MiniDragon or Dragon12-Plus as a BDM POD and debug the Dragonfly12 module via BDM connection, so you don't need to buy a RoadRunner module.

    In this setup, you can only use D-Bug12 monitor to debug your code and the D-Bug12 monitor is located in the BDM POD, all flash memory on the Dragonfly12-Plus module can be used for user programs.
     

  • The last and the best approach is to purchase our USBDM designed by PGO for $19.  It's a low cost high performance BDM.

If the serial monitor is used, the method of downloading your programs into this module is different than the normal way of downloading programs into RAM using Buffalo monitor or D-Bug12 monitor. This chip does not have a full-featured monitor that can execute ASCII commands given in the terminal window.  Instead, it has a small 2K serial monitor that can only execute binary encoded commands. You can only interact with it using a special program called CodeWarrior IDE.

The CodeWarrior IDE is an industrial grade program that lets you examine memory and registers, change memory and registers, erase flash, and download programs. The most valuable feature is that it supports breakpoints and source level debugging in assembly and C languages. The standard version of the CodeWarrior costs thousands of dollars, but the special edition of the CW is free. The limitation of the special edition is that your program code size cannot exceed 32K in flash memory which is still large enough for most educational applications.

For more information about CodeWarrior please visit:  http://www.evbplus.com/Code_Warrior_hcs12.html

 

How to make an S29 file used by a BDM pod? ( If you don't use a BDM pod, skip this section)

An S29 file is only used by a BDM pod to program flash memory. The most common mistake that a user makes while trying to program flash memory using a BDM pod is to FLOAD an s19 file into flash memory.

In order to program the MC9S12DG256 flash memory, you must program an even number of bytes and begin on an even address boundary for each s-record. If any one s-record in the file contains an odd number of bytes or begins with an odd address, the flash memory cannot be programmed. Let's use the test_DF12P.asm as a sample program and assume that the assembler successfully generated the test_DF12P.s19. Next, you must use the Freescale’s s-record conversion utility, sreccvt.exe, to make an s29 file from the test_DF12P.s19 by using the following command line:

Srccvt -m c0000 fffff  32 -of f0000 -o test_DF12P.s29 test_DF12P.s19
copy test_DF12P.s29 test_DF12P.s2

It will create a new s2 file named test_DF12P.s29 that has an even number of bytes and can be programmed into the flash memory by FLOAD command ( Use FLOAD command only, do not use FLOAD ;b command ). 

For your convenience, we made a batch file, MAKE_test_DF12P_s2.bat, that can be placed along with the srccvt.exe in your working directory.  After assembling your test_DF12P.asm without an error, you can double click the MAKE_test_DF12P_s2.bat and it will create test_DF12P.s29 and test_DF12P.s2 from test_Df12P.s19. You can use this batch file for your other application programs.  If your file name is not test_DF12P.asm, you can edit the MAKE_test_DF12P_s2.bat by substituting the filename 'test_DF12P' with your new file name.  For instance, if your new filename is demo.asm the DOS command in the MAKE_testDF12P_s2.bat will be:

Srccvt -m c0000 fffff  32 -of f0000 -o demo.s29 demo.s19.
copy demo.s29 demo.s2

To edit MAKE_test_DF12P_s2.bat, right click it and a small pull down menu will appear. Left click the edit option to modify the dos command. After modification is done you can save it with the new batch file name,  MAKE_demo_s2.bat

 

Schematic and sample programs:

The latest schematic for the Dragonfly12-Plus module

Sample code for bit banging the on-module EEPROM.  It was written for the 68HC11, but will work for the HCS12.

Sample code for testing the Dragonfly12-Plus module.

 

Pinouts:
 

1         GND
2         VCC
3         /RESET
4         PT0/IOC0
5         PT1/IOC1
6         PT2/IOC2
7         PT3/IOC3
8         PT4/IOC4
9         PT5/IOC5
10     PT6/IOC6
11     PT7/IOC7
12     PE1/IRQ
13     PE0/XIRQ
14     PE4/ECLK
15     PM0/TXCAN0/RXB
16     PM1/TXCAN0/TXB
17   BKGD
18   PE7
19   CAN -
20   CAN +
40   PP5/KWP5/PW5
39   PM2/RXCAN1/RXCAN0/MISO0
38   PM3/TXCAN1/TXCAN0/SS0
37   PM4/RXCAN2/RXCAN0/RXCAN4/MOSI
36   PM5/TXCAN2/TXCAN0/TXCAN4/SCK0
35   PS1/TXD
34   PS0/RXD
33   VRH
32   AN7/PAD07
31   AN6/PAD06
30   AN5/PAD05
29   AN4/PAD04
28   AN3/PAD03
27   AN2/PAD02
26   AN1/PAD01
25   AN0/PAD00
24   XT/ OSC. output
23   EXT/ OSC, input
22   PA0
21   PB4