ATTINY85 SMD running slower than IC

Thread Starter

MikeyFTL

Joined Dec 20, 2021
10
I've uploaded the BLINK example code to both an ATTINY85 IC and an ATTINY85 SMD but the LED blinks slower on the SMD version. I uploaded the code exactly the same way for both so I have no idea why this is happening. I've burned bootloaders, tried uploading at both 1 and 8mhz, but the SMD always runs slower. I've tried multiple chips with the same results. Does the ATTINY85 SMD need to be programmed differently or am I missing something?

The part number for the SMD is ATTINY85-20SU, but I've seen multiple versions of the ATTINY85 SMD sold on Digikey and Mouser. Do they all work the same or do I need to look for a certain version that will run the same speed as the IC?
 

Attachments

Papabravo

Joined Feb 24, 2006
21,159
I've uploaded the BLINK example code to both an ATTINY85 IC and an ATTINY85 SMD but the LED blinks slower on the SMD version. I uploaded the code exactly the same way for both so I have no idea why this is happening. I've burned bootloaders, tried uploading at both 1 and 8mhz, but the SMD always runs slower. I've tried multiple chips with the same results. Does the ATTINY85 SMD need to be programmed differently or am I missing something?

The part number for the SMD is ATTINY85-20SU, but I've seen multiple versions of the ATTINY85 SMD sold on Digikey and Mouser. Do they all work the same or do I need to look for a certain version that will run the same speed as the IC?
Tha answers you seek are in the respective datasheets. As you may be aware ATTINY 85 IC is NOT a definitive and unambiguous part number that would help us to help you answer the question. If you provide links to the respective datasheets for the two parts we might have some chance of helping you.

EDIT: I can't find a datasheet for ATtiny85-20SU, so now I'm at sea as well. The available packages appear to be an 8-pin SOIC and a 20-pin QFN. Which one are you talking about? Details matter.

EDIT2: Found it. The ATtiny85-20SU is a 20 Mhz. part in an 8S2 package, which is a surface mount package. They do NOT all work the same! Datasheet here:
https://ww1.microchip.com/downloads...iny25-ATtiny45-ATtiny85_Datasheet-Summary.pdf

Now if you can point us to the other one we might be able to help
 
Last edited:

Thread Starter

MikeyFTL

Joined Dec 20, 2021
10
Tha answers you seek are in the respective datasheets. As you may be aware ATTINY 85 IC is NOT a definitive and unambiguous part number that would help us to help you answer the question. If you provide links to the respective datasheets for the two parts we might have some chance of helping you.

EDIT: I can't find a datasheet for ATtiny85-20SU, so now I'm at sea as well. The available packages appear to be an 8-pin SOIC and a 20-pin QFN. Which one are you talking about? Details matter.

EDIT2: Found it. The ATtiny85-20SU is a 20 Mhz. part in an 8S2 package, which is a surface mount package. They do NOT all work the same! Datasheet here:
https://ww1.microchip.com/downloads...iny25-ATtiny45-ATtiny85_Datasheet-Summary.pdf

Now if you can point us to the other one we might be able to help
Thanks for the fast reply. I had no idea they worked differently.

You are right though. The 8-DIP (ATTINY85V-10PU) is 10mhz and the 8-SOIC is 20mhz. I mistakenly thought the mhz was their max speed and that all simple code would run at the same speed across the ATTINY85 family.
 

Papabravo

Joined Feb 24, 2006
21,159
Thanks for the fast reply. I had no idea they worked differently.

You are right though. The 8-DIP (ATTINY85V-10PU) is 10mhz and the 8-SOIC is 20mhz. I mistakenly thought the mhz was their max speed and that all simple code would run at the same speed across the ATTINY85 family.
Now you can look at section 20.2 in the datasheet to understand the three fuse bytes. One of the bits will select a clock prescaler. The other section to read and understand is section 5.0 on "System Clock and Clock Options". By reading the "Signature Bytes you can distinguish which ATtiny85 you have and adjust your code to account for the differences.
 

MrChips

Joined Oct 2, 2009
30,720
I have not examined the datasheet in great detail.
However, be aware that many MCUs have selectable clock speeds.
A common feature is the MCU is capable of running on an internal RC oscillator at 1MHz.
By selecting internal fuse bits you can change the clock to a different frequency such as 8MHz.
You can also select external components such as an external XTAL or external oscillator.

Check your fuse settings.
 

DickCappels

Joined Aug 21, 2008
10,152
@MrChips is probably on the right trail.

Specific things you can check:
Did you set the fuse bits the same on both chips? Do you have the same oscillator setup (XTAL, Internal RC , external clock), Same clock prescaler, same crystal if one is being used)
 

MrChips

Joined Oct 2, 2009
30,720
Here are the Fuse Low Byte options and Clocking option for Atmel ATtiny85.
The default clock is 8MHz RC internal oscillator.

page 25
ATtiny85 Clock Option.jpg

page 149
ATtiny85 Fuse Low Byte.jpg
 
Top