[dorkbotpdx-blabber] Designing a Parallel-to-USB Converter

Greg Grunest greg at grunest.com
Wed Feb 25 19:02:29 EST 2009


Nice schematics.  Looks like a cool project.

A couple of questions / suggestions:

1) I see an inverter on the strobe line of the parallel port.  I don't see
it on the eagle layout.  Maybe I'm looking at the wrong one.

2) You're using an edge triggered device (the 374) for a parallel port
application. You said you had it prototyped.  Try dropping in a 373 instead
and take out the inverter (74LS04) on the strobe line.  The 373 is level
triggered.  If for some reason you run long distances with your parallel
cable or through a parallel switchbox the increased impedance in the cable
can cause the strobe signal to rise too slow causing edge triggered devices
(the ls374) to kind of "hang" in the middle and oscillate creating a huge
amount of system noise and rendering the data in the latch unusable.  If you
try the ls373 instead, it should work and not require the inverter (and
doesn't have the noise issue).  All your software should be the same.  
(I know from experience that a 373 will work through 50 ft of parallel cable
with a 3-way switchbox in the middle and a 374 wont.)  Really though, I'd
only change this if you have a distance problem or if you need to get rid of
an inverter.

3) Depending on what your final application is, some software (none I ever
wrote.  BAD PROGRAMMER, BAD!) *will* actually use the NACK and BUSY signals.
You might tie them into unused ports on the AVR chip and that way in the
future you could implement them in software if needed.  

4) No support for bidirectional parallel ports??  SHAME!  :)

-greg


-----Original Message-----
From: dorkbotpdx-blabber-bounces at dorkbot.org
[mailto:dorkbotpdx-blabber-bounces at dorkbot.org] On Behalf Of Tim Hatch
Sent: Wednesday, February 25, 2009 3:29 PM
To: dorkbotpdx-blabber at dorkbot.org
Subject: [dorkbotpdx-blabber] Designing a Parallel-to-USB Converter

Hi dorkbotters,

This is my first post on the list, I usually just lurk because I'm  
actually in Santa Barbara.  I was wondering if anyone could offer some  
hints on designing an AT90USB-based peripheral.  I need it to be able  
to input parallel (yes, ieee-1284) and re-send the data over usb.  I  
have a proof of concept using a Stickduino along with some TTL logic  
that works great.  I've begun laying out a surface mount version with  
an AT90USB162, but want to get it right the first time.  Eagle files  
and image of schematic:

http://timhatch.com/ex/2009/02/parallel_usb/

It's loosely based on the AVRopendous and Benito, which in turn appear  
based on AT90USBKEY.  I have a little experience with surface-mount,  
but some parts of EE are a little murky, as I'm trained in software.   
This is essentially a weekend project that my job now wants to be able  
to use, but I'd rather learn the why's so I can do this again for  
other projects.  The office has also agreed to make the result of my  
learning experience open, so anyone can use it.

The second revision has the approximate outline I want to fit inside  
(the giant drills are holes for mounting screws), and is basically the  
same schematic (I think I just yanked out a few LEDs for space  
reasons).  It's actually more like the 8th version, as I keep ripping  
up all the traces and moving stuff around.  If you haven't already  
clicked the link, I have screenshots there that might be helpful for  
following along.

Goal
------

Read 8 bits of input on the falling edge of the strobe line, send to  
the host over usb.  (I have this much working already on a Stickduino  
which uses FT232R, with the same inverter/latch combination using DIP  
parts).  This is of course easiest if a whole port is available, but  
on the Stickduino PC6 acts funky (always LOW), and I'm hoping that  
PORTB on the AT90USB162 behaves.  I plan to make it run at 16MHz, for  
no other reason than I know the code I have now works at 16MHz.

Questions for everyone
-------------------------------

(Note, I won't be offended at all if you just answer the question with  
a link...)

Q: What kind of logic goes into choosing a crystal/oscillator?
I found the AWSCR-16.00MTD-T which already has caps built-in (making  
fewer joints for me to use), but I don't see any other boards using it  
so I'm wondering if it's inappropriate here.  As far as I can tell,  
the only SMT oscillator used for other AT90 boards is digikey  
644-1132-1-ND or related, and all the Arduino boards use through-hole  
HC49's or ceramic oscillators.

Q: What kind of logic goes into deciding whether to use the built-in  
8MHz oscillator?
Is it just accuracy, with the 10% tolerance mentioned in the datasheet?

Q: Are there any special rules relating to trace length of USB lines,  
xtal lines, or the giant cap next to the AT90?
I'm trying to keep them as short as possible, but wondering if they  
shouldn't come near each other, for example.  Is it a problem to run D 
+ on one layer and D- on another?

Q: Am I doing the best thing with the tac switches?
The switches I have on there are huge, given that I'm trying to fit it  
inside a DB25 hood.  I notice Paul S has done something cool with a  
BAT54C diode on the Teensy[2] -- I can see it would save space, and if  
you're only using HWB for bootloader you don't lose anything.  It  
appears that most of these tiny boards use Digikey 401-1427-1-ND for  
their buttons (which isn't in any Eagle libraries I've found)?

Q: Is the only difference between the AT90USB162 and AT90USB82 the  
flash size?
My current code compiles to 1700 bytes or so, do you think it's worth  
switching to the -82 even though I have zero experience with it?  What  
would the reasons be (power? a few cents cheaper?)

And lastly, I'm planning to use a through-hole USB Mini-B connector,  
and solder wires directly for a captive cord.  Do you foresee any  
problems with that?

Tim

[1]: My day job is doing some Python-based software for Nutricate -  
their website is http://nutricate.com/ but be warned there's lots of  
Flash.
[2]: http://www.pjrc.com/teensy/schematic.html
_______________________________________________
dorkbotpdx-blabber mailing list
dorkbotpdx-blabber at dorkbot.org
http://music.columbia.edu/mailman/listinfo/dorkbotpdx-blabber



More information about the dorkbotpdx-blabber mailing list