Difference between revisions of "Project:YAAC 20/20"

From London Hackspace Wiki
Jump to navigation Jump to search
(Created page with 'Project maintained by Daniel Sikar ~/ dsikaratgmaildotcom. {{ProjectDetails|ProjectTitle=YAAC 20/20}} == Project Brief == ==== Summary ==== YAAC - '''Y'''et '''A'''nother '''A…')
 
(Blanked the page)
Line 1: Line 1:
Project maintained by Daniel Sikar ~/ dsikaratgmaildotcom.
 
  
{{ProjectDetails|ProjectTitle=YAAC 20/20}}
 
 
== Project Brief ==
 
==== Summary ====
 
 
YAAC - '''Y'''et '''A'''nother '''A'''rduino '''C'''lone. Based on Atmel's AT90USB162. Low part count. Cheap to build.
 
 
==== Overview ====
 
 
This is something I developed above the 20/20 Archery Club, at the previous London Hackspace address. It is based on three projects, the [http://dorkbotpdx.org/wiki/benito Benito 7], [http://www.makestuff.eu/wordpress/?page_id=569 Nanduino] and [http://www.pjrc.com/teensy/ Teensy]. You can run sketches on this device, though getting to burn actual code onto the YAAC is not as straightforward as with *real* Arduinos.<br>
 
<br>
 
On the host side, for this specific project, I am running Ubuntu 10.04. It will probably run on other Debian based distributions without hickups. I don't know about Macs. I have burnt code on the YAAC running Windows Vista SP3 on the host, using the AVR toolchain - as per Nanduino recipes. I don't know about running the Arduino IDE on Windows (TODO - find out).
 
 
== Motivation ==
 
 
1. Gaining experience with SMD components (AT90USB162).
 
 
2. Building a cheap device that can be programmed via USB.
 
 
3. Working with Atmel microcontrollers.
 
 
4. Being able to tap into the growing Wiring code examples.
 
 
== Prototype ==
 
 
Note the essential push button is missing from the shot.
 
 
[[File:Yacc.jpg|400px]]
 
 
== Schematic ==
 
 
On the way.
 
 
== PCB ==
 
 
On the way.
 
 
== Software required ==
 
 
* Arduino IDE - to compile sketches.<br>
 
* Teensyduino Arduino IDE addon - to list the Teensy on the Arduino IDE.<br>
 
* Teensy loader - the Teensy GUI, this actually needs to be running otherwise the Arduino IDE will not compile sketches.<br>
 
* dfu programmer - to burn the actual code (hex file) onto the AT90USB162.<br>
 
 
=== Installation ===
 
 
* Arduino
 
 
$ sudo apt-get update<br>
 
$ sudo apt-get install arduino<br>
 
$ cd ~/arduino-00xx<br>
 
$ ./arduino<br>
 
 
* Teensyduino<br>
 
 
$ wget http://www.pjrc.com/teensy/teensyduino-0018<br>
 
$ ./teensyduino-0018<br>
 
 
* Teensy loader
 
 
$ wget http://www.pjrc.com/teensy/teensy.gz
 
 
extract then:<br>
 
 
$ cd <path to extracted files><br>
 
$ sudo cp 49-teensy.rules /etc/udev/rules.d/<br>
 
$ gzip -d teensy.gz<br>
 
$ chmod 755 teensy<br>
 
$ ./teensy &<br>
 
 
* dfu programmer
 
 
$ sudo apt-get install dfu-programmer
 
 
== Programming the YAAC ==
 
 
=== Enumerating ===
 
 
Once connected, from the prompt run lsusb (list USB devices):
 
 
$ lsusb
 
 
which should generate a list such as:
 
 
Bus 005 Device 002: ID 044e:300d Alps Electric Co., Ltd Bluetooth Controller (ALPS/UGPZ6)<br>
 
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
 
Bus 004 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader<br>
 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
 
(...)<br>
 
 
The YACC at this point should not be listed because the device needs to be reset first.<br>
 
Push the reset button for 5 seconds (I count five elephants) then run lsusb again.<br>
 
 
$ lsusb
 
 
This time, all being well, an Atmel device should enumerate:<br>
 
 
Bus 005 Device 002: ID 044e:300d Alps Electric Co., Ltd Bluetooth Controller (ALPS/UGPZ6)<br>
 
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
 
Bus 004 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader<br>
 
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
 
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br>
 
'''Bus 002 Device 003: ID 03eb:2ffa Atmel Corp.'''<br>
 
(...)
 
 
That is the YAAC.
 
 
=== Running sketches and generating hex code ===
 
 
At this point in time, Serial.print() does not work on this setup so there is not a lot of feedback from the device.<br>
 
At any rate, the sketches are run on the Arduino IDE, as per normal usage, piggybacking on the Teensy to make the Arduino IDE believe there is indeed a compatible device attached. This will generate a hex file in your /tmp directory. That is the code that needs to be burnt into the YAAC.<br>
 
 
=== Burning hex code ===
 
 
From the prompt run:<br>
 
 
$ sudo dfu-programmer at90usb162 erase<br>
 
$ sudo dfu-programmer at90usb162 flash --debug 20 /tmp/build<...>.tmp/<filename>.cpp.hex <br>
 
$ sudo dfu-programmer at90usb162 start<br>
 
 
Note, the device must be reset before proceeding with the 3 steps above. Also, AFAIK, you must be root to access the USB device. If you forget sudo, strange things might happen e.g. code not burning, device not erasing and starting, etc, though no error message will be given.
 
 
== Potential improvements ==
 
 
Lots of room for improvement:
 
 
* Getting Serial.print() to work
 
* Getting the actual YAAC listed on the Arduino IDE, instead of the Teensy.
 
* Burning code straight from the Arduino IDE onto the YAAC, though this would required major roadworks, as the current FTDI chip, which deals with the Arduino's USB protocol, would have to come out of the loop. Why not use the FTDI, and do a straight clone? Because it increases the cost.
 
* Use all SMD components, doubled sided board, shield compatible format.
 

Revision as of 21:56, 27 September 2010