Bit-banged USB?!?!

I came across this schematic (well, my son dragged it into my attention):

formatting link
SMD_Schematic.PNG

This is for a universal keyboard controller. The thing that is really catching my eye, though, is that the thing appears to be set up to bit- bang the USB.

Has anyone ever heard of doing this? Tried it? Succeeded? USB slow is

1.5MHz, so there's a remote possibility that one might possibly have enough time to do something if the processor isn't doing much else (the processor in the above schematic is clocking at 12MHz), but I'm pretty astonished that they're even managing that.
--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
Reply to
Tim Wescott
Loading thread data ...

I have absolutely no clue how it's configured -- the source code isn't available. I'm still trying to get past bit-banged USB.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

That's from PD0(RXD) and PD2(INT0)? Are those configured then as just PIO (emphasis O)?

Pretty crazy, but keyboard events are relatively infrequent - hundreds per second at most.

-- Les Cargill

Reply to
Les Cargill

There have been a number of reports of people doing that over the years, although there always seemed to have been some caveats about error handling and such. The obvious Google search seems to lead to a number of those projects, although I've never (knowingly) seen such a beast in operation.

One such claiming to work on a 12MHz AVR:

formatting link

Reply to
Robert Wessel

I tried the obvious (to me) search on IxQuick, and didn't find anything. What search phrase did you use?

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

Atmel has an application note and sample software for doing this (for a mouse) with an AVR. It's many years old, using quite a simple AVR - but it's written in assembly and not easy to modify or re-use, and it's not exactly full-feature. Still, bit-banged slow USB is not going to be too difficult for a simple peripheral and a fast microcontroller, if you can be sure to get low jitter on the bit timing.

XMOS do USB2.0 full speed (480 Mbps) in software, along with their fairly sophisticated buffered IO ports.

Reply to
David Brown

Yes. I built this joystick adapter once:

formatting link

I did not have any part in developing the project. I just downloaded the files and built the device.

It did work. When plugged in to my XP computer, the joystick device appeared in Device Manager, and changing the input voltage would move the controls on screen.

--
RoRo
Reply to
Robert Roland

Not done it myself, but I know that there has been code around for ages for Atmel. Low speed USB is relatively.... low speed, and AIUI USB was designed to be relatively simple on the device side.

--

John Devereux
Reply to
John Devereux

I was reminded of this project when I went looking for USB device MCUs in PDIP several weeks ago. I found it again just now by searching for "avr software usb" (without the quotes).

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
Reply to
Simon Clubley

:-)

Well you never know what crazy stuff you can justify when you have the freedom to play with this stuff on your own time (and are funding it out of your own pocket) instead of having to charge per hour of your time. :-)

Never underestimate the ingenuity of a hobbyist looking to save a few pounds/dollars by building their own device instead of using a preassembled widget.

The cost versus time tradeoffs for someone like myself are completely different from those experienced by a embedded person like yourself who is doing this for a living.

BTW, I'm amused that you are astonished by this and it did make me wonder what other things people building things out of their own pocket can justify which would astonish a person doing this for a living. :-)

Simon.

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world
Reply to
Simon Clubley

Yes there are the TCP/IP on a 8051 type projects too.

Don't think anyone bitbanged that though!

--

John Devereux
Reply to
John Devereux

The USBtinyISP kit I use for programming AVRs uses bit-banged USB. Haven't had issues with it so far.

-a

Reply to
Anders.Montonen

I seem to be beyond surprise any more. What's the jitter spec for USB, anyway?

-- Les Cargill

Reply to
Les Cargill

Also, wasn't one of the old-school UARTs (the 8530/82530 ) just ... like... a Z80 with special firmware & some peripherals? They'd do T1 rate, if not more... I only used 'em for mid-speed Iloop and RS232/422 before the 68360 & descendents came along...

I know the 16550 predecessors were not.

-- Les Cargill

Reply to
Les Cargill

I don't know. I've pulled out my USB book and I'm reading it.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

It'd make sense in a system that ships in high volume, too -- if production is going to be 100/year and you save a penny on the BOM, then every year you've made a buck. If production is 10000 a month and you save a penny on the BOM, then every year you've made $1200 -- so the amount of engineering time you should spend to save that penny varies depending on who you're working for, and what they're doing.

--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?

Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com
Reply to
Tim Wescott

Tim Wescott schrieb:

Just one more:

Tilmann

Reply to
Tilmann Reh

I'm somewhat surprised by the fact that V-USB [1] wasn't explicitly mentioned in this thread.

[1]
formatting link

Once, I've built a simplistic USB device based on ATmega8 (or a similar MCU) and V-USB, which was talking USB-MIDI to the host.

As V-USB had no USB-MIDI-specific parts back then (and I wonder if they have it nowadays) I had to check the "reference", for which I've used the source code of the Linux kernel.

--
FSF associate member #7257
Reply to
Ivan Shmakov

formatting link

ow is

there has been slow speed bit banged usb for a long time, think this is one of the more "famous" ones:

formatting link

it is for AVR and I think it runs at most frequencies from 8MHz up,

-Lasse

Reply to
langwadt

lly

t-

B slow

ve

he

y

Exactly, the Atmel code is called V-USB (

formatting link
/index.html ) and there are many projects based on it:
formatting link
projects.html ). I have successfully used it for some MIDI-USB devices:
formatting link
formatting link

The V-USB is fully open-sourced.

-- Wojtek

Reply to
wzab

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.