Quindecimino 10-Aug-2012 10:49 AM
Edit FancyEdit New New Blog Upload All Recent Home Logout
TOP
>1.
Table Of Contents
  • 1. @@TOC@@

    Overview

    This is just my notebook for everything I'm learning about the stepper motor controllers that I snagged from the recycle pile at work.

    The device was meant to receive serial commands to move a stepper motor for a camera iris. Essentially, it's just an Atmel Atmega 168-20 with a few transistors to switch power to the four stepper motor lines. It has on one end a D15 connector which in service is meant to supply power and serial to the device. The other side has a 5 pin molex header which would connect to the stepper motor. The D15 also has some pins that are not connected in general use that are for programming the device.

    Pic Gallery

    I have a gallery of pictures which i will eventually inline in here, but for now, head over here to check them out.

    Types of devices

    There are 2 types of enclosures I've found so far.

    1. D15 with a 5 pin header on the back, mounted in a screw-together shielded case
    2. D15 with a 5 pin header on the back, mounted in a metal-wrapped case

    Metal Wrapped Case

    This one is the same as the Screw Together version internally, although the entire inside has been potted/coated in epoxy. This means that all of the data lines are not able to be hijacked internally. This leaves just the IO lines exposed on the D15 and the motor driver switched pins as available IO lines. This is less flexible than the screw-together version, but if your project only needs 5 IO + Serial + LED then you're set.

    Screw Together Case

    This one is most easily hacked, since you can get at the parts inside. Additional IO lines you can use include:

    • Test point (1 bit)
    • LED (1 bit)
    • Motor lines (4 bits) (requires removing the transistors)

    Jumper cable

    This cable was used to connect the device in-service. It consists of two connectors:

    Molex

    • (Triangle end) Red wire - +5V
    • Not connected or shield - Ground
    • Black wire - Ground

    D9 (RS232)

    • D9.2 TX
    • D9.3 RX
    • D9.7 Ground

    Mapping of device to Arduino:

    D15

    • D15 Pin (ATMEGA Function) -- Arduino pin (Arduino function)
    • TOP:
    • D15.1 (TX) -- J1.2 (D1)
    • D15.2 (RX) -- J1.1 (D0)
    • D15.3 (ADC2) -- J2.3 (A1)
    • D15.4 (RESET) --
    • D15.5 (PB5/SCK) -- J3.6 (D13) (Also Programming)
    • D15.6 (PB4/MISO) -- J3.5 (D12) (Also Programming)
    • D15.7 (PB3/MOSI) -- J3.4 (D11) (Also Programming)
    • D15.8 (PB2/SS) -- J3.3 (D10) (Also Programming)
    • BOTTOM:
    • D15.9 (PD3) -- J1.4 (D3)
    • D15.10 (Ground)
    • D15.11 (Ground)
    • D15.12 (Ground)
    • D15.13 (+5v)
    • D15.14 (+5v)
    • D15.15 (+5v)

    Molex (looking at it edge on, lock on the bottom)

    • H.1 - Motor0 (PD7) -- J1.8 (D7)
    • H.2 - Motor1 (PD4) -- J1.5 (D4)
    • H.3 - +5v
    • H.4 - Motor2 (PD6) -- J1.7 (D6)
    • H.5 - Motor3 (PD5) -- J1.6 (D5)

    Misc

    Various other hardware on the board

    • LED -- J3.1 (D8)

    Steps for use/hacking

    1. Programmer A Rig (bootstrap)

    Version 1 of the programmer will use an Arduino connected to a D15 via this mechanism to get one D15 up and running. Once that is working, we will test the arduino bootloader on the D15 (DONE)

    2. D15 Duino Interface Rig

    D15 Male to FTDI header adapter. This can be used for general use/downloading of code through the arduino interface. Future versions of this might have a fixed USB connector. (DONE)

    3. D15 Duino Testing

    Testing will be done to make sure that all ports are properly mapped, timers are operating at expected speeds. A basic firmware will be uploaded to an existing Arduino to see expected behaviors. Next, it will be put onto one of the target boards. It should cycle through all expected data lines and flash the LED. The 15 seems to have a 7.37MHz resonator on it, rather than the standard 16Mhz crystal, so, some hacking may be necessary.

    New 7.37 mhz firmware!

    Thanks to Tom Carpenter over on the Arduino forums, here's what you need to program this thing:

    Into "Boards.txt" file:

    ##############################################################
    atmega168f737.name=ATmega168 at 7372800Hz
    
    atmega168f737.upload.protocol=arduino
    atmega168f737.upload.maximum_size=14336
    atmega168f737.upload.speed=57600
    
    atmega168f737.bootloader.low_fuses=0xfd
    atmega168f737.bootloader.high_fuses=0xdd
    atmega168f737.bootloader.extended_fuses=0x04
    atmega168f737.bootloader.path=optiboot
    atmega168f737.bootloader.file=optiboot_atmega168_737.hex
    atmega168f737.bootloader.unlock_bits=0x3F
    atmega168f737.bootloader.lock_bits=0x0F
    
    atmega168f737.build.mcu=atmega168
    atmega168f737.build.f_cpu=7372800L
    atmega168f737.build.core=arduino
    atmega168f737.build.variant=standard
    
    ##############################################################
    

    And this file, optibootatmetga168737.zip gets unzipped and dropped into "bootloaders/optiboot"

    4. Programmer B Rig (Final)

    A D15 will be put into place as the final version of the programmer rig, replacing the arduino in it. It will be broken out to an FTDI header.<

Overview

This is just my notebook for everything I'm learning about the stepper motor controllers that I snagged from the recycle pile at work.

The device was meant to receive serial commands to move a stepper motor for a camera iris. Essentially, it's just an Atmel Atmega 168-20 with a few transistors to switch power to the four stepper motor lines. It has on one end a D15 connector which in service is meant to supply power and serial to the device. The other side has a 5 pin molex header which would connect to the stepper motor. The D15 also has some pins that are not connected in general use that are for programming the device.

Pic Gallery

I have a gallery of pictures which i will eventually inline in here, but for now, head over here to check them out.

Types of devices

There are 2 types of enclosures I've found so far.

  1. D15 with a 5 pin header on the back, mounted in a screw-together shielded case
  2. D15 with a 5 pin header on the back, mounted in a metal-wrapped case

Metal Wrapped Case

This one is the same as the Screw Together version internally, although the entire inside has been potted/coated in epoxy. This means that all of the data lines are not able to be hijacked internally. This leaves just the IO lines exposed on the D15 and the motor driver switched pins as available IO lines. This is less flexible than the screw-together version, but if your project only needs 5 IO + Serial + LED then you're set.

Screw Together Case

This one is most easily hacked, since you can get at the parts inside. Additional IO lines you can use include:

Jumper cable

This cable was used to connect the device in-service. It consists of two connectors:

Molex

D9 (RS232)

Mapping of device to Arduino:

D15

Molex (looking at it edge on, lock on the bottom)

Misc

Various other hardware on the board

Steps for use/hacking

1. Programmer A Rig (bootstrap)

Version 1 of the programmer will use an Arduino connected to a D15 via this mechanism to get one D15 up and running. Once that is working, we will test the arduino bootloader on the D15 (DONE)

2. D15 Duino Interface Rig

D15 Male to FTDI header adapter. This can be used for general use/downloading of code through the arduino interface. Future versions of this might have a fixed USB connector. (DONE)

3. D15 Duino Testing

Testing will be done to make sure that all ports are properly mapped, timers are operating at expected speeds. A basic firmware will be uploaded to an existing Arduino to see expected behaviors. Next, it will be put onto one of the target boards. It should cycle through all expected data lines and flash the LED. The 15 seems to have a 7.37MHz resonator on it, rather than the standard 16Mhz crystal, so, some hacking may be necessary.

New 7.37 mhz firmware!

Thanks to Tom Carpenter over on the Arduino forums, here's what you need to program this thing:

Into "Boards.txt" file:

##############################################################
atmega168f737.name=ATmega168 at 7372800Hz

atmega168f737.upload.protocol=arduino
atmega168f737.upload.maximum_size=14336
atmega168f737.upload.speed=57600

atmega168f737.bootloader.low_fuses=0xfd
atmega168f737.bootloader.high_fuses=0xdd
atmega168f737.bootloader.extended_fuses=0x04
atmega168f737.bootloader.path=optiboot
atmega168f737.bootloader.file=optiboot_atmega168_737.hex
atmega168f737.bootloader.unlock_bits=0x3F
atmega168f737.bootloader.lock_bits=0x0F

atmega168f737.build.mcu=atmega168
atmega168f737.build.f_cpu=7372800L
atmega168f737.build.core=arduino
atmega168f737.build.variant=standard

##############################################################

And this file, optibootatmetga168737.zip gets unzipped and dropped into "bootloaders/optiboot"

4. Programmer B Rig (Final)

A D15 will be put into place as the final version of the programmer rig, replacing the arduino in it. It will be broken out to an FTDI header.<>