Coding adjustment for ATTiny13A, Charlieplexed LED Circuit

Go To Last Post
33 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello All, 

 

I have been an electronics hobbyist for several decades. I have recently started working with PIC and AVR MCUs. I used to code Javascript about 20 years ago, I do understand code format but I am by no means a programmer. I am struggling a bit with some code I recently "tweaked".

 

I've breadboarded a project using an ATTiny13A and a 10 segment bargraph LED. The project was originally designed to charlieplex 12 LED with the ATTiny13A using pins 2, 5, 6 & 7 as the outputs. Since I am using a 10 segment display, I adjusted the ASM file to eliminate LEDs 1 & 12. The original code came with 4 different modes, I condensed it down to 1 mode as it is the only pattern I need. The code is for a Larson scanner, (Knight Rider style) and variations of that theme.

 

The code I'm using starts @ LEDs 6 & 7, and sequentially flashes out to the sides of the bargraph. I have successfully altered the code to accomplish this task, but at slower speeds (using 10K Pot.), the effect is lost because the LEDs are not lighting together but sequentially. I was wondering if there was a way to be able to light 2 LEDs at the same time being charlieplexed. It looks choppy sequentially and needs to be a smoother effect. So I'm not sure if there is a timing tweak or a way to have 2 LEDs on at the same time. I would appreciate any help.

 

I have included my circuit schematic, a video of the circuit and code used. I am using Atmel studio 6.2 to edit and program with a MRP01-V1.0 & MRP11-v1.0 ISP USB programmer. All fuses and clock frequency left at default on the ATTiny13A.

 

LSMTO

 

https://youtu.be/buT3FMnBlfw

 

I slowed down the display speed after about 10 seconds.

 

/*********************************************************

 Larson Scanner Charlieplex ATTiny13A

 Software to generate a Larson scanner pattern on 12 LEDs
 Charlieplexing is used in order to control the LEDs with
 only 4 IO ports. One port reads in a voltage. The
 software then changes speed accordingly.

 Uses internal RC-Osc at 9.6 MHz/8
 Fuses should be set to default

 Written by Thomas Frey
 Modified by: MF
 Modded to only use Larson Scanner Mode2, omitted
 Mode0, Mode1 and Mode3

 $Date:$

*********************************************************/

; defines

#define tmp		R16
#define	tmp2		R17
#define duration	R18
#define LED		R19
#define adc_result	R20
#define mode		R21

#include "tn13Adef.inc"

.MACRO LEDon
	ldi	LED, @0
	rcall	setled
.ENDMACRO

.cseg

/*********************************************************

 Interrupt vectors

*********************************************************/
.org 0	rjmp reset

.org	INT0addr     	rjmp reset		;External Interrupt0
.org	PCI0addr   	rjmp reset		;Pin Change Interrupt0
.org	OVF0addr  	rjmp reset		;Overflow0 Interrupt
.org	ERDYaddr     	rjmp reset		;EEPROM write complete
.org	ACIaddr		rjmp reset		;Analog Comparator Interrupt
.org	OC0Aaddr	rjmp reset		;Timer/Counter0 Compare Match A
.org	OC0Baddr	rjmp reset		;Timer/Counter0 Compare Match B
.org	WDTaddr	     	rjmp reset		;Watchdog Timeout
.org    ADCCaddr     	rjmp reset		;ADC Conversion Complete Handle

/*********************************************************

 Initialization

*********************************************************/
reset:

; set stack pointer
	ldi	tmp, LOW(RAMEND)
	out	SPL, tmp

; set clock to 1,2 MHz

	ldi	tmp, 0b10000000
	out	CLKPR, tmp

	ldi	tmp, 0b00000011		; Divide by 8
	out	CLKPR, tmp

; init ADC

	ldi	tmp, (1<<ADLAR)|(1<<MUX1)	; Use ADC in 8bit mode, PB4; Vcc is reference
	out	ADMUX, tmp

	ldi	tmp, (1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0)|(1<<ADEN)	; Slow conversion, ADC on
	out	ADCSRA, tmp

	rjmp	main

; init registers
	ldi	mode, 0

/*********************************************************

 Main loop

*********************************************************/

    main:

    LEDon 6
    LEDon 7

    LEDon 5
    LEDon 8

    LEDon 4
    LEDon 9

    LEDon 3
    LEDon 10

    LEDon 2
    LEDon 11

    rjmp    main

/*********************************************************

	Sub routine:	wait

	Function:	Generates a pause, depending on ADC
			input

	Parameter: none / duration - lenght of the pause

*********************************************************/

wait:
	sbi     ADCSRA, ADSC		; start ADC conversion

wait_adc:
	sbic	ADCSRA, ADSC		; wait for the ADC to finish
	rjmp	wait_adc

	in	adc_result, ADCH

	tst	adc_result
	brne	wait_cont		; not minimum? -> go on

					; else: change mode
	inc	mode
	andi	mode, 0b00000011	; wrap around (four modes only)

wait_endmode:
	sbi     ADCSRA, ADSC		; start ADC conversion

wait_adc2:
	sbic	ADCSRA, ADSC		; wait for the ADC to finish
	rjmp	wait_adc2

	in	adc_result, ADCH

	tst	adc_result
	breq	wait_endmode

wait_cont:
	mov	duration, adc_result
	inc	duration

	ldi	tmp, 0

timer_loop:

	dec	tmp
	brne	timer_loop

	dec	duration
	brne	timer_loop

	ret

/*********************************************************

	Sub routine:	setled

	Function:	switches one LED on and waits

	Parameter:	LED - which LED to activate
			0 means none

*********************************************************/

setled:

	rcall	setport

	ldi	tmp, 250
	rcall	wait

	ret

/*********************************************************

	Sub routine:	setport

	Function:	switches one LED on

	Parameter:	LED - which LED to activate
			0 means none

*********************************************************/

setport:

	clr	tmp

	ldi	ZL, LOW(translation*2)
	ldi	ZH, HIGH(translation*2)

	lsl	LED			; LED * 2 - for LPM instruction

	add	ZL, LED
	adc	ZH, tmp

 	lpm	tmp, Z+
	out	DDRB, tmp

	lpm	tmp, Z
	out	PORTB, tmp

	ret

translation:
	.db	0b00000000, 0b00000000

	.db	0b00000011, 0b00000001
	.db	0b00000101, 0b00000001
	.db	0b00001001, 0b00000001

	.db	0b00000011, 0b00000010
	.db	0b00000110, 0b00000010
	.db	0b00001010, 0b00000010

	.db	0b00000101, 0b00000100
	.db	0b00000110, 0b00000100
	.db	0b00001100, 0b00000100

	.db	0b00001001, 0b00001000
	.db	0b00001010, 0b00001000
	.db	0b00001100, 0b00001000

 

 

Attachment(s): 

Last Edited: Tue. Oct 24, 2017 - 12:41 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Welcome to the Forum!

 

Yes, you can do what you want, but it won't be a trivial change to the code.

 

The concept underlying Charlieplexing is that you actively control both ends of the LED, turning one pin high, and the another pin low, to select a given LED for illumination.

 

So, with the current setup, you can turn one LED on at a time.

 

You have two, (or more), options:

 

You can markedly increase your scan rate, so that although only one LED is actually on at a time, it APPEARS that multiple LEDs are illuminated.

This relies on the persistence of vision.

You need a scan rate fast enough so that the eye can't see the flicker.

This is how many "POV" projects work, and how many 7-seglent LED displays are driven.

 

Option #2:

Use a larger uC with one pin for each LED.

 

Side comment:

I don't see any resistors in series with your LEDs to limit their current.

There have been Threads on resistorless LED driving in the past, but as a general rule this is a bad idea.

 

JC

 

Edit:  Typo

Last Edited: Tue. Oct 24, 2017 - 02:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was wondering if there was a way to be able to light 2 LEDs at the same time being charlieplexed.

I don't think so, but you can turn up the refresh rate to the point where it looks like more than one is on at a time.

This is a charlielplexed display:

charlieplexed 20LEDs on ATtiny11

 

there's a write-up (and even code) here:  https://www.instructables.com/id...

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With N pins, you can drive N-1 LEDs at a time.  Lots of threads about this.  Search them out.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And where did Bill get a Tiny11 from?? surprise I didn't think they were ever released in the wild.

 

Well OK is still have my ICE200 with debug facilities for it. blush

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gentlemen, I do appreciate the replies. I was hoping that a small code change would take care of the issue. I'm afraid that I'm in over my head with these changes, definitely above my pay grade. Looks like I will have to hire someone for the coding. Again, I do appreciate appreciate your time and replies, thank you.

Last Edited: Tue. Oct 24, 2017 - 07:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

westfw wrote:

I was wondering if there was a way to be able to light 2 LEDs at the same time being charlieplexed.

I don't think so

Actually, the answer is: it depends!

 

Because Charlieplexing shares pins between multiple LEDs the will be some LEDs that can be turned on at the same time, and some LEDs that cannot.

 

In the above, you clearly cannot have both LED1 and LED2 on at the same time!

 

 

 

Here, you could have, for example, both LED1 & LED4 on at the same time

 

Images from: https://en.wikipedia.org/wiki/Charlieplexing

 

westfw wrote:
but you can turn up the refresh rate to the point where it looks like more than one is on at a time

That would be the general way to do it.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And where did Bill get a Tiny11 from?? surprise I didn't think they were ever released in the wild.

Huh?  PICList had a group buy back in 2004, when Atmel dropped their price to $0.25 each for "as many as you want, forever." (or something like that.)

Members bought several hundred all together, and there was a community effort to produce a low-cost HV serial programmer and associated software (or rather, one guy developed a programmer schematic and software, and I published a PCB for it.)  http://www.oocities.org/westfw/e... I'm still mildly annoyed that they didn't last long, and that nothing has replaced them at that price point...  I still have a bunch that I haven't used, though - arduino sort-of took over my interests...

 

(hmm.  I vaguely recall Atmel  re-using a part number of a discontinued part for a chip that never shipped, or something like that.   Was that "tiny11"?)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

lsl and Z+ means Z goes 3 bytes forward. Rem lsl instruction and use Z+ plus Z+ (word).

 

lpm data, Z+   ;load port byte<br />
out PORTB, data   ;set port data<br />
lpm data, Z+<br />
out DDRB, data   ;set direction data<br />
rcall ledsOff    ;return pins in hi-Z (blank)

 

 

 

Last Edited: Tue. Oct 24, 2017 - 05:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would suggest you add a resistor (150 ohm) in series with each port pin PB0-PB3 to limit LED current!  Your AVR will thank you.

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PICList had a group buy back in 2004

blush I see Digikey has a full page of the beasties but marked as obsolete and no stock. Must have been the Tiny10 that was never released.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Charlieplexing was invented from MAXIM and need special driver circuits with high current capability on one side and constant current sources on the other.

E.G. the MAX6950 was able to drive up to 320mA, which was unable for typical microcontrollers.

So on a microcontroller you get only very dark lighting or exceed the recommended operating limits dramatically.

So a microcontroller can only light one LED at a time to get reasonable brightness.

The special case to fade from one LED to the next was possible with driving the two patterns in a PWM manner in software.

But the easier way was to use an AVR with more IOs, e.g. ATtiny24 or ATtiny261 to drive all 10 LEDs in parallel.

 

And of course you need always current limiting resistors, because the AVR has no constant current outputs.

 

Last Edited: Thu. Oct 26, 2017 - 07:37 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

danni wrote:
Charlieplexing ... need special driver circuits with high current capability on one side and constant current sources on the other.

No - that's not true.

 

Of course any multiplexing scheme will limit the brightness relative to steady, direct drive. It's nothing specifically to do with Charlieplexing.

 

So on a microcontroller you get only very dark lighting

On a microcontroller, you get exactly the same[1] brightness as you would driving the LED from a pin without Charlieplexing.

Charlieplexing is not the issue.

 

So a microcontroller can only light one LED at a time to get reasonable brightness.

Again, that depends - see #7

 

 

[1] well, OK: because the LED current has to go through two pin drivers, it will be slightly dimmer than driving it direct from a single pin.

 

EDIT

 

Clarify quote

 

EDIT 2

 

Link to Maxim's own description: https://www.maximintegrated.com/en/app-notes/index.mvp/id/1880

 

They also note that Microchip have an App Note - TB029, "Complementary LED Drive" - on it: http://ww1.microchip.com/downloads/en/AppNotes/91029a.pdf

 

And Don Lancaster's August 2001 Tech Musings, "Driving lots of LEDs" -   https://www.tinaja.com/glib/muse152.pdf

 

Last Edited: Thu. Oct 26, 2017 - 09:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't get the same light with Charlieplexing.

Not a problem with a small number of LED's but bigger things it does.

(unless you count on using high current burst).

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:
You don't get the same light with Charlieplexing.

Same as what, exactly?

 

As shown in #7, Charlieplexing is just a matter of connecting the LEDs like this:

 

 

So, when you light either LED1 or LED2 they will be just as bright as if driven from individual pins (but see the footnote in #13).

 

Of course, if you wan both LED1 and LED2 to appear lit at the "same" time, then you will have to "multiplex" between them - so each one is only on for half the time and, therefore, not so bright as driving directly.

 

My point in #13 is that this has nothing specifically to do with Charlieplexing - it is the same for any form of multiplexing.

 


EDIT - Summary

 

  • For lighting a single LED at a time, there is "no"[1] loss of brightness with Charlieplexing
     
  • It is possible for some of the LEDs in a Charlieplexed array to be on at the same time;
    for those specific casesthere is "no" loss of brightness with Charlieplexing.
     
  • In the general case, for LEDs in a Charlieplexed array to appear "on" at the same time requires "time-sharing" - which will, inherently, reduce the brightness.
     

 

[1] To repeat the footnote from #13because the LED current has to go through two pin drivers, it will be slightly dimmer than driving it direct from a single pin.

Last Edited: Thu. Oct 26, 2017 - 12:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And my point is that it goes down fast. 

If you need all combinations of 10 LED's with 4 IO's, there can only be power at any LED 1/10 of the time. (if they all should have the same power).

 

with a 3x4 matrix it's 1/3 of the time.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you need to be able to have any arbitrary combination of LEDs on together, then Charlieplexing is (probably) not the right choice anyhow.

 

If there are only certain combinations required, then it may be possible by careful design.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
If you need to be able to have any arbitrary combination of LEDs on together, then Charlieplexing is (probably) not the right choice anyhow.

 

No problem, if you use the Maxim drivers to do so.

But I prefer the standard multiplexing method, e.g. with the MAX7221, since it makes the pcb easier to route.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So a microcontroller can only light one LED at a time to get reasonable brightness.

Rubbish.  High-efficiency LEDs exist which will run happily and quite bright at 3 mA.  With an N=5 array, one pin will drive as many as 4 LEDs at once, totalling 12 mA.  That doesn't come close to exceeding even the test conditions quoted in almost all AVR datasheets (generally 20 mA).

 

If you need more current than a GPIO can provide, a simple transistor on each GPIO pin will solve that problem.  That is the approach used when driving 7-segment displays with Charlieplexing.  The transistors are required anyway, even for conventional multiplexing, and the duty cycle is also the same.  The cost is literally zero in hardware, and the pins savings can be significant.  You can drive a 7x7seg+DP display with 8 pins instead of 15.

 

I think you need to spend a few minutes searching out any of a number of different threads here on the topic of Charlieplexing over the last couple of years.

 

there can only be power at any LED 1/10 of the time. (if they all should have the same power).

 

Again rubbish.  @sparrow2, we've been over this, haven't we?

http://www.avrfreaks.net/comment/1937731#comment-1937731

The duty cycle of an N=4 Charlieplex array is 1/4.  Where do you get 1/10?

 

Charlieplexing is a multiplexing method.  It's right there in the name.  The very nature of a multiplexed method is that only some elements are on at a given moment.  Human persistence of vision provides the illusion of simultaneous drive.

 

None of this is helping the OP ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I get 10 because of 10 LED's (OP's number).(I would make a state machine with a state for each LED)

 

And if you make 1/N as duty cycle some LED's can be brighter than others (I guess you can avoid it with a resistor at each LED and not just on each IO)  

 

Add: and still I would guess that you could see a difference if an IO had to drive 1 or 2 LED's.

Last Edited: Thu. Oct 26, 2017 - 05:03 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

10 LEDs require an N=4 Charlieplex matrix (as you've noted).  In fact, you could drive as many as 4x3=12 LEDs, but that is not a requirement.

 

With 4 lines, each line could drive 0, 1, 2, or 3 LEDs in any given phase of the scan cycle.  With 4 phases (one for each pin), the duty cycle of each phase is 1/4, not 1/10.

 

While an I/O pin driving 3 LEDs will exhibit a slight voltage drop w.r.t driving 1 (or 0, or 2) LEDs, it is not by much.  OP makes no mention of VCC, but assuming 5V, the t13A has a drive strength while sinking equivalent to an RDS(ON) of about 24 ohms.  If driving a VF=2.0V LED, a 500R resistor will yield an IF of 6 mA.  In reality, due to RDS(ON) of 24 ohms, the real R is 524 ohms, for an IF of 5.73 mA.  Enter a second LED, and the two 500R resistors are effectively in parallel and therefore one 250 ohm resistor, for a total resistance of 274 ohms, and a total I of 10.95 mA, and an IF of 5.47 mA for each LED.  Add a third LED, for an effective parallel R of 167 ohms, a total R of 191 ohms, a total I of 15.73 mA, and IF of 5.24 mA for each LED.

 

So the breakdown for a 2.0V LED and 500R resistors is like so:

# of LEDs IF per LED
1 5.73 mA
2 5.47 mA
3 5.24 mA

 

So yes, there is a >>slight<< difference in brightness depending on the number of LEDs being driven in any given phase of the scan cycle.  However, remember that while the LED's response is more-or-less linear w.r.t. current, the eye's response is logarithmic (much like photographic film).  So while the linear difference between 5.73 and 5.24 mA is nominally a reduction in brightness by 8.4%, this amounts to a reduction of one eighth of one photographic stop.  I challenge you to tell the difference between 0 and -0.125 stops in normal use ;-)

 

If 1/8th stop is unacceptable, then as @danni mentions you can drive each phase through an external switch with lower RDS(ON) (or low VCE(ON)).

 

Yes, you could choose to drive only 1 LED at a time, but that would result in a duty cycle of 10% as you've noted, instead of a duty cycle of 25%.  Now >>that<< you will notice ;-)

 

(I guess you can avoid it with a resistor at each LED and not just on each IO)

Nope.  One resistor per pin, not per LED.  However, current passes through a resistor when sourcing, not when sinking.  This has been covered many times, including here:

http://www.avrfreaks.net/forum/charlieplexing-leds-microcontroller-refresh-rate

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't get the same light with Charlieplexing.

You get (about) the same light as you'd get multiplexing to the same degree.  So if you're comparing a charlieplex scheme that lights one segment at a time of a 7segment display, instead of one full digit at a time through 7 pins and a high-current other-side driver, you're 1/7th as bright.  But that's probably OK, since LED brightness increases in recent years are likely to make up for it!

 

There are some interesting possibilities "in between" - For 10leds you could use 6pins, and drive 5-at-a-time.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 However, current passes through a resistor when sourcing, not when sinking.

This was my missing link (have not worked with this for a while), I was looking at the 3 IO drawing in #7 that is NOT the way to do it!

 

But on the other hand your RDS of 24ohm sounds a bit low.

looking at the tiny13 datasheet the (weak io's), have something  like 30ohm at 5V, 50ohm at 3V and about 100ohm at 1.8 (or 2-2.2V a tad higher than what the LED need so no resistors are needed) .

But a bigger problem is that the tiny13 have two different quality IO's so to make it good perhaps ad a 20-40ohm resistor on the strong IO's (or fiddle with the time on :) )  

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
One resistor per pin, not per LED.  However, current passes through a resistor when sourcing, not when sinking.  

Nonsense!

 

The resistor is in series with the pin; so the current has to go through it - whatever the direction!!

 

 

 

 

EDIT

 

typo!

and quote

 

EDIT 2

 

Sourcing:

 

Sinking:

 

Last Edited: Fri. Oct 27, 2017 - 08:45 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The drawing in #7 is NOT the way to do it !!!

 

One end of all LED's should go direct to a IO (all anodes or all cathodes), so each LED only see one resistor (not two)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
The resistor is in series with the pin; so the current has to go through it - whatever the direction!!

Oh, I see - you're talking of arranging the resistors like this:

 

This is the specific post in the linked thread http://www.avrfreaks.net/comment... - had to scroll quite a long way down to find it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:
One end of all LED's should go direct to a IO (all anodes or all cathodes), so each LED only see one resistor (not two)

Nice one!

 

You should update Wikipedia, Microchip, and Don Lancaster with that!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Well that's a cool animation of charlie confusing :)
Confusing in programming and confusing in routing.
.
MG

I don't know why I'm still doing this hobby

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's  joeymorin that's the master here. But now I get it, (or rather get refreshed my memory ) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

weak io's

The datasheet is 'weak' on details.  My best guess is that there is only one 'low power pin' as they call them, and that is /RESET-PB5 when RSTDISBL is programmed.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PB0 and PB1 are 20mA outputs

PB2 PB3 and PB4 are 10mA

 

PB5 (reset) is not a real output.

 

I guess the those that asked Atmel to make the tiny13 needed a bit extra on OC0A and OC0B, than the rest.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm.  I'd missed that.  I'd seen the drive strength curves and searched for 'low power pins' elsewhere in the datasheet, but found no other references.  Since there lacked a curve for /RESET drive strength, I assumed that's what was intended.

 

I see now the DC characteristics show different VOH/VOL values for PB[4:2] and PB[1:0] (PB5 is still not spec'd for some reason... other datasheets have it).

 

Clearly I've never used a t13/t13a ;-)

 

In any event, the OP is using a t13a.  Here's a comparison:

 

 

The RDS(ON) values for PB[1:0], based on the min/max above rather than on the typical curves, are:

  t13 t13a
5V sink 35 40
5V source 40 50
3V sink 50 60
3V source 50 70

 

The RDS(ON) values for PB[4:2], based on the min/max above rather than on the typical curves, are:

  t13 t13a
5V sink 70 80
5V source 80 80
3V sink 100 120
3V source 100 100

 

 

Note that in all cases the 'typical' curves will be more favourable.  For instance, for 5V sink at 25C, the t13a has a typical RDS(ON) of 24 ohms on PB[1:0], not 40 ohms.

 

I'll stick with the t25/45/85 ;-)

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok I got my numbers from the curves (on a tiny13)