close-circle
Close
0%
0%

T85 Target

A mini Attiny85 target dev board

Similar projects worth following
close
I started this small project after I saw there there weren't many Attiny85 development boards out there. I've went thru several design revisions in an effort to balance functionality/price. The current revision uses a 10-pin ICSP header for using a cheap USBasp without having to use a 10-pin to 6-pin adapter. I also decided to try my hand at some surface-mount components and the current revision uses 2 SMD resistors and a capacitor.

Features:
An LED (because every dev board has to have an LED to blink!) that can easily be connected to PB4 of the Attiny with a jumper

A redundant set of power pins(one with male pin headers, and another with female pin headers) for powering it with a power supply/battery

A DIP socket for the Attiny85 and of course a pin header that breaks out all of its pins.

I set out to do this mini project as I was tired of having to plug in individual wires from my USBasp to program the darn thing. I've done a few revisions, with revision 1 and 2 including a power supply but decided against it for the third revision to save on board space. I'm for the most part happy how the third revision came out in comparison to the first two revisions. I switched to surface-mount components for the resistors and capacitors to save a little on space, it looked nicer to me, and to see how easy/hard surface mount components are to work with.

Getting the surface-mount components soldered proved to not be a difficult task. Previous to the third revision, I avoided using surface-mount components in my designs for fear it would be a nightmare to solder. If anything, this project has made me more open to using surface-mount components.

I made a separate board to mount a 5v regulator on with a barrel jack to make use of the many wall warts that I have laying around. I found this to be a more flexible solution as that can be used for powering other circuits. If anyone is interested in that board, I'll be happy to post that micro project.

  • 1 × ATtiny85-20PU Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × 8-pin DIP socket
  • 1 × .1 uF 1206 SMD ceramic capacitor
  • 1 × 220 ohm 1206 SMD resistor resistor for LED
  • 1 × 10k ohm 1206 SMD resistor pull-up resistor for the attiny

View all 11 components

  • Thoughts on creating yet another revision with a crystal oscillator

    mcu_nerd5 days ago 0 comments

    Yes, I'm mulling over the idea of creating yet another revision.  The problem with getting digital servos to work reliably due to the internal oscillator not being stable enough could be solved using an external crystal but a drawback is that it would consume 2 I/O pins which is a big deal as there are few I/O pins to begin with.  I've seen those 4 pin surface-mount crystal oscillators that would only require 1  I/O pin.  I'm looking for an 8 MHz one that could work at both 3.3V and 5V, so if anybody has any suggestions please be sure to post a comment.

    I've since become more convertible with manual routing traces with more recent projects, so the next revision would have manually routed traces. I would also probably do a ground plane as well. I could change the ICSP header from 10 pins to 6 pins to save board space but I do like being able to plug in my USBasp without needing an adapter.

  • Got extremely close to 50Hz but still not good enough

    mcu_nerd02/12/2017 at 17:24 0 comments

    This is a followup to An update on dealing with Servos post. I wanted to take another shot of getting close to 50Hz as I could in order to actually get my pesky MG90S digital servo to work.

    I decided to calibrate my Attiny85's internal RC oscillator. On page 164 of the Attiny85 datasheet it mentions that Atmel calibrates them at 3V. Mine was running at 5V, so there was room for improvement. I didn't have any really fancy frequency measurement tools, but I did have my EX330 multimeter that has a frequency measurement function.

    The first thing I needed to do was to get the current calibration value as a starting point. The calibration value is stored in the OSCCAL register. The second question was how to read that value from my Attiny85. I could hop into the Arduino IDE and use the software serial library, but that would also mean that I would have to dig out my usb-serial converter.

    A more convenient way that requires no additional hardware is to write the value stored in the OSCCAL register to EEPROM and then use AVRDUDE to dump the EEPROM contents. The subroutine to write a value to EEPROM is very simple (yea I pretty much ripped it off from the datasheet):

    void writetoeeprom(int addr,char data){
    while(EECR & (1<<EEPE));
    EECR = (0<<EEPM1)|(0<<EEPM0);
    EEAR = addr;
    EEDR = data;
    EECR |= (1<<EEMPE);
    EECR |= (1<<EEPE);
    
    }
    

    So now we just place the value from the OSCCAL register into a variable and use the above subroutine to write it to the first byte of EEPROM:

    data = OSCCAL;
    writetoeeprom(0,data);

    After we upload the program which contains the above, we can dump the EEPROM with AVRDUDE:

    avrdude -p t85 -c usbasp -U eeprom:r:text.hex:i

    We then look at our dump file and look at the first byte that comes after ":20000000" and convert that hex value to base 10.

    When I did the above I got a value of 137.

    Next step was to generate a clock signal on a pin. I chose to use PWM to output what's supposed to be a 1Mhz signal on PB4 and ajusted the value of the OSCCAL register untill I got as close as I could get:

    DDRB |=0b00010000; //set pin3 PB4  for output as first step for pwm 0c1b
    TCCR1 |=0b10001011;//set up pwm prescaler
    GTCCR |=0b01100000;//enable pwm 
    OCR1C= 8-1;
    OCR1B=4;
    OSCCAL=131;

    After doing all of that I set PWM frequency back to 50Hz and measured it. It was off by a few hundredths off normally but there was also some jitter. I looked up the digital servo and it failed to work correctly. The darn thing wants 50Hz period not 50.04 Hz or such. An important note that setting OSCCAL to a different value does not permanently change the factory calibration, if the OSCCAL line was removed, it would run at the fectory calibrated value instead.

    In conclusion driving digital servos with the Attiny85's internal RC oscillator is a crapshoot. Having to use a crystal may be the only solution. I went against putting a crystal on my T85 board as that would have taken 2 I/O pins and the the Attiny85 only has 5 I/O pins to begin with (in some circumstances you can use pin 1, giving you six.)

  • Say Hello to Revision 3.1

    mcu_nerd05/31/2016 at 23:17 0 comments

    I assembled up the new board this morning, and so far everything is working great. I moved around some of the labeling to make it easier to read and I flipped the ground and VCC pins on the single row male header to allow one to directly plug in a servo into the board. I would only recommend plugging only micro servos directly into the board, anything larger would most likely require a separate power supply.

    The updated KiCad board files have been posted to GitHub and I've updated the servo demo for use with the 3.1 board. I did take another shot at trying to get my MG90S servo with it, but no such luck; it really does want the PWM frequency at exactly 50 Hz. I did later learn that unlike the SG90, the MG90S is a digital servo which may explain why it's so picky.

    For soldering components on the board I decided to stick to just using .020" Kester 44 63/37 for everything as opposed to using the .020" solder for just the surface mount components and using .032" AIM 63/37 for everything else that I've done on past boards. I got much nicer joints compared to using the .032" AIM solder for the thru-hole parts, I'm not sure if it was due to the diameter difference and/or brand difference.

  • Look at what came in the mail during the weekend

    mcu_nerd05/30/2016 at 13:54 1 comment

    Got these boards in the mail on Saturday. I shall pull out the soldering station tomorrow and assemble one. I'll post the board files once I see that all is well. Happy Memorial Day!

  • Future revision plans

    mcu_nerd05/13/2016 at 15:01 0 comments

    Yes, I will be making yet another revision. Current planned changes include flipping the Ground and VCC pins on the single row male header to allow one to directly plug in a servo into the board. I also plan to flip the labeling on the single row male header to the other side of the board for easier reading.

  • The board not only works with Attiny85 . . .

    mcu_nerd04/13/2016 at 12:44 0 comments

    When I created this board I had the Attiny85 in mind as the Attiny85 has a very nice 8 KB of flash for its small pin count, but it also works with the Attiny45 and Attiny25. It should also work with the Attiny13/13A but it doesn't have PWM available on PB4 so if you want to send a PWM signal to the on-board LED, you will have to remove the jumper and hook the LED to another pin.

    So why would you want to use one of the lower-end Attinys? Price. If you plan to make a product that uses an Attiny that you plan to produce a substantial quantity of and your code is able to fit within the 1 KB of flash/64 bytes of RAM of the Attiny13A it looks quite appealing as the Attiny13A can be had for ~$0.60 USD or less if you shop around.

  • Demo series: RGB LED demo

    mcu_nerd04/11/2016 at 17:46 0 comments

    Today on the demo series is using the Attiny85 to drive a common anode RGB LED. I did this example under the Arduino IDE. I included two versions: A very basic one that just instantly rotates thru a few colors and rgbv2 that makes fade transitions between colors.

    To find these demos, just click on the GitHub reporisotry rank on the project page.

  • An update on dealing with Servos

    mcu_nerd04/06/2016 at 19:47 0 comments

    My servo demo worked fine on SG90 but when I tried it with a MG90S (essentially a metal geared version of the SG90) that I got today wouldn't work right. I hypothesized the reason for the problem was due to the frequency of the PWM signal sent to the servo has being too far off of 50Hz for the MG90S.

    With the Attiny85, I managed to (at least theoretically) get very close to 50 Hz, but not spot on. I pulled out my Arduino Uno, and thanks to it's 16 bit timer I managed to get (a theoretical) 50Hz signal. I hooked up the MG90S to the Uno and it worked perfectly. I took frequency measurements of the PWM signals from the Attiny and Uno using my multimeter and got the following results:

    50.76Hz from the Attiny85

    49.99Hz PWM signal from the Uno

    The PWM signal from the Attiny85 isn't off 50Hz by much but apparently my MG90S wants a practically spot-on 50Hz signal.

    I decided to play with OCR0A value a bit to get closer to 50Hz and managed to get the MG90S to sometimes work with a PWM frequency of 49.5Hz from the Attiny85, but even then, it still tends to act up.

    Lesson learned: Some servos demand a practically spot-on 50Hz signal to work properly.

  • Thanks for the support and stay tuned for a potential giveaway!

    mcu_nerd04/02/2016 at 21:27 3 comments

    A special thanks to everybody that has liked/followed my project. I just found out Hackaday is giving out seed money and so far I've been awarded some, so make that double thanks for the likes/skulls!

    This has me thinking about doing a board giveaway later on this year as a way to give something back to the community. The winner(s) would get a board either assembled or in kit form (whichever form the winner(s) would like to receive it in) and I'll probably throw in a USBasp.

    Again, I'm still taking suggestions for a 4th revision of the board.

  • Demo series: Servo Demo

    mcu_nerd03/26/2016 at 16:11 0 comments

    I'm thinking about starting a demo series of sorts. Every so often I'll post a demo project to demonstrate what all can be done with the Attiny85. The Attiny85 isn't exactly the mcu that has every feature under the sun, but it's surprisingly useful even though it only has a few I/O pins.

    I thought I would post my demo code for controlling a cheap SG90 servo motor. It uses pin 6 to generate a PWM signal that is fed into the signal input of the servo. The code is posted in the demos folder on the GitHub page.

    Again if anybody has any suggestions for a 4th revision, please feel free to let me know.

View all 10 project logs

  • 1
    Step 1

    Start off with soldering the surface-mount components first (recommend using .020" diameter solder.) Solder the 10K ohm resistor on R1, the 220 ohm resistor on R2, and the .1 uF capacitor on C1.

    Of course, solder the rest of the components to the board.

  • 2
    Step 2

    For cleaning, use 91% (or higher) isopropyl alcohol and a toothbrush (or some other clean non-metallic brush.)

  • 3
    Step 3

    Check for any short circuits after the board is dry.

View all 5 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates