Interlock is a non-profit organization that provides space for its members and the local community to develop and share their interests in science, technology, art, and culture.

Hacking a controller back into an Arduino Mega 1280

At Interlock, JustBill handed me the old controller board for a gutted 3D printer that he was rebuilding. “Do whatever you want with this.” A close inspection of the board showed that it had a main microcontroller of the ATmega 1280, which is the chip used in older Arduino Megas.  The interface to USB however was an ATmega 8u2, which is the chip used in newer Arduino Megas, and you may also know it from older Arduino Unos… modern Uno R3s use a 32u4.

This board had custom firmware on it so that it didn’t look like an Arduino, or any sort of serial connection to the host computer it’s plugged into… so as-is, it was useless for general use as an Arduino; taking advantage of the GUI and clicky-clicky programmer interface.

So my thought was, it might be nice to have my own ‘Mega for testing and such.  Could this board be set up in a way that might make this process and outcome easy?  Turns out it mostly was.

The original board got its power from a power terminls on the board, 24V.  It needed to power the stepper motors, and such so it needed to be beefy.  This was dropped down to 5 and 3.3 on the board itself.

There is a USB B jack for connecting this to a host computer, which did not have its 5V connected, so my thought was, what if i hooked up this 5V to the USB jack.  would that be enough to power the chips?

I added this jumper, which connects the +5 on the USB jack to the 5v bus on the board, and plugged it in, and sure enough, it beeped and came to life without its host power supply.

Next up would be reprogramming the micros to have the arduino bootloader and code on them.

I hooked up my fairly cheesy Arduino D-15 (hacked stepper motor controller) ISP to the 6 pin header, which thankfully was already populated and labelled on the board!  I plugged it into the port labelled “1280 ISP”, selected the Arduino Mega, with 1280 micro from the Arduino 1.6.6 menus, selected Arduino ISP for the programmer, then selected “load bootlader”.  In about a minute, it seemed to have completed successfully…. if something didn’t jive, it would have spewed out sync or device errors to the screen…  Seemed good so far!

Next, was hooking it up to the jack labelled 8u2 ISP.  This was a little trickier because I wasn’t installing the bootloader (which the Arduino IDE makes REALLY easy to do), but rather the secondary micro’s firmware, which basically was just a USB-Serial interface driver.

Long story short, I grabbed the 8u2 code from github, “MEGA-dfu_and_usbserial_combined.hex”, and used the following command line (using a mixture of the code on that page, with the parameters that my system used via the arduino IDE on my Mac:

  ./avrdude -p at90usb82 -F -cstk500v1 -P/dev/cu.usbserial-A800czia -b19200 -U flash:w:8u2.hex  -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m -C/Users/me/Library/Arduino15/packages/arduino/tools/avrdude/6.0.1-arduino5/etc/avrdude.conf

In short, it sets the CPU to at90usb82, uses the stk500v1 communications protocol over the /dev/cu.usbserial driver, at 19200 baud…. it programs the file 8u2.hex, sets fuses and sets other avrdude configuration stuff.

After lots of text scrolling by from running that, I was able to drop a program I was working on, onto it via the Arduino IDE directly, without any problems at all! I set the port to the serial Mega, set the board to “Arduino Mega”, cpu set at “Mega 1280”, clicked ‘upload’ and bam, fully functional serial communications from the serial montior down through to the ‘1280 on the board.

Whoo! Free Arduino Mega for me!

Edit: Here’s the pinouts of stuff I beeped out. The number is the digital (or Analog where applicable) pin on an Arduino Mega board.  So digital 24 from Arduino corrolates to the “A Dir” pad on the board.

  •  * 4 – Piezo +
  •  * 6 – heat
  •  * 7 – fan
  •  * 24 – A Dir
  •  * 25 – A Step
  •  * 26 – A Enable
  •  * 27 – A Pot
  •  * 28 – B Dir
  •  * 29 – B Step
  •  * 36 – debug 2
  •  * 37 – debug 3
  •  * 38 – (nc)
  •  * 39 – B Enable
  •  * 40 – debug 4
  •  * 41 – PG0
  •  * 42 – TP33 / Z-MAX
  •  * 43 – TP32 / Z-MIN
  •  * 44 – Extra +/R85
  •  * 45 – bp heat
  •  * 46 – TP31 / Y-MAX
  •  * 47 – TP30 / Y-MIN
  •  * 48 – TP29 / X-MAX
  •  * 49 – TP28 / X-Min
  •  * A0 – X Dir
  •  * A1 – X Step
  •  * A2 – X Enable
  •  * A3 – X Pot
  •  * A4 – Y Dir
  •  * A5 – Y Step
  •  * A6 – Y Enable
  •  * A7 – Y Pot
  •  * A8  – Z Dir
  •  * A9  – Z Step
  •  * A10 – Z Enable
  •  * A11 – Z Pot
  •  * A12 – PK4 / JP7
  •  * A13 – PK5 / JP7
  •  * A14 – PK6 / JP6
  •  * A15 – TP27 / HBP Therm

The molex switch connectors seem to have the pinout: (signal) (ground) (ground) (+5v)

from on February 22nd, 2016Comments0 Comments

The Shelves Of Potential Awesome!

THE SHELVES OF POTENTIAL AWESOME!

Hi all! I’d like to formally announce something that we’ve (kinda) been working on for a little while now.

THE INTERLOCK SHELVES OF POTENTIAL AWESOME!

It is a library of sorts…  The idea is this:  If you want to try out one of the dev kits that are there, you can sign them out for your own use.  Preferrably something that you will write a blog post for. 😉  but even if you just want to sit down with one and mess with it for a week or two, go for it!

Here’s a list of what’s currently available on the shelf:

http://tinyurl.com/ks6gdtu

In that list you will find an inventory ID that matches the ID on the tag attached to each package.  You will also find a contact person who may be able to help or at least point you in the right direction for what these things are, how to use them, etc.

For now, these items are borrow-only.  We are working on a way for these items to be purchasable in the future.  For example, if you start using one, and integrate it into your awesome project, we would like for there to be a way for you to purchase it from the space. If there’s something you want to borrow, contact Scott to check it out. We’ll eventually have some sort of fancy computer-assisted self-operated inventory system, but for now, we’ll go with this.

 

We are looking for more borrow-donations for the shelf! If you have more, please let us know!  I’d like to make more Arduino boards available, as well as modernish laptops and possibly retro computers for people to borrow and play with.

In the near future, I will be setting up a laptop or two with a guest account to be stored there for borrowing in case you want to work on something at the space but forgot your own kit at home.

 

There is also a CD case disguised as a “1997 MSDN Subscription” box.  This is currently filled with empty disc sleeves, but in the future, it will be populated with various install media for various old and new hardware.  I will be bringing in disc media for some obsolete systems to be put in there. I’d like for one of you Linux Master Craftspeople to burn a copy or two of the current preferred desktop/server/32/64/whatever discs to be stored in there.  We will catalog the contents as things get added.

-s

from on May 20th, 2015Comments2 Comments

Fixing A Tablet…

One of my co-workers gave me his Samsung Galaxy Tab 4 to fix.  Apparently, something went bad with the USB connector, and his kid was very persistent with trying to get the charging cable into it, and completely mangled the connector.  Then he tried to fix it too, which made things worse… including chewing up the outer frame.  He ordered a replacement USB connector and asked if I could fix it.  It sounded like a fun project so.. sure!

He had already popped the back off at some point, so I just popped it back off again.  The USB port had to be desoldered from the board.  Little did I know that it also was glued down.  That made it a bit difficult to remove from the board

2015-04-07 20.49.45

With a lot of extra solder, and some leverage with the tweezers, I did manage to get it off.  Some work with the vacuum pump desolderer, some desoldering braid, and cleanup with rubbing alcohol and the mainboard was ready for the replacement part.  (Sharpie for scale)

2015-04-07 21.25.38

Getting it lined up so that all of the pads matched up and that the connector’s opening would line up with the case was a little bit tricky.  I soldered this one on with too-large of a tip by doing the “flooding the pads” method. Then excess solder was removed with some braid.

 

2015-04-07 21.43.35

 

 

Before I fully reassembled it, I tried out the jack, and it worked! I filed down and smoothed out the edge to remove any broken frame bits, to fix the damage done the first time it was opened, and powered it on.

CCCTy4iWAAMfjrmThe best way to test it, and the best way to go a bit insane is to get a chorus of Talking Ginger and other talking animals going… They were repeating each other, degrading the sound more and more with each repetition… We were pretty punchy at the end of the evening…

 

from on April 8th, 2015Comments0 Comments