Programming ATtiny chips

@stuckinsynth I’m using the Arduino IDE 1.05r2. I have not updated my IDE since previous success.

I back ordered the Tiny programmer from Sparkfun this morning, because it looks simpler and I really like 8 pin chips for bit making…

2 Likes

@JackANDJude,

Could also be the issue that your program is too big! Is it bigger than 4 Kb??

And I also still program in 1.0.5. because well… I know that works;)

1 Like

I’ve been quite happy with 1.6.1, but haven’t used it with an AVR programmer … yet!

Great stuff @chris101! You should get an ISP programmer and get some ATTiny chips. You would be amazed how much you can do with an Tiny84 or even the Tiny85. Then you can ditch any excess weight you’re not using and get rid of the Arduino boards, even the Micro, which is small already. Check out http://highlowtech.org/?p=1695. The whole deal is pretty easy if you’ve programmed Arduino before. While you’re at it ATMEL provides FREE samples to “qualified” individuals.

1 Like

Thanks much @Philip_Verbeek, I appreciate your advice. I have tried multiple variations of simple R/C filters, even second-order and inductive type, they provide an accurate read out, but the signal noise my scope reads is totally unacceptable IMHO. A Sallen-Key low pass seems to be the answer, but again just can’t achieve a close unity gain, when I do the math to design one, the end result is impossible. Maybe my calculus is that rusty… The ArduinoBit schematic does look very promising tho, some much for not “cheating”

1 Like

Thanks Ryan! (@StuckInSynth)

Going naked with Atmel chips is definitely in my future. Although there is a HUGE overhead saving, it’s at the expense of ‘Easy’, which is my no. 1 parameter. But I have been thinking a lot about this, especially since I need to make my ‘people counter’ much smaller (… and it will use a bargraph style output.) However, since I do brute-force programming, more output pins are better! :open_mouth:

For example my bargraph+ uses 13 pins. So what are the ‘high pin-count’ chips I should be looking at? I want to use discrete pins, cause support chips intimidate me!

1 Like

@chris101,
Have you considered using a tactswitch to go through the different modes? This will save you some pins. Also an advantage is that you can very easily add more modes to it later etc.

But if you need 13 pins you can go with the ATMEGA328. These are also used in the micro, nano, uno etc. So you will have the same pins available.

PS: Have you seen my colored arena of wires used in the LEGO pinball machine? Sometimes it has its charms, I think;)

3 Likes

Well @chris101, that puts you square out of the most popular of the ATTiny series, being the 45/85, and the 24/44/84 chips primarily. While you can do very cool things with an ATTiny85, it has only three analog or digital inputs and two PWM outputs. The ATTiny24/44/84 lets loose a bit more, with eight general purpose input/output (GPIO) and as the name says, input or output, analog or digital and has a 10 bit ADC. Three more digital input/output, PWM output capability on three set outputs, one digital, two A/D. Another thing that seems assumed is all the extras people describe as “must-have” items, i.e. Crystal or Resonator, associated capacitors and such. These chips do not require anything more than a clean power source connected to VCC and GND. Then can be set to run on an internal 1 Mhz or 8 Mhz clock that will be more than adequate for many applications. There are additional ATTinys in the series, like the 87/167 or the ATTiny43(u) that boast sixteen GPIO, but they are really not all that tiny anymore. In addition, SMD only available, no PDIP like the others. Also, unlike the others, these are really programmed in C/C++ with AVRDude or similar software that is not nearly as friendly as the Arduino IDE. There are easier ways to cut back on pin abuse, like a shift register for a display that can easily control a 16 LED bargraph with just three pins. It also usually ends up simplifying your code and saving memory. You can go on to pretty simple multiplexing to really serious multiplexing using just a few pins also. Who knows, you’ll amaze yourself. Happy to respond to questions when I’m available.

2 Likes

Ryan (@StuckInSynth), you make a pretty good case for going with the smaller chip. Thank you!

And who doesn’t like easier programming? But shift registers and other multiplexing stuff is new to me, but I get that is what I have to learn. Do you have a suggestion for a tutorial?

When using the Arduino IDE to go from programming an Uno to doing proper coding for the ATTiny won’t be too difficult, BTW I like my SparkFun AVR Pocket Programmer, their info website has lots of really good general and specific info for ATTiny. Whichever programmer you choose, follow their tutorial(Again SparkFun) and there are excellent links at the end after you get setup. As far as using registers, I know Instructables had alot if you searched 'shift register seven segment display. Using a bargraph style will also avoid you the pain of converting seven segment numerals into hexadecimal. I think the way they explain simple multiplexing or ‘charlieplexing’ on the Arduino reference/examples page is really the simplest way to get started on that one. I find myself mostly referring to arduino.cc for the vast majority of my own questions. The high/low tech website I gave earlier is most important, it has the software core to modify the Arduino IDE. Happy hunting for now, I’m sure we’ll end up learning something from eachother along the way.

1 Like

Thanks for the assignment @StuckInSynth:wink:

I’ve got some reading to do now, and perhaps a trip to Frys Electronics (where they have a whole array of logic chips, including shift registers) this afternoon.

I am having fun with the ATtiny85 as well, thanks to @Philip_Verbeek. It really ain’t that difficult if you’re used to programming with the Arduino…

3 Likes

@Philip_Verbeek: When things don’t work, I always go back to blink as a system test. Here’s the error I get:
Binary sketch size: 842 bytes (of a 8,192 byte maximum)
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny85
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override

I’m pretty sure anyone here is already aware, but for reference, this sub-forum:

http://forum.arduino.cc/index.php?board=67.0

is all about direct AVR programming.

Good idea indeed.
But i was pointing to an other problem that could occur.

For your problem: I think you already did it, but recheck the connections again? Maybe rebuild it on another breadboard to test. Have you connected the reset pin correctly?
Maybe reburning the bootloader to it?

1 Like

hey @JackANDJude,
I have created some relatively complex projects with a lone AT85, when you put your mind in ‘simplest’ mode, it’s amazing what you can do. So if you want to stick to the '85, do it, from what I understand, the programmer you ordered is pretty foolproof hardware wise. There’s alot of info on the '85 in particular on the Sparkfun website, dig around some and see what you can find. By the way, ATTiny sure did see easier on older version of Arduino IDE, I would keep going with what you have, altough I have no complaints with the new version truly.

1 Like

Yo Ryan, Jude, Philip! ( @StuckInSynth @JackANDJude @Philip_Verbeek )

I just placed an order with Sparkfun for a Pocket Programmer, and a fist full of chips: 2 tiny85s, 2 tiny84s and a 328 (just in case the tinys don’t work out :wink: ) I also got a couple resonators (I’ll switch over to crystals 1) if I need the speed, and 2) if I make a Bit, because resonators contain mercury) and a 28 pin zif socket to hold any of the chips while programming them. I am excited! I’ll come back and crow when my order arrives.

Hello Chris @chris101,
Good work, you definitely won’t be disappointing. From what we’ve talked about so far, the 'Tiny 24/44/84 is probably going to be a mainstay for you. Do some experimenting yourself and see what you think, after you get all setup, if you can discern any difference between the internal clocks, resonators or crystals. Have used resonators to great success in many 328 based projects, but I almost always use the internals on the ATTiny chips. Don’t worry about hooking anything up to get started, just burn the fuse bits to 8 MHz internal and program away. Only just recently decided to use a proper crystal and capacitors on a 328 based synth/sequencer I’m building. Pretty fun stuff I say.
P.S. Any luck with shiftOut() and some 74HC595’s?

Hey Ryan ( @StuckInSynth )

I dug around and was able to get ahold of three shift registers, none of which are 595s. I’ve got 164, 165 and 299 chips. Of those, and according to the descriptions on this page, the 299 seems most similar to the 595. However since I found this instructable, I am gonna start with the 164 - which they describe in the linked article as the “the most basic shift registers out there”. I like basic, and have long been a serial-phobe, so this exercise may just cure me.

If I start with the 8 pin device, I will NEED to do something to … branch out.

I’m also working out the analog side of littleBits over in my op-amp thread. My goal of course, is to be able to make a new bit to submit to the bitlab: the co2 sensor. While the sensor I am using is a simple system like littleBits, there are other parameters I would like to be able to control with the microprocessor, such as air flow, temperature, and pressure (although some of those may be below my threshold of precision.) Air flow for sure though. So controlling/reading several, mostly unrelated, inputs is essential to my application (the tiny85 is practically limited to 5 io pins right?) This means I will need to use a shift register, or use the tiny84 with more lines, or just staying with the ATmega328p that I’m finally getting comfortable with (as an arduino board. That’s why I bought all 3, so I can fall back on my old, parallel ways as needed.)

School will be over in a week and a half, so I will be able to concentrate on this project full time for a few weeks. Until then, I’ll be baby-stepping!

1 Like

WHOOT!!

My ATtiny chips and Pocket Programmer came in the mail yesterday. I battled with wiring it all together correctly (despite the error in the hookup guide about where the marking grove on the ISP socket is located (it’s pointing to pin 3, not one as stated. Demonstrated how hearty these chips are though …)

Anyway, I modified “blink.ino” to use pin 3 instead of 13, and here, the result speaks for itself:

I have a question for @StuckInSynth:
When I set the fuse to 8MHz the sketch runs very slow - about 5 or 10 seconds between blinks. When I set it to 1 MHz, it runs as expected. I suspect this is caused by an anomaly of the delay() function. Any insight?

Shout out to @StuckInSynth @JackANDJude, @Philip_Verbeek, @matthiasmwolf, @syedBits, @alexpikkert

Thanks to you all for your encouragement and help with this. I love this forum! I am ready to try to use this chip in my bitlab project with the people counter.

4 Likes