Duinotech Uno Programmer
Summary
Recently, we had to program a big pile of Uno's for some workshops we were running, getting kids to build the Snake Game Project. We didn't want to worry the kids with the programming side of it, so we needed a pile of preprogrammed Uno's for them to build with. The idea of using an Uno to program an Uno sounds a bit meta, but with a USB Host Shield, we managed to program our Uno's. In fact, the programming only takes about three seconds per board, which is even faster than we could unpack them. Some soldering required.
Materials Required
1 | Duinotech UNO r3 Main Board | XC4410 |
1 | Arduino Compatible USB Host Expansion Board | XC4456 |
1 | Duinotech Arduino Compatible Prototyping Shield | XC4482 |
1 | Red 5mm LED 8mcd Round Diffused | ZD0150 |
3 | Green 5mm LED 80mcd Round Diffused | ZD0170 |
1 | 470 Ohm 0.5 Watt Metal Film Resistors - Pack of 8 | RR0564 |
1 | Red Snap Action Keyboard Switch - PCB Mount | SP0720 |
Resources
Table of Contents
Future Improvements
Although this function may be of limited use, it is possible to program the Duinotech Uno Programmer sketch to the target. In the sketch file, there are the lines:
if(progdata(sketch,sizeof(sketch))){ //included sketch// if(progdata(0,32256)){ //this sketch (entire flash)
Serial.println("Write OK");
digitalWrite(LED2,HIGH);
if(verdata(sketch,sizeof(sketch))){ //included sketch
// if(verdata(0,32256)){ //this sketch (entire flash)
If the two '//' commented lines are uncommented and the corresponding line immediately above is commented out, then the sketch will copy its entire flash memory to the target.
Another option will be to include multiple sketches onboard, so that the programmer can be used for multiple targets. If you find you are running out of flash memory, you can try using a Mega as the main board (although there are known bugs if more than 64k of non-code data is stored in the flash memory using PROGMEM).
One idea we thought of using was to put the hex files on an SD card and use this for storage, but we didn't get around to solving the issue of different devices sharing the SPI bus (it shouldn't normally be a problem, but the USB Host Shield and the Data Log Shield for the SD card both use pin 10 for SS, which would have necessitated modifying one of the shields.) In the end, the single sketch solution was all we needed, so we didn't pursue this further. Still, the idea of a portable programmer (perhaps with a small screen and some buttons) which could be loaded with all manner of sketches is very appealing.
As we noted before, the Mega and Leonardo use different protocols for upload, so this would have to be rewritten to take the protocols into account, although the USB device type should not need to change.
Similar projects you may be interested in