Showing posts with label standalone. Show all posts
Showing posts with label standalone. Show all posts

Tuesday, February 28, 2012

Wireless Reprogrammable PS2 Controller (Part III)

(or how I came to ditch veroboard)

img1s

Okay…

So, in the last post, I was about to build a vero-board model of the WRPC, having successfully demonstrated proof of concept on breadboard.

The reasons I chose veroboard for the next phase was that:

  1. There are a lot of pins on microcontrollers and my drill press isn’t compatible with the 0.8mm bit.
    (read that as: I don’t wanna hand-drill a billion holes)

  2. Less effort than a custom PCB

Point B became more than arguable over the course of development, as you’ll soon read about. For those of you either not on Google+ or just not reading what I post (fine, then!), here’s how the progress reports went:

Drama - Act 1, Scene 1

One fine day on Google+…
Later…
Finally…

Why did it fail?

The veroboard approach failed because either:

  1. I somehow made the tiniest little melt or jumper or something but because of how immensely complicated the back of the board became (because I wanted it to look nice), diagnosing it became impossible (but I still tried).

    OR

  2. Nothing was wrong with the veroboard, even though diagnosis was impossible. There was a mistake in the breadboard to veroboard conversion.

img2s

As it turns out…

When I finally caved and rebuilt the breadboard circuit with new parts (I will desolder and harvest the veroboard later), it did have an error. It didn’t make much sense to me at the time (and at time of writing, I’m just accepting it for now) but somehow connecting the second ground pin on the Atmega when pin 8 was already grounded caused an issue with reprogramming the board with the Wixel. If you’re interested, compare the schematic from the original post with the one below.

img3s

What I learned (VERO == UGLY)

Only use veroboard for circuits that will be out of sight or those that you don’t care how they look. If you try to get clever and reverse-wire a vero, it will only come back and bite you in the arse.

img5s

Onwards and Upwards

Once I threw out the vero idea, rebuilt the breadboard (and spent hours tracing down the source of the error), I was ready to arrange the PCB. After a few hours of rework, here’s the completed design courtesy of Fritzing:

img6s

Smaller than the vero model and much sexier.

I have included a full set of breakout header traces for both microprocessors and space for two stabilizing capacitors on the regulator, should I desire to add them.

Press-n-Peel

img7s

Now, the main reason I wanted to avoid a custom PCB for a prototype in the first place was because of all the dicking around with transferring a design to the board itself.

To that end (and because UV boards are bloody expensive), I bought some Press-n-Peel film from techniks.com. I have tried several different ways of PCB transfer, but I will have to say that provided you’re willing to do a bit of trial and error (like any method) with your printer settings, iron heat and method, Press-n-Peel film will give you the best PCB-making experience for your buck.

It took me 5 attempts to work out the correct combination of printer setting, iron heat and method but after those five attempts, I had this:

img8s

You’ll notice some minor touch ups because for this one (funnily enough) I used an imperfect piece of film. Murphy can eat my shorts as usual. Anyhow, it was only a short, soft scrub from that to this (custom type/art was added post-Fritzing in Inkscape, but more on that later):

img9s

And after all the etching and glazing…

img10s

…and all the drilling work (which I’m not that good at by hand) I realised…

img11s

…that I’d printed the bloody thing out BACKWARDS.

img12s

Well! Isn’t this just a full-on bag of …. F…un ….

Nevermind.

While it did massively increase the complexity of the soldering job (I soldered the microcontrollers on the reverse side) and changed the overall look of the finished board, I still managed to pull it off without losing it (somehow). I even held it together when my soldering iron died in the middle of it (I fixed it again).

The final (hardware) product

After this very very long and dramatic journey, with more twists and turns than I could even be bothered writing about (yes, there were more), here it is - the finished hardware:

img13s img14s img15s img16s img17s

Afterthoughts

I have written myself a reminder to do this, so I’ll get to it when I can spare another moment… I am going to post the settings that worked best for me with the Press-n-Peel film because I didn’t find that many articles that were very helpful about it online.

Until then…

Sunday, February 19, 2012

Wireless Reprogrammable PS2 Controller (Part II)

Standalone Migration

I’ve spent several hours over the weekend arranging the schematic and new Vero board version of the PS2 Controller project, as well as freeing it from the Arduino tether. The controller now functions completely standalone exactly as it did when hooked up to the Arduino.

There are many benefits of migrating to a standalone from an Arduino-based project.

Some of these are:

  1. Reduced project cost (chips and resonators are WAAAY cheaper than an entire Arduino board)
  2. Freeing up your Arduino for another project
  3. Reduced physical footprint

img1t

Vero and Schematic Diagrams

In the first post I promised that I would publish the schematic once I was happy with it and I’m making good on that. This is version 1.0 of the Wireless Reprogrammable PS2 controller in both Vero and Schematic forms.

img2t img3t

Next Steps

From here, I will be making the Vero version, assembling the controller as one unit and designing and implementing ABE’s menu system, so there are more posts to look forward to yet. :)

Wednesday, February 8, 2012

The Burn & Go

(From brainspace to prototype in a couple of hours…)

Burn & Go Burn & Go meets Arduino Burn & Go with Arduino (tail showing) Quick and dirty breadboarding

What is it?

The Burn & Go is a semi-shield for Arduino. It acts as a zero-insertion-force pass-through adapter for the 28-pin Atmel chip.

What does it do?

It has two modes, one for each state of the “tail” switch. They are:

  1. Go mode
    Complete pass-through. There is literally no difference in this mode between having the Burn & Go attached and having the Atmel chip inserted directly. Sketches can be uploaded and all inputs and outputs of the chip can be used as normal.

  2. Burn mode
    Optiloader mode. When this mode is entered with a chip locked into the Zippy socket, the chip will be loaded with the Optiboot bootloader that corresponds to the chip type. For compatible chips, see the listing below.

How do you use it?

  • You flip the switch one way, the bootloader is burned (you don’t even have to disconnect it from the computer or whatever it’s doing at the time) and a green light flashes (red if there’s a problem)

  • Flip the switch the other way, the Arduino functions entirely as normal (it will be a clean sketch-slate if it’s just been in the other position with the power on)

How does it work (the short, short version)?

The two-way switch extends power and ground from the Arduino to the onboard Atmel chip (with Optiloader on it). It also moves the reset control from the Arduino board to the onboard chip.

So in position one, everything is as normal because the onboard chip has no power and no ground, so the connections to its digital pins are irrelevant (open). In position two, we move the reset control away from the Arduino board (and the hair-trigger watchdog circuit) and give power and ground to the onboard chip.

In position one, it’s like the extra circuitry doesn’t exist (all power and ground connections are tied to the switch) and in position two, only the onboard circuit is in full control (wired up very similar to the way one Arduino can be used to program another - see the references below).

Why did you make it?

I wanted a no-fuss integrated method that would allow me to take a blank Atmel chip (which are more expensive if you buy them with a bootloader), burn the bootloader and then proceed to load it with a sketch. I also wanted a way to ensure that with the many projects that I had in mind, I wouldn’t end up bending pins so often when moving the Atmels around.

What are the benefits of it?

Well, it… :

  • … can detect and burn the appropriate bootloader for your blank Atmel chip in mere seconds (see the list of compatible chips below)
  • … can protect your pins if you are intending to do a lot of chip swapping (like for standalone project development)
  • … eliminates the need for a seperate bootloader and sketch programmer (and the need to move the chip at all in the process)
  • … fits on the Arduino UNO without obstructing any pins (but I will have to invent some high headers OR make it into a full shield if I wish to put shields on it)
  • … reduces standalone project costs and times by allowing the fast use of entirely blank Atmel chips and at the flick of a switch, allowing them to be loaded with sketches too
  • … doesn’t need to be connected to a computer or set up in any way (except powered) to burn a boot loader
  • … is powered entirely by the Arduino itself
  • … does not require disabling of the Arduino’s auto-reset feature and hence the UNO works fine with this
  • … doesn’t affect the completely normal functioning of your Arduino so it can stay attached at all times

Any down sides?

  • It currently obstructs some of the onboard LEDs (I will eventually either redesign the board to be smaller or make pass-through LEDs for it)
  • It currently uses header pins to connect with the Arduino DIP socket so it makes them irrepairably larger, however this can be rectified by using a DIP socket to do this instead
  • It currently can only be used without shields, as it requires header extensions (due to the height of the Zippy socket)

Parts & Tools List

  1. 1 x Vero-style protoboard (cut to 50mm x 40mm)
  2. 2 x 3mm LED (I used red and green)
  3. 1 x 16MHz Ceramic Resonator (but any Atmel-compatible value can be used - up to 20MHz)
  4. 1 x 10KOhm Resistor (for the reset pulldown)
  5. 1 x 100Ohm Resistor (for the LEDs)
  6. 1 x 28-pin Zippy Socket
  7. 2 x 14-pin DIP Sockets (they form the 28 pin socket for the on-board Atmel328P)
  8. 1 x Atmel328P (loaded with a custom derivative of the very excellent Optiloader sketch - more details below)
  9. 1 x 2-Way 3 or 4 contacts switch (isolated contacts)
  10. A few lengths of proto-wire
  11. Heatshrink tubing of various sizes
  12. Solder (and flux for tinning)
  13. Soldering Iron
  14. Hacksaw or Dremel
  15. Stanley knife (very sharp, for trace cutting)
  16. Arduino UNO (with Atmel chip)
  17. Either 28 standard header pins in two strips of 14 or two more lots of 14-pin DIP Sockets

Reference Information

  • Optiloader @ github - This project would be nothing without this awesome sketch by Bill Westfield (“WestfW”). The only changes I needed to make to his sketch were pin and notification related (so that LEDs do certain things when successful or failed). The sketch includes the hex-encoded Optiboot (Arduino UNO) boatloaders for the following chips:
    • Atmega328P
    • Atmega328
    • Atmega168
    • Atmega8
  • The Arduino UNO schematic - this came in handy when devising the circuit (I have R1 and R3)
  • Arduino To Breadboard - how to use your Arduino to program an Atmel chip on a breadboard
  • Building an Arduino on a Breadboard - this article I found after making the Burn & Go but it seems like a useful resource

Downloadable Content

I didn’t bother running this through a schematic or designer first. As the caption above says, I did it straight from head to breadboard. Later on I might do a retrospective one if there’s enough interest. This is, however, only the first revision. I may also do another revision in future that does away with the switch in favour of transistor or opto-coupled switching, but this was the quickest and easiest method.

Disclaimer

I’ve probably made an ommission or error in this post. Bite me. :) No, seriously, if there’s a mistake or oversight by all means contact me and I’ll make the correction. I try to be as thorough as possible but sometimes I just don’t have time to double check everything. I could do better, I’m sure, but I’d rather be playing with toys.