Arduino Forum

Forum 2005-2010 (read only) => General => Exhibition => Topic started by: Coding Badly on Sep 23, 2010, 07:04 am

Title: Arduino Tiny
Post by: Coding Badly on Sep 23, 2010, 07:04 am

The first Arduino Tiny release is ready...
http://code.google.com/p/arduino-tiny/

Included is a "highly compatible" core for the ATtiny84 processor: most of the functions are very similar or identical to the 0019 core.

Features...

Limitations...

Caveats...

Title: Re: Arduino Tiny
Post by: george_graves on Sep 23, 2010, 10:14 am
Thank you - looking forward to trying this out!

There's been a HUGE missing part of the arduino world is the lack of support for smaller chips.  This is great!
Title: Re: Arduino Tiny
Post by: Coding Badly on Sep 23, 2010, 07:39 pm

Forgot one...

Features...

Title: Re: Arduino Tiny
Post by: volvodani on Sep 23, 2010, 08:19 pm
How to burn the bootloader to an attiny85 i will try this because i had one free for these trying. Wich .hex i have to burn with a ISP?
Title: Re: Arduino Tiny
Post by: Nadir on Sep 23, 2010, 08:47 pm
Look at the thread http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1274820597/all
Title: Re: Arduino Tiny
Post by: Osgeld on Sep 24, 2010, 03:11 am
I have been using the pre-release of this for about a week now, its very nice

and Thank you very much
Title: Re: Arduino Tiny
Post by: Ro-Bot-X on Sep 24, 2010, 04:37 am
Wonderful work!

Is the Servo library working?

Thanks!
Title: Re: Arduino Tiny
Post by: Coding Badly on Sep 24, 2010, 04:58 am

Thank you all for the kind words and encouragement.

Quote
Is the Servo library working?

No.  If you (or anyone else) is willing to test I can provide the changes to Servo.cpp that should get it working.

Please take a moment to click a few checkboxes...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285276725
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285316262
Title: Re: Arduino Tiny
Post by: Ro-Bot-X on Sep 24, 2010, 01:31 pm
Clicked.

I plan on using Tiny 84 and 85 at 8MHz for tiny robots and I need the Servo Lib, the SoftwareSerial Lib, the EEPROM Lib and the analog read (if there is support) at the moment. After successful tests I'll make dedicated boards for these chips. The idea is to have 6 and 3 servo connectors plus serial or sensor connectors on the boards. All servo positions will be saved in the EEPROM so the user can connect the board to the PC using a FTDI cable and set new servo positions as new moves that are later played back directly on board.

So I am willing to do any tests you can throw at me.
Title: Re: Arduino Tiny
Post by: Coding Badly on Sep 24, 2010, 08:43 pm
Quote
Clicked.

Thanks!

Quote
I plan on using Tiny 84 and 85 at 8MHz

For the next few weeks, my efforts are restricted to the 84 core.  The 85 processor is next.

Quote
for tiny robots

Excellent!

Quote
and I need the Servo Lib

For Servo to work with the 84 processor a minor change must be made to the Servo.cpp source file.  The file is located in the {ArduinoRoot}\libraries\Servo directory.  On line #103 should be this...

SIGNAL (TIMER1_COMPA_vect)

Change it to this...

#if defined( TIMER1_COMPA_vect )
SIGNAL (TIMER1_COMPA_vect)
#else
SIGNAL (TIM1_COMPA_vect)
#endif


Once this change has been tested, I'll ask for it to be applied the official version.

Quote
the SoftwareSerial Lib

I've been using NewSoftSerial (@ 9600 baud) with success.  I'll switch to SoftwareSerial and report back.

Bear in mind that, from the factory, the internal oscillator may not be accurate enough for serial communications.  The oscillator can be tuned (using the OSCCAL register) to be accurate enough.

Quote
the EEPROM Lib

There is a bug in <avr/eeprom.h> that prevents it from working with the 84 processor.  There's a replacement file in the Arduino Tiny download that I belive fixes the problem.

Quote
and the analog read (if there is support)

There is support.  I've tested the three analogReference modes1 and all eight analog input pins.  It all seems to work.

Quote
After successful tests I'll make dedicated boards for these chips. The idea is to have 6 and 3 servo connectors plus serial or sensor connectors on the boards. All servo positions will be saved in the EEPROM so the user can connect the board to the PC using a FTDI cable and set new servo positions as new moves that are later played back directly on board.

Nice!

Quote
So I am willing to do any tests you can throw at me.

Two things need to be tested...

1. tone may not be working correctly.  I need someone to measure the frequency generated.  Ideally with the processor at 1 MHz and 8 MHz.

2. Servo.  I currently don't have the means to test the Servo library with the 84 processor.

Any help you're willing to contribute is greatly appreciated!


1 Be sure to read the datasheet!  The analogReference modes for the 84 processor are a bit different from the 168 / 328 processor.
Title: Re: Arduino Tiny
Post by: mrmeval on Sep 25, 2010, 08:47 pm
ATTiny84 has SPI. I've not seen where one of these has been used with any Arduino yet.

http://www.maxim-ic.com/datasheet/index.mvp/id/2052

MAX3110E, MAX3111E  
Title: Re: Arduino Tiny
Post by: Coding Badly on Sep 27, 2010, 10:12 am
Quote
I'll switch to SoftwareSerial and report back

...testing has not gone well.  

NewSoftSerial works at least to 9600 baud (I haven't tried higher rates).  SoftwareSerial won't work at 2400 baud.  Unfortunately, NewSoftSerial adds almost 2K; SoftwareSerial is considerably smaller.
Title: Re: Arduino Tiny
Post by: mpeuser on Sep 27, 2010, 02:02 pm
SPI
.. is a quite trivial matter. It is a part of 019 now, isn't it? Here a library
http://www.arduino.cc/playground/Code/Spi

NSS
.. can be simplified a little bit, especially when you constrain to a few bit-rates only. It can be re-written using USI. The size of the receive buffer must most likely also be reduced.

I have ordered some 84 chips - I cannot start testing before next week.
Title: Re: Arduino Tiny
Post by: Osgeld on Sep 27, 2010, 03:12 pm
spi lib doesnt work with the 84, as its handled though the USI, course you can bit bang it nearly as fast on any pins you want
Title: Re: Arduino Tiny
Post by: Coding Badly on Sep 27, 2010, 08:59 pm
Quote
NSS.. can be simplified a little bit, especially when you constrain to a few bit-rates only

Trimming the bit-rate tables will help but not by much.

There are a few spots in the SoftwareSerial source where it looks like the person who wrote it assumed the clock would be a specific rate (probably 16 MHz).  I suspect SofwareSerial can be made more reliable with less effort than trying to trim NewSoftSerial.

Quote
It can be re-written using USI

Not for me.  I need PA6 and Timer 1 for tone.

Quote
The size of the receive buffer must most likely also be reduced.

In my case, it can be eliminated!  I'm only sending for debug purposes.

Title: Re: Arduino Tiny
Post by: Coding Badly on Sep 27, 2010, 09:01 pm
Quote
spi lib doesnt work with the 84

Does it need to?  Who's using SPI with an 84 processor?  Please post if you're using SPI with an 84 processor.
Title: Re: Arduino Tiny
Post by: Osgeld on Sep 28, 2010, 12:45 am
im using it to send out to shift registers , but I found it easier to just bitbang pins manually (not digitalWrite) and the speed difference is negligible and I can use any pins I want vs the USI needs to be on the same 2 pins as everything else the USI controls

if you need input, well thats a different ball  
Title: Re: Arduino Tiny
Post by: Coding Badly on Oct 02, 2010, 09:58 pm

I set out to make a smaller core for the '84 processor and ended up with...


In theory, this core is a bit more portable to other Tiny processors than the standard core.

I'm disappointed in the memory savings.  There are some changes that would probably make it bit smaller but the speed increase would diminish considerably.

Which is more important ... Faster or less memory?
Title: Re: Arduino Tiny
Post by: moustic on Oct 06, 2010, 03:22 pm
if you look at this link :
http://code.google.com/p/codalyze/wiki/CyzRgb
in the source code, they have an implementation of i2c master/slave using USI from tiny44 and tiny45.
Maybe it could be usefull for you to make wire library working on tiny.

Title: Re: Arduino Tiny
Post by: Osgeld on Oct 06, 2010, 04:03 pm
hm I am going to say memory because there is always the option to use an external clock and if one uses a oscillator package its only eating up one pin, adding memory not so easy ...

course in a perfect world, both!  ;D
Title: Re: Arduino Tiny
Post by: Coding Badly on Oct 06, 2010, 08:41 pm
@Osgeld:
Quote
im using it to send out to shift registers , but I found it easier to just bitbang pins manually (not digitalWrite)

Would digital*Fast functions be useful to you?

@moustic:
Quote
Maybe it could be usefull for you to make wire library working on tiny.

Do you have a need for the Wire library to work on an ATtiny84 processor?  85 processor?  Any other tiny processor?

@Osgeld:
Quote
hm I am going to say memory because there is always the option to use an external clock and if one uses a oscillator package its only eating up one pin, adding memory not so easy ...

Good point.  Also, there seem to be more posts about "I'm out of memory" than "My application is too slow".  It seems that most "too slow" applications can be sped up using a different design.

Quote
course in a perfect world, both!  

Well, so far I've managed a bit of both.   :D
Title: Re: Arduino Tiny
Post by: moustic on Oct 06, 2010, 08:50 pm
I'm trying to have a I2C clock working with a tiny85.
I found this web site with this code.
I don't use it in arduino env, but I think It should be really easier if I could use arduino environement and librairies to develop on my tiny.

a great usage for tiny and i2c is to pilot an RGB led. (like BlinkM )
Title: Re: Arduino Tiny
Post by: Osgeld on Oct 06, 2010, 09:51 pm
Quote
Would digital*Fast functions be useful to you?


probably not enough to go out of your way for them, but if you want them I am not going to stop you

Title: Re: Arduino Tiny
Post by: msproul on Oct 06, 2010, 11:34 pm
I also have a version of the Arduino core files that work with many many chips including the tinys

http://www.arduino-avr.com

Mark
Title: Re: Arduino Tiny
Post by: Coding Badly on Oct 06, 2010, 11:47 pm
Quote
including the tinys

The '84?  I don't see an entry in "pins_arduino.c" for it.

Have you tested tone / noTone on the '45?
Title: Re: Arduino Tiny
Post by: Coding Badly on Nov 22, 2010, 07:44 am

The second Arduino Tiny release is ready...
http://code.google.com/p/arduino-tiny/

Included is a "highly compatible" core for the ATtiny84, ATtiny45, and ATtiny85 processors: most of the functions are very similar or identical to the 0019 core.

New Features...


Caveats...


Please take a moment to click a few checkboxes...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285276725
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285316262
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1289721959

License...
GNU Lesser General Public License.

Comments, opinions, minor harassments, and success stories welcome.
Title: Re: Arduino Tiny
Post by: Coding Badly on Nov 25, 2010, 07:12 am

The next Arduino Tiny release is ready...
http://code.google.com/p/arduino-tiny/

Included is a "highly compatible" core for the ATtiny2313, ATtiny84, ATtiny45, and ATtiny85 processors: most of the functions are very similar or identical to the 0019 core.

Features for 2313 processor...


Notes...

Title: Re: Arduino Tiny
Post by: Senso on Nov 25, 2010, 03:16 pm
You should use ISR for the interrupt service routines and not SIGNAL, because it is deprecated.
Title: Re: Arduino Tiny
Post by: Coding Badly on Nov 25, 2010, 09:53 pm

Thank you for the comment!

The SIGNAL usage in HardwareSerial.cpp is very likely from when it was originally written (2006).  I suspect no one ever changed it simply because there wasn't much motivation.  Why change code that's working?

In regards to the Arduino Tiny core, the first goal was to make a "highly compatible" core.  To accomplish this goal, I tried to change as few things as possible; the code in HardwareSerial.cpp is almost identical to the 0021 version.

Oh, and I forgot to mention in the previous post...

Caveats
Title: Re: Arduino Tiny
Post by: Osgeld on Jan 24, 2011, 01:51 am
does this work with 16MHZ clocked tiny's?

[edit]in 22 it tosses up some errors about the delay function(s) not being set to use 16MHZ (or something, I will get details later) in 19 it came up with a bunch of compile errors due to serial, removing the serial functionality it will compile, but I have not exactly tested yet, 16MHZ attiny84 btw[/edit]