Back to main page

9S12: Dragonfly12-Plus module (40-pin)

 

 

 

 

 

 

 

The original Dragonfly12 is SOLD OUT

 

The new Dragonfly12-Plus ($22)

 


Due to long term commitment from several OEMs we are able to manufacture our C32 modules at higher volume and lower cost, so we can pass our savings to our customers by reducing the price of our Dragonfly12-Plus modules. We also can extend the low student price to all OEMs and hobbyists.

The new Dragonfly12-Plus 9s12c32 and 9s12c128 modules are newly designed modules to team up with our RoadRunner or RoadRunner-Jr. module for making a low cost USB based HCS12 / 9S12 prototype development system without a BDM.  

This module is designed to be used in an ECE course taught by a professor or students who already have some good experiences in the HCS12 / 9S12 family.  If you would like to learn the HCS12 / 9S12 programming by yourself, we recommend you purchase the Dragon12 Plus instead.  

The new Dragonfly12-Plus 9s12c32 and 9s12c128 modules have kept the same circuitry and pinouts of our original Dragonfly12 modules but added the following features:
  1. It provides flat leads like the leads on a regular 40-pin DIP IC chip, so it can be inserted into a standard low cost 40-pin DIP socket just like a regular IC and also flat leads are more robust than the fragile round machine pins on our original Dragonfly12 modules.
     
    Note:  Our
    original Dragonfly12 module with fragile round machine pins is no longer manufactured. Our original Dragonfly12 module with square pins can be plugged into special female socket strips, but it cannot be inserted into a standard low cost 40-pin DIP IC socket.


  2. It adds a small switch section on the PCB that consists of a slide switch (S2, the RUN/LOAD mode switch), a reset button and a power-on LED indicator as a debugging aid when the module is used with a breadboard. This section can be snapped off if it's not needed. The EEPROM section also can be snapped off if it's not needed, so the module becomes a smaller 32-pin DIP module.
     
  3. It adds a small LED driven by PE4 of the 9s12 controller.
     
  4. The 8 MHz crystal is placed on the top layer. 

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 flat IC type leads which are more robust than fragile round machine pins

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

  • Fits into a low cost 40-pin or 32-pin DIP socket perfectly

  • 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

  • New switch section includes a slide switch for RUN/LOAD mode select and a reset button

  • New switch section is snappable off if it's not needed in user target system

  • Power on LED indicator

  • One LED indicator for power on self test 

  • 2K x 8 I2C EEPROM

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

  • Optional CAN 2.0 interface available

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

 

Getting started:

The Dragonfly12-Plus DIP module is pre-installed with the Freescale Serial Monitor and the Wytec test program in the flash memory addresses $C000-$FFFF. The Serial Monitor is located in the highest 2K addresses ($F800-$FFFF).  The Wytec 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 the USB cable to the USB connector on the RoadRunner module and the other end to the USB port on 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 Wytec 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 Code Warrior IDE or uBug12 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 approach is to purchase the Multilink, a USB based BDM, from P & E Microsystems. It will cost you $99, but it offers more features.

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 Code Warrior IDE or uBug12 running on your PC.

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 Code Warrior please visit:  http://www.evbplus.com/Code_Warrior_hcs12.html

uBug12 is made by Technological Arts in Canada.

 

How to make an S2 file?

The most common mistake that a user makes while trying to program flash memory is to FLOAD an s1 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 s2 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

 

Price:
 
 
Product Code Price(USD) Description
DF12-C32
DF12P-C32
 

DF12-C128
DF12P-C128
 

$18
$22
$

$28
$32
 

MC9S12C32 based 40 pin Dragonfly12 DIP module with gold plated square pins
MC9S12C32 based 40 pin Dragonfly12-plus DIP module with flat IC type leads


MC9S12C128 based 40 pin Dragonfly12 DIP module with gold plated square pins
MC9S12C128 based 40 pin Dragonfly12-plus DIP module with flat IC type leads
 

 

The Dragonfly12-plus module and a RoadRunner stick form a USB based minimal  prototype system

The Dragonfly12-plus prototype system
 with an I/O module

 

The original Dragonfly12 module 

   SOLD OUT

Features:

Note:  Our original Dragonfly12 module with fragile round machine pins is no longer manufactured.  
Our
original Dragonfly12 module with square pins
can be plugged into special female socket strips,
but it cannot be inserted into a standard low cost 40-DIP IC socket.