Quindecimino 10-Aug-2012 10:49 AM
Edit FancyEdit New New Blog Upload All Recent Home Logout

Table Of Contents

TOP

1. 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.

TOP

2. 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.

TOP

3. 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
TOP

3.1. 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.

TOP

3.2. Screw Together Case

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

TOP

3.3. Jumper cable

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

TOP

3.3.1. Molex

TOP

3.3.2. D9 (RS232)

TOP

3.4. Mapping of device to Arduino:

TOP

3.4.1. D15

TOP

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

TOP

3.4.3. Misc

Various other hardware on the board

TOP

3.5. Steps for use/hacking

TOP

3.5.1. 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)

TOP

3.5.2. 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)

TOP

3.5.3. 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.

TOP

3.5.3.1. 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"

TOP

3.5.4. 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.