0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
PGM-11801

PGM-11801

  • 厂商:

    SPARKFUNELECTRONICS

  • 封装:

    -

  • 描述:

    ATtiny45, ATtiny85 - Programmer

  • 数据手册
  • 价格&库存
PGM-11801 数据手册
Page 1 of 10   Tiny AVR Programmer Hookup Guide CONTRIBUTORS: JIMB0 Introduction Arduino is awesome. The boards are solid, the programming language and IDE are easy, and the community is awesome. But for a lot of electronics projects, an Arduino is overkill. If you’re just blinking a few LEDs, and reading a single sensor, you can get the job done smaller and cheaper using a simple IC, like the ATtiny85. Our hero! The ATtiny85. Unfortunately, the ATtiny85 doesn’t have a well-known, ubiquitous development platform like Arduino’s Uno or Leonardo. And 8kB of program space doesn’t leave much room for a bootloader, so an extra programmer is usually required. On top of that, standard Arduino doesn’t support the chip. That doesn’t mean programming the ATtiny85 in Arduino isn’t possible, though! Enter the Tiny AVR Programmer… Page 2 of 10 The Tiny AVR Programmer is a general AVR programmer, but it’s specifically designed to allow quick-and-easy programming of ATtiny85’s (as well as 45’s). It has an on-board socket, where the little 8-pin IC can be plugged in and directly programmed. No messy wires or soldering required! Once you’ve programmed the ATtiny85, just remove it from the Programmer, and stick it into a breadboard or prototyping board. The Tiny AVR Programmer can also be used as a general purpose AVR programmer. It can directly program almost all AVR’s (including the ATmega328 and ATmega32U4) whether they’re on Arduino boards or in a breadboard. Covered In This Tutorial In this hookup guide, we’ll show how you can program ATtiny85’s using the Tiny AVR Programmer and Arduino. We’ll cover everything from driver installation to Arduino programming tips. Required Materials In addition to the Tiny AVR Programmer, you’ll also need the following items to follow along with this tutorial: • ATtiny85 – To be programmed by the programmer. • A computer or laptop with: ◦ A free USB Port. A USB hub should work too. ◦ Arduino installed. • Optional: ◦ USB Extension Cable – If your USB port is out of reach, this may help make the Programmer easier to reach. Suggested Reading • Installing Arduino – You’ll need Arduino installed for the Programming in Arduino section of this tutorial. There is an ATtiny85 addon for Arduino, which enables you to program the tiny AVRs in the familiar Arduino interface. • Integrated Circuits – This tutorial goes over the basic concepts of integrated circuits. The little black chips that the Tiny AVR Programmer is designed to program. • Polarity – Specifically the Integrated Circuits section. You should know all about IC notches and dots. Board Overview The image below provides a quick overview of the components on the Tiny AVR Programmer: Page 3 of 10 The “brain” of the Tiny AVR Programmer is an ATtiny84 (not to be confused with the 85), – the 16-pin surface-mount chip – which comes preprogrammed with some firmware that makes it look like an AVR programmer. Unless your writing custom AVR ISP firmware, you shouldn’t ever have to mess with this chip. It’s a black box. Program data comes into it from your computer, over USB, and it spits out the proper sequence of bytes to load that program into your ATtiny85. In this tutorial, we’ll mostly concern ourselves with the components on the right half of the board. The ATtiny85 programming socket, pin 0 LED, and prototyping pins. ATtiny85 Socket and Prototyping Pins The socket and the pins broken out to the sides are what make the Tiny AVR Programmer unique. The 8-pin socket fits both the ATtiny85 and the ATtiny45 DIP packages. Just plug your IC-to-program into this socket, and a-programming you will go! A Tiny AVR Programmer with an ATtiny85 inserted. When plugging your ATtiny into the socket, take note of the notch on both the socket and the white silkscreen on the PCB. This should match the polarity of the ATtiny85. Usually the ATtiny85 has a dot next to pin 1 of the IC, this should be placed up towards the notch. The +, -, and numerical labels on the side of the socket reference the pin numbers and voltage supply inputs of the ATtiny85. These pin numbers can be called in the Arduino IDE as we’ll show later in this tutorial. The 4-pin headers on either side of the socket help for prototyping the ATtiny85 out to external circuitry. You can easily plug male jumper wires into these pins, which can be routed to breadboards or other prototyping circuits. An ATtiny85 being prototyped out to a potentiometer (analog input), button (digital input), and RGB LED (analog/digital output). Finally, there’s an on-board amber LED connected to pin 0 of the ATtiny85. This is super-helpful when you’re uploading the “Hello, world” blink sketch to an ATtiny85. Page 4 of 10 That covers the fundamental stuff on the Tiny AVR Programmer. If you plan on doing more advanced stuff with the board, or just want to know more, feel free to read on. Otherwise, skip ahead to the next page. Output Programming Pins The Tiny ISP Programmer is not limited to ATtiny85’s. It’s a full-fledged AVR programmer. This row of six pins can be connected to other AVRs via the standard 2x3- or 2x5-pin ISP headers. You could, for example, connect these pins to your Arduino Uno, Leonardo, etc. to re-flash a bootloader, or upload code using a programmer. Refer to the pin labels in the image above if you’re connecting the Tiny AVR Programmer to another AVR chip. Most AVR development boards break out either a 2x3 or 2x5 programming header, which have the following pinouts: Just match up the labels on the Tiny Programmer to the pins on your AVR board/chip, and get ready to program! The Jumpers There are two jumpers on the top side of the Tiny AVR Programmer: one is labeled RST and the other is VCC. Both of these jumpers affect the unpopulated 2x3 ICSP (in-circuit system programmer) header in the middle of the board. Unless you’re planning on reprogramming the on-board ATtiny84, these jumpers and pins can generally be ignored. The VCC jumper is normally closed. It controls the flow of power to the VCC pin on the ICSP header. When closed, power from USB will flow to the ICSP header. When open you’ll need to supply power externally to that pin. The RST jumper is normally open. When closed, this jumper connects the ATtiny84’s reset pin to the to the 2x3 programming header. If you ever need to reprogram the ATtiny84 (which, for standard use cases, you shouldn’t), you’ll have to close this jumper to enable programming it. Enough talk. Let’s start using the programmer. On the next few pages we’ll cover driver installation (for Windows users) and show how you can use the Tiny AVR Programmer to program an ATtiny85 in Arduino. Driver Installation Before you can start using the Tiny AVR Programmer, you may need to set it up on your computer. If you’re using a Mac or Linux machine, you don’t need to install drivers. Just plug the board in, and skip to the Programming in Arduino page. If you’re using any version of Windows, you’ve got a few steps to follow before you can join your Mac/Linux comrades. Further to that, if you’re using Windows 8, before you can install the drivers you’ll need to disable driver signature enforcement. Check out our Disabling Driver Signature on Windows 8 tutorial for help with that. Step 1: Plug the Programmer In Page 5 of 10 To begin, locate an empty USB port on your computer, and plug the Tiny AVR Programmer into it. You’ll probably want to have the programmer close by. If you’re using a PC, or your USB ports aren’t close by, a USB Extension Cable might help get the programmer into a more convenient spot on your desk. Step 2: Wait for Windows to Automatically Fail/Succeed After plugging in your Tiny AVR Programmer, Windows will try to look for a driver that matches it. Keep an eye on the notification area in the bottomright corner. Wait for Windows to try to install the driver on its own. There’s a chance that, after searching, Windows will find the driver. If you get a Device driver software installed successfully notification (lucky you!), you can ignore the next few steps. But, if you got something like this: Continue on to step 3… Step 3: Download the Driver If Windows couldn’t find the driver for you, you’ll need to download it. There are two versions, make sure you grab the one that matches your system: • 32-bit USBTinyISP Driver • 64-bit USBTinyISP Driver After downloading your driver, extract it from the zip folder. Don’t forget where you put it! Step 4: Open the Device Manager To install the driver, you’ll need to first open up the Device Manager. From the Control Panel, go to the System and Security section, click System, and click on Device Manager. (Alternatively you can Run devmgmt.msc). In the Device Manager, open up the LibUSB-Win32 Devices tree and you should find a USBTinyProgrammer with a yellow warning triangle hovering over the icon. Right-click on the USBTinyProgrammer device, and select Update Driver Software… Step 5: Driver Pointing On the Update Driver Software window that appears, select Browse my computer for driver software. Page 6 of 10 On the next window, Browse for driver software on your computer, set the driver search location to the folder you downloaded and unzipped in step 3. The folder should be named something like usbtinyisp_libusbwin32_1.2.1.0: Then click Next, and the driver will begin updating. Shortly after that, though, a Windows Security window should pop up to let you know the driver isn’t “signed”. Click Install this driver software anyway. We promise it won’t damage your computer! Then play the waiting game for a moment, and wait for a happy Windows has successfully updated your driver software window. After closing that success window, your Device Manager should have an entry for USBtiny under LibUSB-Win32 Devices. Programming in Arduino Everyone loves Arduino! The simplified language makes programming AVRs and more complicated microcontrollers incredibly easy. Unfortunately, Arduino doesn’t have any built-in functionality to program tiny AVRs, but that doesn’t mean we can’t add it! On this page we’ll go over all of the steps necessary to enable ATtiny45/85 programming in Arduino, using the Tiny AVR Programmer. Step 0: Install Arduino If you’ve never used Arduino before (where have you been?!), make sure you follow our What is an Arduino? and Installing Arduino tutorials before continuing on. Step 1: Download the ATtiny Addon To add ATtiny’s to the standard Arduino IDE Board menu, you’ll need to add a few files that help define the hardware. The ATtiny hardware definitions are kept in a repository on GitHub. You can download them from there, or simply click on the links below (note: There are different files depending on which version of Arduino you are using): • ATtiny for Arduino 1.0.x • ATtiny for Arduino 1.6.x Extract the ZIP folder, and don’t forget where you put it! Step 2: Move the attiny Folder There should be an attiny folder living within the attiny-ide-1.x.x.zip file you downloaded. Copy that folder and paste it into a folder called hardware within your Arduino Sketchbook directory. If you’re not sure where your Arduino sketchbook is, open Arduino and go to File > Preferences. The Sketchbook location should be the topmost entry in the Preferences dialog. By default, the sketchbook is usually an Arduino folder within your home folder (e.g. C:\Users\userName\Arduino on Windows, or /Users/userName/Documents/Arduino on Mac). Page 7 of 10 If there’s not a hardware folder already in your Sketchbook make one. After placing the attiny folder in there, your directory structure should look a little something like this: Step 3: Open and Configure Arduino Almost to the fun part! Open Arduino. If you opened Arduino in the last step, close it and restart it. Under the Tools > Board menu, you’ll find the effects of the attiny folder. There should be twelve new entires in the board list, which allow you to program ATtiny45’s, 85’s, 44’s and 84’s. Each microcontroller can be set to a variety of clock speeds – internal 1MHz or 8MHz or external 20MHz. If you’re using a bare, previously untouched ATtiny85 select ATtiny85 (internal 1 MHz clock). Be careful selecting here, selecting the 8 MHZ option will only make your sketch run slow, but selecting the 20 MHz option can “brick” your ATtiny. Do not select the 20 MHz option unless you have an external clock attached! Unlike other Arduino boards, you don’t have to select a Serial Port when using the Tiny AVR Programmer. But you do need to select a Programmer. Under the Tools > Programmer menu, select USBtinyISP. Step 4: Plug in the ATtiny Getting close to blinking! When you plug the ATtiny into your Programmer, make sure you get the polarity correct. The small, etched circle on the IC should line up with the “notch” on the Programmer’s socket and silkscreen. Page 8 of 10 To get the IC into the socket, you may need to bend the legs on each side inwards a tad. Step 5: Upload Code! Time for the Blink sketch! The Tiny AVR Programmer has an on-board LED, connected to the ATtiny, which we can use to verify that code on the IC is running. The LED is connected to pin 0 in the Arduino environment. Copy/paste this code into your Arduino window: int blinkPin = 0; void setup() { pinMode(blinkPin, OUTPUT); } void loop() { digitalWrite(blinkPin, HIGH); delay(500); digitalWrite(blinkPin, LOW); delay(500); } Then click Upload just as you would with any Arduino board. The code will compile, and then it should upload insanely fast. That’s the wonders of direct in-system programming for you. If successful, the on-board amber LED should start blinking. ATtiny85 Use Hints The ATtiny85 isn’t your everyday Arduino IC. It packs a lot of punch for its small size, but there are some things it can’t do. On this page, we’ll provide a quick overview of the ATtiny85 as it pertains to Arduino and the Tiny AVR Programmer. Pinout Just like any Arduino board, each I/O pin on the ATtiny85 is assigned a numerical identifier. These pins are documented on the board as well, but you can also refer to the image below if you forget. Each of the I/O pins on the ATtiny85 are capable of digital input and output. Page 9 of 10 Beyond that, some pins have special functionality. Analog Input and Output There are two analog outputs and three analog inputs. Use them just as you would with any Arduino board. Use analogWrite([pin], [0­255]) to do PWM output. This functionality is available on pins 0 and 1. For example: int pwmPin = 0; pinMode(pwmPin, OUTPUT); for (int i=0; i
PGM-11801 价格&库存

很抱歉,暂时无法提供与“PGM-11801”相匹配的价格&库存,您可以联系我们找货

免费人工找货