USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bperrybap
 
Posts: 8
Joined: Thu May 14, 2009 9:42 pm

USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by bperrybap »

I've seen mention of a "V3" USBTinyISP.

There are some very useful things from this very compact
USBasp design that would be nice to incorporate into a next revision of a USBTinyISP.

http://yuki-lab.jp/hw/usbasp/index-e.html

Most notably, how the incoming MISO line to the AVR is handled.
Here is a direct link to the schematic from the above page:
http://yuki-lab.jp/hw/usbasp/usbasp-circuit.png

It appears that the USBTiny is currently level shifting the
MISO input signal to the targets levels instead
of shifting from the targe level to the local AVR chip levels.

The circuit above handles this in a creative way by using the MISO line
as an enable signal to either tri-state the signal fed to the AVR or ground it,
which will essentially level shift it to the AVR levels.

Its also has some readable configuration jumpers and a seperate ISP connecter
to reprogram the on-board AVR chip.

What about limiting the device to a single cable
(6 or 10) and supplying (or charging extra) for a adapter board like
one of these to map it to the other one:
http://www.sparkfun.com/commerce/produc ... ts_id=8508

It might also good to either dramatically lower the values or even
eliminate of the series resisters on SCK and MOSI on the main board
and put them on a mini adapter board for use with the SpokePOV.

One of the other things that I like about the above USBasp design is that
is uses a "mega" part rather than a Tinypart. Mainly for the extra code space
that is available in the mega parts over the Tiny2313 or even the Tiny461/861.

While I admire the simplicity of the 2313 design, I believe it may
limit future functionality because of its code space.
Shifting to a mega based ISP programmer design would allow room for future growth of features
without adding much to the overall cost of the design..
The cost of a Atmega88 is roughly the same as a Tiny861.
Suppose at some point Atmel decides to release the DebugWire protocol.
(I know wishful thinking) but if they did, the mega would have the
extra room needed to add the code to support it.

Also, what about things like changing the ISP USB interface to use HID so that
no special drivers, helper applications, or USB libraries
are needed and the USB programmer simply shows up as serial port using the built in native drivers.
No more libusb.....

The device could also provide different modes of operation to emulate/mimic other ISP devices
or even provide a way to update the internal code over the USB bus.

But to do these types of things, I believe more code space than is provided
by the 2313 will be needed.


So my wants desires for a new "open" ISP design would be:

- update the MISO input level shifting to shift target levels to local AVR levels.
- lower the values or remove the series resisters on SCK and MOSI
- provide an adapter board for SpokePOV users - if they needed.
- provide a 2nd ISP header to reprogram the device.

(wish list)
- switch to a controller with headroom for more code (mega probably makes sense)
- Add readable jumpers for setting features.

Just a few thoughts.

--- bill

User avatar
karlgg
 
Posts: 212
Joined: Sat Dec 27, 2008 2:41 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by karlgg »

One of the things that makes the USBTinyISP nice is the cables for both formats. If you give people the option of buying one type or the other, you risk the pain and heartache of dealing with people that bought the wrong one. Reading the forums, I'm under the impression she deals with enough pain and heartache. Of any changes made, I think that one would be the least helpful, and potentially bothersome.

It's already cheaper than the others (that still only offer one cable)... Trimming a buck-fifty off the thing wouldn't do much but make it marginally "less unique".

As for Tiny v. Mega, how full is the chip now? (I have no idea)

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by adafruit »

im thinking of maybe having 2 formfactors of the next rev. one 'lite' and one 'mega'
the next rev wont be based on the '2313, so worry not!
i dont get the MISO thing tho. MISO is moving around. the avrisp requires target power so i dont think its too big a deal

which reminds me i gotta work on the PCB layout. grumble.

User avatar
bperrybap
 
Posts: 8
Joined: Thu May 14, 2009 9:42 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by bperrybap »

With respect to MISO, I was only looking at it with respect to supporting a low voltage target.
I was noticing that if the target is low voltage it looks like the MISO signal level feeding into the AVR
from the 125 chip will be driven at low voltage as well, whereas the way
it was done on the USBasp board noted earlier, the signal level will always be at the AVR levels because
the buffer chip either drives the signal or tri-states it so it has effectively been
level shifted from the targets voltage levels to the AVR input levels.
The AVR would either need to use internal pullups or have an external pullup on the
MISO input pin.
I also looked at the TI data sheet but didn't see a VIH (max) so maybe the 74AHC125N can
tolerate input voltages greater than its VCC up to 5.5V (VI max).
But perhaps some series resistors between the AVR outputs to the 74HC125 inputs
to protect them as well when it is powered by a low voltage target might not
be a bad idea?


On the changing to a single cable. I was not suggesting having multiple versions of the product
with different cabling options. Still a single product.
But rather than supplying a device with dual cables have a single cable
and supply a tiny adapter board that converts the single cable to the other one.
If the single cable supplied was the 10 pin cable, then the tiny adapter board supplied
would convert from 10 pin (2x5) to 6 pin (2x5). The user could then either install series resistors or jumpers
when soldering up this adapter board so that it works for the POV device or other hardware.
One nice thing about the 10 pin connector over the 6 pin is that the flat cable will have alternating
grounds wires inside the flat cable which should help reduce noise and crosstalk in the cable.
Just kind of thinking out loud.

--- bill

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by adafruit »

umm, the usbtiny does that already. look at the schematic carefully, its a little 'odd' but it is correct

User avatar
bperrybap
 
Posts: 8
Joined: Thu May 14, 2009 9:42 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by bperrybap »

ladyada wrote:umm, the usbtiny does that already. look at the schematic carefully, its a little 'odd' but it is correct
I'm not seeing how the existing circuit is level shifting MISO from the targets VCC levels
to the VCC levels of the 2313.

I could be wrong, but to me,
it doesn't seem to level shift MISO properly based on the schematic I'm looking at
and my understanding of the 74AHC125N: (but perhaps it doesn't matter in real life)

http://www.ladyada.net/images/usbtinyis ... sp2sch.png

Pin 2 on both ISP connectors feed VCC (pin 14) to the 74AHC125N.
When Jumper 3 is not installed the 74AHC125N will be powered
by the target.

Pin 1 (MISO) on the 2x3 and pin 9 of the 2x5 header are fed to
pin 12 of the 74AHC125N which is an input.

Pin 11, which is the output of the signal on Pin 12 on the 74AHC125N
is fed as an input to pin 18 on the AVR as the MISO input.

My understanding of the 74AHC125N is that the output levels are relative
the the VCC supplied to the chip.

So how does this circuit work when the VCC of the target is say 3+ volts
lower than the VCC to the AVR?

I assume that this works because in looking at the 2313 data sheet,
it is very liberal on what constitutes a "1". So even though the logic levels
will be relative the the 74AHC125Ns levels (which are based on the targets VCC)
vs its own, it shouldn't matter as the 2313 will still see "1"s correctly.

But it still looks like it is shifted incorrectly.

Now what about when the VCC of the target is higher than the AVR?
Normally, this shouldn't happen and when it does it will probably be by a very small amount.
However, it looks like AVRs can run with up to 6 volts.
What happens if there is a battery powered target circuit that is powered at 6 volts instead of 5v?

Now it seems the 74AHC125N will be powered at 6v (ok slightly above its rated 5.5V maximum)
but in this case won't the MISO output signal from the signal from the 74AHC125N be feeding
a 6 volt signal into the 2313?

Can the 2313 handle this? The 2313 spec sheet shows a maximum of VCC+0.5v for inputs.

Can't this same target over voltage condition also occur even if the target is running at 5V and the
USBTinyISP isn't receiving a full 5V?
Suppose it is connected to a PC via a long cable and the VCC level
available to the USBTinyISP suffers a voltage drop? Or maybe its plugged into a hub or
laptop that is loaded down and the voltage is drooping a bit.


It looks to me like there is an input signal level mismatch because the 74AHC125N is driving the 2313 input
pin at the target VCC levels.
In the USBasp circuit design, the buffer chip is only driving the AVR input pin when
the MISO signal is low. In that circuit, when the MISO signal is high, the buffer chip does not
drive the AVR input pin at all. It tri-states the output,
so it is allowed to float up to the AVR chips logic "high" level vs being driven at the targets
VCC level.

The USBasp design does not hook up the the MISO signal to the input of the buffer chip.
Instead it hooks up the signal to the output enable, and grounds the input.
This means that when MISO is low, a low is sent to the AVR, and when MISO is high
the buffer chip is tri-stated so that the AVR can use internal VCC and pullups to create the high.

It seems like a better way of doing it as the buffer chip will never
under or overdrive the signal level for a logic "1".

Have I misunderstood something?

--- bill

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by adafruit »

yeah i like the idea of tristating MISO but that could cause some slew issues

on a related note. seriously your posts are way too long! if i need to scroll to read something i usually dont read it

User avatar
karlgg
 
Posts: 212
Joined: Sat Dec 27, 2008 2:41 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by karlgg »

I'm glad you said it. I thought it was just me!

User avatar
bperrybap
 
Posts: 8
Joined: Thu May 14, 2009 9:42 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by bperrybap »

Well my last post was intentionally so long because I was trying to explain
(in great painful detail) as to why I thought the MISO circuit was backwards/wrong
with respect to adjusting input levels since the first 2 attempts
were not understood.

Can't additional slew be handled in s/w if needed?
Just extend the delay before latching the MISO data.

--- bill

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by adafruit »

they probably were not understood cause i spaced out in the middle of reading it (i often read the forums when im really tired) :lol:
ok thats just mean of me. Sorry!
Now that I understand what you mean, I will try it out. It is a good idea!

User avatar
bperrybap
 
Posts: 8
Joined: Thu May 14, 2009 9:42 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by bperrybap »

I understand. I went back and looked at the posts.
They were a bit "war and peace" like.
Maybe it helped a few folks get a good nights sleep that night... :lol:
I do tend to go overboard with technical details.

When using the alternate MOSI design,
I'm not sure how to ever measure the slew rate when internal pullups are used
since you can't really put a probe on those internal resistors....

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by adafruit »

well, you can approximate the capacitive load as maybe 20pF, maybe 10pF (gotta check the datasheet)
then whatever pullup resistor you use, do the RC calculation for Vcc/2

duh! :twisted:

santacruzbob
 
Posts: 1
Joined: Fri Jul 10, 2009 12:41 pm

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by santacruzbob »

I've actually built a "usbmegaisp" style programmer using a mega88p. I'm not using any buffer or anything fancy but I was curious if anyone had worked on modifying the spi code to work with different pinouts. I'm using PD2 as D- with a 1.5k pullup to 5v and PD4/INT0 as D+ with a 1M pulldown. MISO/MOSI/SCK are on their respective pins (PB4,PB3,PB5) while my RST is on PD5. Looking at the code it appeared rather simple but I'm obviously missing something. If anyone has a little advice it's greatly appreciated. Thanks -Bob

User avatar
dparson
 
Posts: 7
Joined: Sat Jan 18, 2014 4:55 am

Re: USBTinyISP V3 ideas. Perhaps even a USBMegaISP?

Post by dparson »

Thanks Bill for this explanation. I just got a USBtinyISP and hoped to use it to do some 3V in-circuit programming and am in the middle of debugging why I'm seeing > 3V from the ISP and it's starting to make more sense. Since it's been 5 years and if you ever see this, did you ever come up with a solution of doing non-5V in-circuit programming with the USBtinyISP?

bperrybap wrote:
ladyada wrote:umm, the usbtiny does that already. look at the schematic carefully, its a little 'odd' but it is correct
I'm not seeing how the existing circuit is level shifting MISO from the targets VCC levels
to the VCC levels of the 2313.

I could be wrong, but to me,
it doesn't seem to level shift MISO properly based on the schematic I'm looking at
and my understanding of the 74AHC125N: (but perhaps it doesn't matter in real life)

http://www.ladyada.net/images/usbtinyis ... sp2sch.png

Pin 2 on both ISP connectors feed VCC (pin 14) to the 74AHC125N.
When Jumper 3 is not installed the 74AHC125N will be powered
by the target.

Pin 1 (MISO) on the 2x3 and pin 9 of the 2x5 header are fed to
pin 12 of the 74AHC125N which is an input.

Pin 11, which is the output of the signal on Pin 12 on the 74AHC125N
is fed as an input to pin 18 on the AVR as the MISO input.

My understanding of the 74AHC125N is that the output levels are relative
the the VCC supplied to the chip.

So how does this circuit work when the VCC of the target is say 3+ volts
lower than the VCC to the AVR?

I assume that this works because in looking at the 2313 data sheet,
it is very liberal on what constitutes a "1". So even though the logic levels
will be relative the the 74AHC125Ns levels (which are based on the targets VCC)
vs its own, it shouldn't matter as the 2313 will still see "1"s correctly.

But it still looks like it is shifted incorrectly.

Now what about when the VCC of the target is higher than the AVR?
Normally, this shouldn't happen and when it does it will probably be by a very small amount.
However, it looks like AVRs can run with up to 6 volts.
What happens if there is a battery powered target circuit that is powered at 6 volts instead of 5v?

Now it seems the 74AHC125N will be powered at 6v (ok slightly above its rated 5.5V maximum)
but in this case won't the MISO output signal from the signal from the 74AHC125N be feeding
a 6 volt signal into the 2313?

Can the 2313 handle this? The 2313 spec sheet shows a maximum of VCC+0.5v for inputs.

Can't this same target over voltage condition also occur even if the target is running at 5V and the
USBTinyISP isn't receiving a full 5V?
Suppose it is connected to a PC via a long cable and the VCC level
available to the USBTinyISP suffers a voltage drop? Or maybe its plugged into a hub or
laptop that is loaded down and the voltage is drooping a bit.


It looks to me like there is an input signal level mismatch because the 74AHC125N is driving the 2313 input
pin at the target VCC levels.
In the USBasp circuit design, the buffer chip is only driving the AVR input pin when
the MISO signal is low. In that circuit, when the MISO signal is high, the buffer chip does not
drive the AVR input pin at all. It tri-states the output,
so it is allowed to float up to the AVR chips logic "high" level vs being driven at the targets
VCC level.

The USBasp design does not hook up the the MISO signal to the input of the buffer chip.
Instead it hooks up the signal to the output enable, and grounds the input.
This means that when MISO is low, a low is sent to the AVR, and when MISO is high
the buffer chip is tri-stated so that the AVR can use internal VCC and pullups to create the high.

It seems like a better way of doing it as the buffer chip will never
under or overdrive the signal level for a logic "1".

Have I misunderstood something?

--- bill

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”