ATtiny84 Programming Tutorial & Specs

发布人是

Arduino boards like the Nano and the Uno present a number of exciting opportunities and are extremely easy to program, at least as far as embedded systems go. At some point, however, you realize that there are a lot of components and functionality on these dev boards you don’t necessarily need for every project. In many cases, you could even make do with a single chip, like those in the ATtiny line. We went over getting started with the ATtiny85 here, which is an extremely popular option for low pin-count tasks. However, with just 5 I/O pins—6 if you employ the reset—its capabilities are not enough for many projects.

Of course, the ‘85 isn’t the only chip in the ATtiny line, and for more capabilities, at roughly twice the physical size, the ATtiny84 could be the perfect solution. The device is still very small, and can run without an external oscillator, but has 14 total pins instead of the 8 on the 85. This works out to 12 total I/O pins, one of which is normally used as a reset.

ATtiny84 Pinout & Specs

If you’ve spent any time with the ‘85, the ATtiny84 spec sheet should be quite familiar. Highlights include:

·      8K Flash, 512 Bytes EEPROM, and 512 Bytes of SRAM

·      Claimed data retention of 100 years at 25°C (a rather comfortable 77°F).

·      Speed is spec’d at up to 20MHz (with an external oscillator)

·      ‘V’ variation can run at as low as 1.8V, using just 300µA when set up to run at 1 MHz clock speed.

·      Low-voltage sleep mode—as discussed here in the context of Arduino boards—is even more amazing, allowing it to exist at a mere .1µA until needed.

In fact, other than the states under “I/O and Packages” which reads as: “Twelve Programmable I/O Lines,” you’d have a hard time telling between this chip’s documentation and the smaller ‘85, with its mere 6. More I/O is obviously a huge advantage, but does come with a volume penalty if you’re trying to construct your newest ultra-tiny masterpiece.

ATTiny84 vs. ATTiny44 & ATTiny24

One thing that may be slightly confusing the first time you look at a spec’ sheet is that it lists specs for the ATtiny84, 44, and 24 (in the same manner as how the ATtiny85 is combined with the 45 and 25). Here, the first number signifies how much Flash memory each variation of the chip has. This and other differences are listed sequentially, separated by “/” characters.

Expense-wise, the difference between the three is, literally, nickels and dimes. One would be best served to just fork over the extra quarter for the ‘84 when experimenting, and save yourself some potential headaches during the process. However, when it’s time to produce thousands of a new invention, saving a few cents looks more attractive. You can find the ATtiny44 here, as well as the low-end ATtiny24 here.

Programming ATtiny84

ATtiny84 Programming Image 2 ATtiny84 Programming Image 3

Once you’re sold on the idea and get one of these little chips in your hand, how do you program it? The initial steps in the process are the same as for the ATtiny85, so follow steps 1-3 in the piece linked at the beginning of this article. When you get to the Processor option in step 2, however, select ATtiny84. Depending on the programmer you’re using—or Arduino board if you’re using one as an ISP—you likely won’t have a convenient socket to plug the ‘84 into. You’ll instead need to construct one out of a series of jumpers. Connect the programmer’s VCC, GND, MOSI, MISO, SCK, and RST pins to the corresponding connections on the ATtiny84, using the figure below:

ATtiny84 Programming Image 4

Once your programmer is properly connected to the ATtiny84 and plugged in via USB, open up the Arduino IDE example Blink sketch. Change LED_BUILTIN to 0, as there’s no LED wired into the ATtiny84 processor by default, then press Ctrl+U to upload. If you haven't yet, make sure that USBtiny ISP is selected as the programmer under Tools. Presuming everything is connected correctly, your program should upload without complaint.

ATtiny84 Programming Image 5

To test if it’s working, plug an LED up to ground and pin 0 with the appropriate resistor, and observe it blinking. Note that 0 here will be physical pin 13—not pin 2 as depicted in the counterclockwise ATtiny84 pinout in the above figure. Your device will then blink happily along, setting the stage for more advanced experimentation. Perhaps you could make an LED scanner as depicted in the ATtiny85 article, but instead of 5 LEDs, you take things up to 11… or 12 if you want to utilize the reset pin.

ATtiny84 Programming Image 6

ATtiny84 Programming Image 7

That, however, is left as an exercise for the reader. Of course, whatever chip you choose, you could always use programmable LEDs, so blinking more LEDs isn’t exactly novel. What’s exciting about the ATtiny84 is how many other things you could control or take input from. Eleven pins open up a world of possibilities. And if chip size is a still a concern, consider that what’s pictured here is the “large” ATtiny84-20PU DIP version. Other versions featuring a SOIC, QFN, and even BGA footprint are available to save you even more room, though these will require a PCB for implementation!

最新消息

Sorry, your filter selection returned no results.

请仔细阅读我们近期更改的隐私政策。当按下确认键时,您已了解并同意艾睿电子的隐私政策和用户协议。

本网站需使用cookies以改善用户您的体验并进一步改进我们的网站。此处阅读了解关于网站cookies的使用以及如何禁用cookies。网页cookies和追踪功能或許用于市场分析。当您按下同意按钮,您已经了解并同意在您的设备上接受cookies,并给予网站追踪权限。更多关于如何取消网站cookies及追踪的信息,请点击下方“阅读更多”。尽管同意启用cookies追踪与否取决用户意愿,取消网页cookies及追踪可能导致网站运作或显示异常,亦或导致相关推荐广告减少。

我们尊重您的隐私。请在此阅读我们的隐私政策。