LumiNet (based on attiny84)

Interrupts have not been supported by my first release. I created a new release today:

  • added Interrupt support for INT0 and INT1.

So you can use
http://www.arduino.cc/en/Reference/AttachInterrupt
just like on the official Arduino.

The Wire Library compiles without problems. So I2C is available. But the example sketch is too big for the small memory of the attiny2313. So I think that I2C can be used, but you must modify the Wire lib... I can do that for you if you don't know how to do it. The Wire lib can be split into two parts: master and slave... so if you want the tiny2313 to be a I2C slave, then you don't need all the master routines in the memory (because they won't be used in this case)...

I also included this fix to Print.h and Print.cpp:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1244128096/0#0

Hello

You have asked about feedback to your software (Arduino LumiNet Edition).
I have found some bug – when I was trying to use OneWire library. Some errors occurs during compilation. (I'm useing Duemilanove)
The same code works properly on Arduino 0015.

Best regards
NiechcialA

I will fix that in the next week. Are there other known bugs?

Has anyone released a pc board with an ATTiny84 thaat they are willing to share. Not necessarily the Luminet form factor itself. I am thinking of doing a board design, but do not want to reinvent the wheel so to speak.

/me

Can I buy a luminet board? Is the schematic posted anywhere?

If I want to set up my own attiny circuit and use the arduino environment what do I have to do?

Sorry for the late answer.

I will try to publish the schematics soon.

But all you have to do is to add an attiny84 mcu to a breadboard, connect power and use a pull-up resistor (10k) on the /RESET pin. (Or you change the fuses and disable external reset)

You can upload sketches to the chip via ISP (in this case you need a hardware ISP programmer or a modified Arduino) if you select "LumiNet Sensor Node" in the "Board" menu.

You can also use an attiny2313, I uploaded the sources for this mcu to the luminet.cc homepage.

You can also use any other attiny mcu, but then you need to write a new core (or let me write it if you tell me which mcu you want to use).

You can send me a private message if you want to buy LumiNet boards. We did not sell any board yet, but send me a pm.

Waiting for my Evil Mad Scientist Labs attiny2313 board to arrive for a project I'm working on.
http://www.evilmadscientist.com/article.php/card2313

This is fortuitous, will be seeing what I can do with the TinyDuino capabilities you've enabled. We can call it the EvilDuino 2313. :wink:

Thanks for the work on the port!

the board looks very nice. It should work with my code out of the box. The attiny2313 port uses an external 8MHz crystal, so you might want to add one to your evil board. Or you change the fuses if you want to run it on another clock.

Please tell us how if you have any problems.

Waiting for my Evil Mad Scientist Labs attiny2313 board to arrive for a project I'm working on.
Tiny portable AVR projects: ATtiny2313 breakout boards | Evil Mad Scientist Laboratories

I looked at your board and it's beautifull, but for me it's worthless. I mean from a robotics oriented guy's point of view. The most important thing your board lacks is power busses near each pin. And you have that space! Why waste it and lose the robotics oriented customers? just add 2 more pins close to each usable pin of the tiny2313 with Vcc closer to the pin and GND to the outside. This way we can connect servos and sensors directly without splitting the cables!

Thanks!

ok, I have an ATtiny84 on a breadboard hooked up to a homebrew avrisp arduino setup. The basic setup works - e.g. I can get avrduded to read and write fuses on the ATtiny84.
as evidence:

c:\WinAVR-20090313\bin>avrdude -pt84 -cSTK500 -P\\.\COM1 -e -Uefuse:w:0xFE:m -Uh
fuse:w:0xDF:m -Ulfuse:w:0x62:m error=2 -b19200
avrdude: successfully opened stk500v1 device -- please use -c stk500v1

avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny84
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.12s

avrdude: Device signature = 0x1e930c
avrdude: erasing chip
avrdude: please define PAGEL and BS2 signals in the configuration file for part
ATtiny84
avrdude: reading input file "0xFE"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFE:
avrdude: load data efuse data from input file 0xFE:
avrdude: input file 0xFE contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.06s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDF"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.06s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDF:
avrdude: load data hfuse data from input file 0xDF:
avrdude: input file 0xDF contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.02s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0x62"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.05s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0x62:
avrdude: load data lfuse data from input file 0x62:
avrdude: input file 0x62 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.03s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

I've downloaded the original luminet setup and selected the luminet sensor board. I selected the burn bootloader w/AVR ISP and issued the file->burn bootloader to I/O board. I get a windows message saying avrdude has stopped working and the arduino ide says "programming fuses failed".

I thought: ok, I'll compile "Blink" and stuff the .hex file into the attiny with avrdude. On compiling Blink I get some unfamiliar lines, a bunch of red messages, and the familiar sketch size message.

2>>>COMasm.S

2>>>digitalWriteASM.S
 
Cross Reference Table

Symbol                                            File

COM_getc                                          C:\Users\Bill\AppData\Local\Temp\build38633.tmp\COM.c.o

<SNIPPING OUT A BUNCH>

total_in                                          C:\Users\Bill\AppData\Local\Temp\build38633.tmp\bynase.c.o

vtable for HardwareSerial                         C:\Users\Bill\AppData\Local\Temp\build38633.tmp\HardwareSerial.cpp.o


Binary sketch size: 2018 bytes (of a 5720 byte maximum)

poking around in my sketchbook I don't see the applet directory or the .hex file I would expect to find after a successful compilation.

A couple of things I hope aren't the problem:
1)I am still using arduino 0013 as my mainstay and I did not replace that with the luminet directory.
2)I replaced the avrdude.exe and avrdude.conf files in the luminet directory with the ones from a winavr download - that seemed to be needed to get my homebrew programmer working but it didn't make any difference in this case.

any suggestions gratefully accepted and thanks for the luminet work to date.

Check the TEMP directory (you can get to it quickly with %TEMP%). Arduino 0015 puts intermediate files (except library ones) and target files there.

Check the TEMP directory (you can get to it quickly with %TEMP%). Arduino 0015 puts intermediate files (except library ones) and target files there.

Hey, that was it - thank you very much.

So, it's a bit of a kluge at the moment but I can write code in the arduino IDE and run it on the ATtiny84. I'm guessing it's still to do with avrdude and my cobbled up programmer.

Works though, and I'm hopeful it won't be too hard to tidy up what with my mad avrdude skillz and all. Thanks to bohne for the ide integration and to drug123 for the four-jumper programmer idea.

Great to hear that it works! You seem to have the only tiny-based Arduino-clone beside the LumiNet. Fantastic!

Some guys from Sketching in Hardware 2009 (I just returned from London at this very moment) took some LumiNet nodes and I hope to get feedback soon. So stay tuned for upcoming LumiNet improvements. We also updated the www.luminet.cc homepage with more information.

LumiNet and the LumiNet Jacket will be presented tomorrow in Aachen (6 pm) at the second dorkbot meeting in Aachen (www.dorkbot.de).

You are all invited to visit us.

LumiNet and the LumiNet Jacket will be presented tomorrow at Aachen (6 pm) at the second dorkbot meeting in Aachen (www.dorkbot.de).

You are all invited to visit us.

I'm excited for you. Good luck academically and with the presentations. sadly I won't be able to visit in person! I've printed your thesis by the way and I'm reading it. I bet it gets way more distribution than the average academic effort.

Thank you very much! If you have any feedback to my diploma thesis, then please send me a private message.

My main concern is to get people involved with Arduino and physical computing. My academic work is not that important to me, but a wide distribution sounds nice.

What are you going to do with my IDE / tiny core?

My main concern is to get people involved with Arduino and physical computing. My academic work is not that important to me, but a wide distribution sounds nice.

Don't be too modest. Getting a masters degree is no small effort and having the letters after your name lends weight to your efforts in any endeavour - So I'm REALLY glad you're into arduino!

What are you going to do with my IDE / tiny core?

I'm interested in the Tiny support so I can make a physically small, low power, version of a project I'm working on. http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1244069576
Even this beast could run with the 14 pin t84 and my next target will be maybe an 8 pin t85.

As I posted earlier though, the modified IDE compiles and produces valid .HEX files but I'm not able to get the bootloader onto the t84 using my homebrew programmer which emulates the avrisp. The problem I have seems to be avrdude locking up or blowing up. This is the same issue I had with the avrdude packaged with arduino and which I cured by using the avrdude from winavr. I tried replacing avrdude.exe and avrdude.conf in the luminet ide package with those from winavr but no improvement.

Could you explain which of the steps below are needed for attiny support(as opposed to luminet) and are there other changes? For example I see new entries in boards.txt.

Also, if I'm going to manually upload the sensor node boot loader, can I then do serial to it?

In order to get the attiny84 chip running with the Arduino IDE, some modifications must be made to the source code of the IDE. After this, the IDE has to be recompiled of course.

Based on revision 557 (from March 7th, 2009 - which is Arduino0014), I created a patch that contains the following changes:
1 Compile .S assembler files in the target directory. Should also work with assembler files in the sketch directory, but this was not tested. Important: use a capital S as your file extension!(Changes in Complier.Java and Target.java)
2 Burn bootloader using STRG+B shortcut. Select the ISP programmer in the Tools->Burn Bootloader menu and this programmer will be remembered until you change it. (Changes in Editor.java)
3 Sketches for cores that are based on attiny chips will get uploaded (Changes in AvrdudeUploader.java)
4 Programming by infection - the upload mechanism using the LumiNet bootloader - is supported (Changes in AvrdudeUplioader.java and new source: LuminetUploader.java)
5 youboardname.upload.protocol=stk500v2 in boards.txt made some trouble here with an original stk500v2 board, fixed this issue (AvrdudeUploader.java)

The problem seems to be your homebrew programmer.
Where can I find more information about this device? Then I will have a look at it.

comments on the 5 changes:
1 is important for LumiNet because the communication is implemented in assembler (it was too slow in C)
2 this is just nice to have if you have to put the bootloader to more than 5 nodes...
3 is important for LumiNet and for any other attiny-based board
4 is only important for LumiNet, no other board will use programming by infection
5 the baudrate was a problem with my original Atmel stk500v2, so I omitted the baudrate parameter

A sensor node does not have a booloader. Sensor nodes have to be programmed using an ISP hardware programmer. A sketch on a sensor node can use the Serial commands like Serial.begin() and Serial.write(), but it is limited to the baudrate that is specified in the assembler file... it uses 9600baud by default and Serial.begin(12345) will still result in a 9600baud serial connection. So use 9600baud for serial communication please.

I will try to uplioad an attiny85 version if you are interested. I used attiny85 mcus for prototyping LumiNet in the past, so attiny85 support should be easy...

thanks a lot. I THINK i understand where i am based on this and your pm's.

maybe one more question: does the ide drive the sketch uploading using the isp programmer or do i have to do it separately?

The homebrew programmer, by the way, is just a few jumpers and an arduino sketch (see below). It works fine as a standalone loader.

// this sketch turns the Arduino into a AVRISP
// using the following pins:
// 10: slave reset
// 11: MOSI
// 12: MISO
// 13: SCK

// Put an LED (with resistor) on the following pins:
// 9: Heartbeat - shows the programmer is running
// 8: Error - Lights up if something goes wrong (use red if that makes sense)
// 7: Programming - In communication with the slave
// 
// February 2009 by Randall Bohn
// - Added support for writing to EEPROM (what took so long?)
// Windows users should consider WinAVR's avrdude instead of the
// avrdude included with Arduino software.
//
// January 2008 by Randall Bohn
// - Thanks to Amplificar for helping me with the STK500 protocol
// - The AVRISP/STK500 (mk I) protocol is used in the arduino bootloader
// - The SPI functions herein were developed for the AVR910_ARD programmer 
// - More information at http://code.google.com/p/mega-isp

You can upload sketches using an ISP programmer with the IDE.

What you have to do:
edit the file boards.txt and replace the upload protocol (stk500 is the default) by the protocol that your programmer uses, e.g. the stk500v2 protocol:

luminet3.upload.protocol=stk500v2

Then the IDE uses this ISP protocol to upload sketches via ISP. The ISP programmer that you select in the "Burn Bootloader" menu is only for uploading the bootloader via ISP, not for sketches, I guess.

So if you want to upload a sketch to a LumiNet vector node, you can try to use the stk500v1 protocol in the boards.txt file for the luminet3 entry:

luminet3.upload.protocol=stk500

The stk500 protocol is the stk500v1 protocol and this is the protocol used by the bootloader of original Arduino boards... I never tested ISP with the stk500v1 protocol.