Attiny weekend, I had a tiny bit of time

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Took me a while to get up and running on ATTINY. Set the fuses, code and flash... back to pin manipulation because memory is at a premium.

I'm playing around here to see what you can do with 1K flash this one is about 400 bytes:

All great but I left this one for a few hours and when I came back all the LED were on but no longer flashing... I had 324Ω resistors on them so at 5V and 1.8v fwd, we should only be about 10mA each. The chip has 40mA max per pin. I haven't had a chance to probe it but I'm suspecting that either the chip is unable to handle 20mA or the regulator went bad on the power supply...

All the resistors were very hot (not enough to burn)... about as far as I got.
 

djsfantasi

Joined Apr 11, 2010
6,710
I get about 15mA for each LED load; not 10. Even then, you’re below the recommended 20mA maximum. Another consideration is the total current provided by the ATTiny. The spec is 400mA; I recommend 200mA. But then again, 6 LEDs at 15mA is only 90mA.

You stated you have 324Ω resistors on each LED. An odd value!?!

Have you double checked the resistor values?
 

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
I'm using the Attiny13, 1K flash

from datasheet:
upload_2019-7-15_10-26-0.png

No schematic needed... it's just VCC and ground then the 3 outputs.



I have outputs from pin 5,6,7 going to anodes of LED, they are running two each parallel but each have own resistors.

using this cheapo regulator... it's an AMS1117 5.0 with the filter caps... and a 12V supply.
upload_2019-7-15_10-39-33.png
 
Last edited:

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
I'm having fun with the chip... a little concerned about how robust it is... I plan on using this for a lot of small projects or simple tasks... just need to dial it in. Can't use some of the Arduino short cuts and have to do direct pin manipulation... it doesn't have the overhead in memory.

I may have to change to ATTINY45 or 44, I'm going to need serial communication to decode commands being sent via PWM.
 
Last edited:

djsfantasi

Joined Apr 11, 2010
6,710
I'm using the Attiny13, 1K flash

from datasheet:
View attachment 181724

No schematic needed... it's just VCC and ground then the 3 outputs.



I have outputs from pin 5,6,7 going to anodes of LED, they are running two each parallel but each have own resistors.

using this cheapo regulator... it's an AMS1117 5.0 with the filter caps... and a 12V supply.
View attachment 181725
Thanks for your reply. I’m sure that I’ve duplicated your work, but the good news is that I agree with you. It should work.

Have you ran the power module standalone and see what you’re getting for it’s output? Just to confirm that it’s operating properly.

And I am still wondering if you’ve checked the output resistor values? Your symptoms could be explained by one or more pin outputs with a too small resistor.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Nope haven't had a chance to do anything... it was dinner then getting late last night... stuck at work for now...

I trust the resistors but I'll verify... I am more suspicious of the regulator.

Have you seen them fail short like this? Does it make sense they will just pass current?
 
Last edited:

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Mystery solved the regulator went bad. Haha. Thought it was funny those resistors felt hot passing 10mA. I can measure a short between Vin and Vout. Grrrr cheap friggin regulators. I see what happened my 12v wallwart went bad and is now putting out 19vdc. The 1117 can only take 15V.
 
Last edited:

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Yep verified this morning. programmed a new chip; wallwart is in the trash. Works great. The resistors are staying cool. I need to find the box of 12v supplies my wife made me take out to the garage. I’ll fix the little breadboard supply. The caps tested ok although they are rated for 16v.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
Although I primarily write in C I have found quick and dirty way of
doing low end simple design is to use mBlock, Ardublock, Snap4Arduino.
They all have their advantages/limitations, all produce Arduino code,
all block gui languages drag and drop.

https://forum.allaboutcircuits.com/threads/arduino-to-pc-bridge.159281/#post-1386521

The above allows you to bridge an Arduino to PC, like make a talking DVM for example,
or a data logger. Drag and drop a text to speech block, and use the "say" block,
thats all it takes to speak a phrase or numerics.

mBlock has two versions, one, the older version 3.0, has many Arduino extensions for code
blocks expanding its functionality.


Regards, Dana.
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
1,177
Took me a while to get up and running on ATTINY. Set the fuses, code and flash... back to pin manipulation because memory is at a premium.

I'm playing around here to see what you can do with 1K flash this one is about 400 bytes:

All great but I left this one for a few hours and when I came back all the LED were on but no longer flashing... I had 324Ω resistors on them so at 5V and 1.8v fwd, we should only be about 10mA each. The chip has 40mA max per pin. I haven't had a chance to probe it but I'm suspecting that either the chip is unable to handle 20mA or the regulator went bad on the power supply...

All the resistors were very hot (not enough to burn)... about as far as I got.
Glad you got it working (bad regulator), but the 200mA current max is for the entire IC, both inputs and outputs. Notes 5 & 6 under section 18.1 in the datasheet say that max output for all outputs across IC should probably be limited to about 60mA.

You can run your LEDs at 6-8mA probably without any noticeable difference.
 

djsfantasi

Joined Apr 11, 2010
6,710
Glad you got it working (bad regulator), but the 200mA current max is for the entire IC, both inputs and outputs. Notes 5 & 6 under section 18.1 in the datasheet say that max output for all outputs across IC should probably be limited to about 60mA.

You can run your LEDs at 6-8mA probably without any noticeable difference.
Good catch! I’ve been looking for something like that; at 234 pages or so sometimes specs are easy to miss.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Glad you got it working (bad regulator), but the 200mA current max is for the entire IC, both inputs and outputs. Notes 5 & 6 under section 18.1 in the datasheet say that max output for all outputs across IC should probably be limited to about 60mA.
Good catch!... they should have put the reference next to the first chart... I have 4 LED's on at a time on that program... so it's 20mA per pin and 40mA total... it works fine now. The 324Ω resistors were just handy... I would have used 470 (I have thousands as SMD) but couldn't be bothered to look at my other piles of THT resistors... 10mA isn't bad when it's being fed actual 5V.

Although I primarily write in C I have found quick and dirty way of
doing low end simple design is to use mBlock, Ardublock, Snap4Arduino.
They all have their advantages/limitations, all produce Arduino code,
all block gui languages drag and drop.
the code for this chip doing the 3 channel chase is 140 bytes... I'm avoiding the use of various Arduino short cuts because I'm limiting my memory. This chip would max out doing digitalWrite blink example... but for playing around and quick test, tinkercad.circuits also work well and is online.

This ATTINY is new to me and I'll order some boards with the SOIC adapters, ISCP breakout, PMOS outputs and an onboard regulator for the chip.
 

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Just made and ordered a few of these boards...
4 switched outputs, ISCP, 5v regulator and 1 unswitched I/O
extra header holes to solder pins or wires.
upload_2019-7-16_16-37-50.png
 
Last edited:

absf

Joined Dec 29, 2010
1,947
using this cheapo regulator... it's an AMS1117 5.0 with the filter caps... and a 12V supply.
View attachment 181725
I have a few of those China Made psu for breadboards. The AMS1117 5.0 was burned and destroyed all my TTL chips on the breadboard. I replaced it with a new 1117 but it was also burned a few weeks later.
Now it is sitting in my drawer. I still prefer the reliable 78M05 with a small heatsink.

The 3.3V one was OK as my circuit seldom uses 3.3V

Allen
 

absf

Joined Dec 29, 2010
1,947
Just made and ordered a few of these boards...
4 switched outputs, ISCP, 5v regulator and 1 unswitched I/O
extra header holes to solder pins or wires.
View attachment 181809
Very nice PCB. I like it.:) Did you make extra boards and sell them on eBay?

Looks like the 6 pin header for programming is too close to the DC inputs. Aren't they touching each other when both are mounted?

Allen
 

Thread Starter

Wolframore

Joined Jan 21, 2019
1,748
Not selling these it’s just for personal development of attiny. Tired of stupid breadboards with high resistance and stray capacitance. I plan on using pogos for programming. It should be fine but sometimes takes me 3 tries to get it perfect. I only ordered 5 this time.
 
Top