So, I've managed to get my ATmega88A chip up and running. I managed to get the programmer (AVRISP2 MKII) working with the Mac, by changing drivers. The original drivers weren't picking up the device. I found the method for the fix the problem at http://cooperlees.com/blog/?p=414. I used the osx-pl2303 driver as it had more entries to change than the standard prolific driver (I tried adding an entry to both but failed both times so had to edit a previous one). In hindsight I probably should have used the official or some other driver as the osx-pl2303 drivers use a weird naming convention for the file system sockets. It also doesn't support OSX 10.7 or 10.8 for future use. I didn't use USBProber as the article said and simply used the values from system profiler above which I then converted to decimal (with the help of Google, I was being lazy). With this I thought great, I should be able to program now from the mac using CrossPack (avr-gcc, avr-dude etc), unfortunately no such luck. I haven't had a lightbulb moment since fixing the driver issue so I've resorted to programming mainly on XCode and then copying the files to AVR Studio on Windows to download and debug. To actually set up the connection to the chip, I had to create an adaptor that went from the 3x2 connector on the MKII to a spread out version that would fit into the bread board. Sorry about the colours of the different pictures being bad but I couldn't be bothered using a proper camera and my phone wasn't picking up great colours with the incandescent room light (flash and the desk fluorescent over exposed the pictures). The adaptor is made using header pins and variboard. So to not short between the two sides of the connector, a knife was used to cut the track. I also used a knife to cut and break the variboard, but looking back I should have used a band saw (though most people won't have one of these).
The breadboard programming adaptor |
In other news, I can't use the Freeflex heated tubing I was hoping to use as they only supply to OEMs in large quantities. This means I'll have to make my own heated tubing or abandon the idea altogether and hope it doesn't harden in the tube. I don't want to use a syringe as that would mean not being able to do large chocolate items. I had a look into header fittings (for connecting the slave controllers to the master) and found out on the molex site that they should be able to cope with 2-3A depending on the wire sizes (here and here). This means I should be able to simply use header connections to connect the motors and slave controllers to the main electronics. I also was thinking last night that I might include a global interrupt wire that can be pulled high or low (not sure yet) when there is an error. This would cause everything to stop and remember where it was up to while the master controller checked with each component for errors. The reason for this is that if something goes wrong, say one motor out of two in the Z slide stops working, the controller can stop everything and correct or signal to the user so something else doesn't break or become damaged.
That's all for this post. I'll write another quick post about setting up the ATmega88A to control a LED brightness. The reason for keeping these separate is so its easier to search and if someone just wants to know about that and not the rest of the 3D printer stuff they aren't given unnecessary information.