ATtiny861 with Arduino IDE?

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
seedjar
 
Posts: 42
Joined: Wed Feb 02, 2011 3:25 pm

ATtiny861 with Arduino IDE?

Post by seedjar »

I was attracted to the analog inputs of the ATtinyX61 series and got a handful of t861s for an instrumentation project some time back. After a lot of practice with Arduino and the 328 I kind of halfway understand ISP, fuse configuration, etc., but now that I've found this rail of t861s I've hit a bit of a roadblock. I've been programming 328s with ArduinoISP (and Nick Gammon's programmer, since I had to start with an Uno SMD) but neither method is working with the tinys.

Gammon's programmer wasn't a surprise - I didn't expect it to work because I know it doesn't target my model, but I was hoping I could at least get some serial communication going. Trying to burn via the Arduino IDE fails consistently, but occasionally gives different error messages (similar to when I was trying to program my 328s without a proper clock signal, but who knows.) The usual failure looks like this:

Code: Select all

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x14

avrdude: stk500_getparm(): (a) protocol error, expect=0x14, resp=0x01
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x10
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): unknown response=0x12
I have these tools available for programming:
- SMD Arduino Uno
- Bus Pirate v3
- FTDI Friend v1.2
- Numerous breadboard 'duinos (not Boarduinos, unfortunately - I'm on a shoestring budget)
I DON'T have any of these: (and so far, it's caused complications)
- Real ISPs
- Crystals/oscillators (though I could fake some with 555s, I hear)

I've found some cores for the t861, and from here I'm going to try to get the hang of using the Bus Pirate or FTDI Friend, maybe the command line tools if I'm feeling brave. But if anybody has some tips/tricks for me, that would be great. In particular I wonder if I'm not providing a clean enough clock signal or power to the chip. I don't have any caps on, and I'm just using one of the XTAL pins (tried both alone, but not sure how to wire it to provide the proper signal on them together.)

Thanks,
~Joe

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATtiny861 with Arduino IDE?

Post by adafruit_support_mike »

I haven't worked with the '861s so I don't have any specific information about programming them. Your best bet would probably be to dig through the datasheets and see if those give you any useful information.

As a worst-case scenario, Atmel's AVR Dragon should be able to program anything they make, and sells for about $50.

WRT the timing, I wouldn't try using 555s for the Xtal signals. It might work, but that would be an "in spite of" rather than a "because of" situation. You also need to use both pins for the external clock.. the crystal or resonator has to sit between the pins, with a couple of capacitors tied to GND.

You shouldn't need an external clock to program the chips though, and you should be able to make the chip run from an internal oscillator.

User avatar
seedjar
 
Posts: 42
Joined: Wed Feb 02, 2011 3:25 pm

Re: ATtiny861 with Arduino IDE?

Post by seedjar »

Gotcha, thanks. It didn't make sense to me that the chip would be so finicky while being programmed by another device, so that jives with my intuition. I've decided to take some time to learn avrdude. But I'll also grab a real programmer the next time I have the opportunity and I guess reading the datasheet is an inevitability (as much as I'd like to hide from it.)

As for the operation of the crystal, I understand the normal wiring when proper parts are available. But I've also used variants of the "Arduino as ISP" sketch to program chips, where one (and only one) of the XTAL pins is provided a signal by the 'duino doing the programming. And I've seen discussion of using a jury-rigged oscillator (not that you would normally want to; most mentions admit poor timing and unpredictable performance.) 555s would be the extreme case; the more common method seemed to be sharing the clock signal from another AVR. I'm just unclear on what's going on inside the crystal so I don't know how to approach the task. I guess it's another question for the datasheet.

~Joe

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: ATtiny861 with Arduino IDE?

Post by adafruit_support_mike »

If you're using an external crystal, the crystal itself acts like an extremely selective filter. There's a simple inverting op amp inside the chip that sits in parallel to the crystal, making it act more or less like any other tuned-frequency oscillator. The main difference is that crystals are incredibly selective about the frequencies they pass.. +/- maybe 30Hz at a few MHz of base frequency.

To make the oscillator work, you need to use both the 'clock in' and 'clock out' pins on the microcontroller.

Some Atmel chips have a separate 'clock in' function that accepts pulses from some other source. That assumes you have a complete oscillator running somewhere else and are just accepting pulses from there. Again, that's an item that will be covered in the "Clock Sources" section of the datasheet.

HillOrStream
 
Posts: 1
Joined: Tue May 27, 2014 2:06 pm

Re: ATtiny861 with Arduino IDE?

Post by HillOrStream »

I too would like to find information on programing the x61 series of chips, especially with the Arduino as an ISP.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”