ATtami

From TAMI
Jump to: navigation, search

a 5₪ (1€) open hardware microcontroller dev board

iSVDx5k.png 5CG3Kvm.png

github
and here is a collection of tiny dev boards > MCU.SOUP.IO

changelog

  • 20/29/2018 - improved ATtami#Programming section
  • 28/04/2016 - price hike for the ATTINY85-20SU forces us to search for a new(?) supplier. arch pic pic>!
  • 24/04/2016- got the new batch. we will have an assembly party soon. processing...
  • 20/08/2015- green edition workshop at tami - image gallery
  • 08/08/2105 - boards on their way
  • 28/03/2105 - another build party in the works, thanks ido
  • 01/01/2015 - just had our first mass bake off, at least 80 boards are out in the wild. http://imgur.com/a/MkchW
  • 10/08/2014 - micronucleus bootloader is up and running
  • 28/07/2014 - got 4 boards assembled, had first mini tiny workshop. got blink via isp. now for the bootloader with vusb control
  • 18/07/2014 - got rev16 from OSHpark, missing some silkscreen on top and D3 is too small.
  • 6/13/2014 - test Gerber sent to OSHpark, we should be getting boards in a week or so.
  • 5/25/04 - still working on the power module, fight between the MIC5225-5 and the NCP4626
  • 4/24/04 - design meeting with guy, Tzvi, jr and yr. we talked about the core stuff like the vusb thingy, power issues (vcc,vbat,vusb)
  • 5/6/04 - post design we did some work on the layout, next meeting coming Friday at 14:00

discussion over at the mailing list under "care for your con"/[attami] threads

quick FAQ and updates

is it really 5nis?

the BOM has most of the story (updated the choice of LDO on 28/03/2015)

when we did the first batch the attiny85 was at ~0.6 for 100+ since then the price went up (0.9?).

as the two most expensive parts in the BOM are the MCU and the LDO we currently have a ready to fab design with two footprints for a voltage regulator. the original LDO, and a dirty cheap AMS1337 https://imgur.com/2LHMcfu but this has not materialized yet.

so whats the stock?

we have a few (~20) unpopulated boards left from the previous batch this is the tami production bin
nMdTbDfl.jpg

note apart from the LDO and MCU - everything else is in the bigger plastic attami bin, in the 100s/1000s

is the project dead

no, there is work being done on an a programming shield for the arduino that will help with flashing and resting fuses on attami and other tiny family members. https://github.com/telavivmakers/High-Voltage-ATtiny-ATTami-Fuse-Reset

and jr et el are working on a motor shield, noam is on the audio front and the tutu shield will happen.



todo

  • update the kicad viewer
  • come up with shields
  • set another build party

much

target price - 5 shekels see BOM
labor not included



Hardware

design

eagle PCB design files are on github

check this design consideration PDF

build

this boards are designed for workshop/sweatshop type assembly.
it is shown a noob can make&bake her own board in a matter of hours using the appropriate tools
most parts are SMD (surface mount devices) accept the headers

  • part placemnt
    • using tweezers and solder paste
    • using a "jig" from acrylic to drop parts (experimental)
  • experiment with different ovens

SEE OVEN REFLOW PROJECT PAGE

Parts

check out the BOM spreadheet

shields

eagle cad templates for new ATtami shield are over at the ATtami github shield sub dir
contact yair99[at]gmail for help, or fork and pull when in need


MOSFT

this is the n-channel mosfet we have a reel of (1000~)

tpTdUsk.jpg

charging

A trickle charge circuit can be made using a cheap wall cube as the DC source
and a single power resistor to limit the current.

from an official TI whitepaper :) Battery Charging whitepaper pdf

wireless

battle of the modules

ethernet

  • ENC28J60 module
    • 4$ module AExpress
    • SPI protocol
    • library via jeenode - https://github.com/jcw/ethercard
    • cant be used, doesn't have onboard TCP/IP stack so needs to happen on board, at 7Kb its too big for use on the attiny family.
  • wiznet w5100
    • to expensive at 13$ a pop

IR blaster

three buttons via one analog pin and resistor ladder




Programming

the folks over at digispark ahve done a great job of managing this and you can safely use their arduino package.
until arduino 1.5.x it was a bit of a mess adding new boards, but now its easy.

Arduino Installation Instructions:
  • First download the appropriate Arduino package at the Arduino.cc website: https://www.arduino.cc/en/Main/Software Or in ubuntu "apt-get install arduino"
  • Install or Unzip the Arduino application.
  • Run the Arduino application.
  • In the Arduino application go to the "File" menu and select "Preferences"

and click OK

Preferences.gif

Note: If you already have additional URLs entered in that box, then click the button on the right of the box and enter this URL on a new line.

Entry.jpg

  • Go to the "Tools" menu and then the "Board" submenu - select "Boards Manager" and then from the type drop down select "Contributed":
  • Select the "Digistump AVR Boards" package and click the "Install" button.

Digispark install.gif

  • You'll see the download progress on the bottom bar of the "Boards Manager" window, when complete it will show "Installed" next to that item on the list.
  • WINDOWS USERS: When complete the install with pop up a Driver Install Wizard window, please click "Next" on this Window to install the drivers for Digistump Boards (If you already have them installed, this installer will update them and install any that are missing)
  • With the install complete, close the "Boards Manager" window and select the Digispark from the Tools->Boards menu. "Digispark (Default - 16.5mhz)" is the board that should be selected by all new users. This is what AT TAMI also uses.

Pickdigispark.gif

  • The install is now complete! (Linux users see note below)
  • [linux] If you haven't before - Install the udev rules found here: [section]


Using the AT TAMI with the Arduino IDE:

The Digispark works a bit differently than some Arduino compatible products. The Digispark programs with a different procedure.

From the Tools menu select Board->Digispark (Default - 16.5Mhz)

(The Tools->Programmer selection does not matter)

Write some code, open your code, or open a Digispark example.

You do not need to plug in your Digispark before invoking upload

Hit the upload button. The bottom status box will now ask you to plug in your Digispark - at this point you need to plug it in - or unplug and replug it.

You'll see the upload progress and then it will immediately run your code on the Digispark.

If you unplug the Digispark and plug it back in or attach it to another power source there will be a delay of 5 seconds before the code you programmed will run. This 5 second delay is the Digispark Pro checking to see if you are trying to program it.


Manual way

micronucleus (command line)

 # we use the bootloader command line interface 
 git clone https://github.com/micronucleus/micronucleus
 cd micronucleus/commandline
 make
 # for this no we will use the hex files tami uses to test the board, its a nightrider led wave
 # you only need to grab the .hex, or you can build it if you have avr-gcc
 wget https://github.com/telavivmakers/ATTami-Tester/raw/master/ATTami-Tester.hex
 #you might need to do it as sudo
 run micronucleus --run ATTami-Tester.hex
 # IRL plug in your board now and you should get a confirmation from MNuc when its done
arduino IDE

download

  • arduino 1.5.x (beta) x64 x32
  • digistump toolchian github
  • micronulious github
  • unpack arduino-1.5.x
  • extract digistump/hardware/digistump to arduino-1.5.x/hardware/
x64
  • extract arduino-1.5.x/hardware/digistump/avr/tools/avrdudex64.tar to same folder
  • git clone and extract micronucleus
 # git clone https://github.com/micronucleus/micronucleus.git
 # cd /micronucleus/commandline

then build

 # pacman -S libusb libusb-compat
 # make

place the compiled micronucleus commandline tool in arduino-1.5.x/hardware/digistump/avr/tools

 # cp micronucleus /arduino-1.5.8/hardware/digistump/avr/tools
x32
  • extract arduino-1.5.x/hardware/digistump/avr/tools/avrdudex32.tarto same folder


  • clock speeds

you can save power by underclocking the ATtiny. see comments in the MN tricks page

firmware/bootloader

to upload new programs to your ATtiny using the USB connection , you first flash some of the memory with a bootloader (micronucleus)
a bootloader will wake up for 2sec on reset or power up and allow new HEX code to be uploaded via Vusb onto the ATtiny.

wiring

PIN FUNCTION
PB0 MOSI
PB1 MISO
PB2 SCK
PB3 INT3
PB4 INT4
PB5 RESET

the pinout on the usbasp (to the right)
Avr isp.jpg
top view of the head facing down, vtg is vcc



jcNGjfj.jpg


microeconomics bootloader

if you have USBISP and windows = install driver

getting the software

git clone https://github.com/micronucleus/micronucleus.git

while this has the definitions, drivers and the ability to upload via command line.
its missing the arduino IDE. which is a pain, but still better then nothing.

flashing bootloader via programmer (USBasp)

cd micronucleus/firmware 
cat MakeFile | head
////////////////////////////////////
# Configure the following variables according to your AVR.
# Program the device with
#     make fuse    			# to set the clock generator, boot section size etc.
#     make flash   			# to load the boot loader into flash
#     make lock    			# to protect the boot loader from overwriting
#     make disablereset		# for ATtiny85 target - to use external reset line for IO (CAUTION: this is not easy to enable again, see README) 
////////////////////////////////////

make fuse
make flash

SPI programming

if you dont want to use the usb bootloader you can use an arduino as SPI or usbSPI plug to upload programs to the ATtami.

using linux/archx64

instructions:

using Mac OSX

  • make sure that your OS $PATH variable contains /usr/local/bin (Instructions at the top of [1] )
  • install CrossPack to get avr-gcc avr-lib and avrdude [2]
  • plug the USBasp programmer
  • clone the ATTami-Tester git
  • run make.

Arduino as SPI for downloading plain hex files

Download the Arduinoisp firmware to an arduino (I used an Uno) follow the steps from here (pasted locally for convenience) [3] edit Makefile such that the avrdude line to read avrdude -c avrisp -P /dev/tty.usbmodem1421 -b 19200 -p t85 -U flash:w:hello.hex


Compiling

used blink example of arduino, using uno on board definition

while we can upload HEX blobs generated using an ATMEL386 definitions (arduino uno), its better to use the microniuclus def.
its all sorted in the digistump toolchain, but alas, its broken on arch AUR
as it reaches for the latest arduino build, 1.0.5 but this will break the digistump hardware definitions. you need arduino ver 1.0.4 . see this forum post.

so i went and used HEX files compiled on a winXP machine using digistump toolchain.
a HEX is a HEX is a HEX

uploading HEX file to ATtami

we are using the microniclous firemware

##flash hex files via vusb
cd micronucleus/commandline 
make
sudo make install 
./micronucleus --run blink.hex


after that you should see your device using lsusb as "digistump device"

vusb note: once you upload a program the vusb function of the board is no more.
dont worry, you can still upload new programs via the usb, the boot-loader has a grace period
where the vusb is still working, around 2-4 seconds from reset or power plugin.
to retain vUSB functionality you need to integrate it as a library into your code.

FyI



libraries

serial

it can be done, many diffrent ways.
digispark offers a digiUSB lib/driver. couldn't get it to work
softSerial variants work. i used nick gammons SendOnlySoftSerial, with some modes to the cpp file (see this thread). this as the benefit of only using one pin
also of intrest

history

proto board tryouts
fritzing file
EHwB130.jpg

links

  • MCU.SOUP.IO /boards tag an extensive list of tiny dev boards we collected, our board is using ideas from many of these projects
  • discussion over at the TAMI mailing list, under "care for your con" thread(s)

misc

pololu AVR programmer

pinout specific to colors i use
red-nc (for some reason the polou doesn't output voltage from header..) blk-GND ylw-MOSI org-RESET grn-SCK blu-MISO