Project:YAAC

From London Hackspace Wiki
Jump to navigation Jump to search

Project maintained by Daniel Sikar ~/ dsikaratgmaildotcom.

YAAC



QR code


Project Brief

Summary

YAAC - Yet Another Arduino Clone. Based on Atmel's AT90USB162. Low part count. Cheap to build.

Overview

This is something I developed entirely above the 20/20 Archery Club, at the previous London Hackspace address. It is based on three projects, the Benito 7, Nanduino and Teensy. You can run sketches on this device, though getting to burn actual code on the Atmel is not as straightforward as with *real* Arduinos.

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, but used the AVR toolchain and in that case, the Arduino IDE is out of the loop, though the language is practically identical to C/C++, and Arduino/Wiring examples should be easily ported.

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 libraries.

Schematic

On the way.

PCB

On the way.

Software required

Arduino IDE - to compile sketches.
Teensyduino Arduino IDE add-on - to list the Teensy on your Arduino IDE.
Teensy loader - the Teensy GUI, this actually needs to be running in order to compile sketches into hex code. There is a command line version which I haven't used yet and will probably make this a little leaner.
dfu programmer - to burn the actual code (hex file) onto the AT90USB162.

Installation

  • Arduino

$ sudo apt-get update
$ sudo apt-get install arduino
$ cd ~/arduino-00xx
$ ./arduino

  • Teensyduino

$ wget http://www.pjrc.com/teensy/teensyduino-0018
$ ./teensyduino-0018

  • Teensy loader

$ wget http://www.pjrc.com/teensy/teensy.gz

extract then:

$ cd <path to extracted files>
$ sudo cp 49-teensy.rules /etc/udev/rules.d/
$ gzip -d teensy.gz
$ chmod 755 teensy
$ ./teensy &

  • 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)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
(...)

The YACC at this point should not be listed, the device needs a reset.
Push the reset button for 5 seconds (I count five elephants) then run lsusb again.

$ lsusb

This time, all being well, an Atmel device should enumerate:

Bus 005 Device 002: ID 044e:300d Alps Electric Co., Ltd Bluetooth Controller (ALPS/UGPZ6)
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 002: ID 0483:2016 SGS Thomson Microelectronics Fingerprint Reader
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 03eb:2ffa Atmel Corp.
(...)

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.
At any rate, the sketches are run on the Arduino IDE, as per normal usage. This will generate a hex file in your /tmp directory. That is the code that needs to be burnt into the YAAC.

Burning hex code

From the prompt run:

$ sudo dfu-programmer at90usb162 erase
$ sudo dfu-programmer at90usb162 flash --debug 20 /tmp/build<...>.tmp/<filename>.cpp.hex
$ sudo dfu-programmer at90usb162 start

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.

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 some 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.