SparkFun Forums 

Where electronics enthusiasts find answers.

Have a good idea for a new product for SFE or Olimex? Let us know!
By greg_corson
#15606
How about a board similar to the AT90USBKEY for AVR? This thing looks really useful for experiments and projects, the only problem is that they don't seem to be available ANYWHERE, they haven't been in stock for months.

It's a nice little board with AVR and a USB on-the-go plug for connecting to your computer and programming (appears as a USB memory device initially)

One problem I've heard with the AT90USBKEY's design is that, while they have pads for something like 48 different IO pins, the spacing and configuration of the IO pins is not very convenient for breadboarding.

It would be really nice to have something like this that was an all USB configuration you could just stick into a breadboard and plug into your computer and go.
By cheesy
#15652
USB Bit Whacker?
By EmbeddedMan
#15663
Yup. The UBW board would work. Super easy breadboarding, plug and go (it appears as a COM port, not a memory device, but that may be OK for you). It has a built in bootloader so you can write any code you want and just download over the USB connection.

I'm sure that the AT90USBKEY has more abilities - from the picture it looks like there is much more circutry than we have on the UBW. But it's more expensive than the UBW too. :) Maybe the (simpler) UBW would still fit your bil?

*Brian
User avatar
By roach
#15674
I'm looking for something similar on an LPC2148 (ie: Full-speed USB bootloader / BitWacker). It's obviously doable, but I've yet to find a windows driver that can support it, and I don't want to write my own.

"USB Memory Device"? Is that the same as a "Mass Storage Device"? Tell me more.... Can anyone provide a link to the device class whitepaper (or whatever it's called)?
By EmbeddedMan
#15686
roach,
OK, you're looking for something higher powered. I'd love to do a Bit Whacker project on the LPC series someday - that would be really fun.

By 'USB Memory Device' I did mean 'Mass Storage Device' - sorry for the confusion. Your term is more correct.

If you _did_ want to use Microchip USB PICs, here is a link to code on Microchip's website that will turn your USB PIC into a Mass Storage Device. (This allows for very fast data transfers between the PC and PIC)

http://www.microchip.com/stellent/idcpl ... m=en024412

Download the app note and source code and check it out if you're interested.

Just googling, I found this
"In the 3.2.2 release of FreeRTOS there is a USB CDC implementation:
\FreeRTOS\FreeRTOSV3.2.2\FreeRTOS\Demo\lwIP_Demo_Rowley_ARM7\USB
http://www.freertos.org/ "

Maybe that would help you?

*Brian
User avatar
By roach
#15689
I've seen this "CDC" stuff before (among others, in AN956 at Microchip). What does CDC stand for, anyway? I've got the Microchip code, and might try to port it, or at least read through it to understand how USB works...
By EmbeddedMan
#15693
Here's some more information
http://en.wikipedia.org/wiki/USB_commun ... vice_class

It stands for Communications Device Class, and it is meant to encompas a large number of different devices, mainly USB based modems. So there is a lot of stuff in the USB spec about communications related things.

It appears there aren't that many USB modems on the market, but there are lots of USB to serial converters, some of which use the CDC class. The Microchip implementation ignores many of the CDC specifications that don't really matter, but you could implement them if you wish.

Honestly, it's wickedly complicated (at least for me). I have not had the technical guts to go through Microchip's CDC code and understand exactly how it works, and understand how it interacts with the PIC's USB hardware. It just works, and that's good enough for me (for now). The USB spec is huge and dry. A big world is USB.

*Brian
User avatar
By roach
#15697
EmbeddedMan wrote:A big world is USB.
Yeah, no kidding. For one thing, I hear many conflicting opinions on supported Baud rates with the CDC class (talking about usbser.sys compatible devices here). On the one hand, people say that baud rate, parity bit, etc. are not really applicable in USB, which is fine, but the driver itself (usbser.sys) will choke the baud rate to a standard COM port maximum (prolly 115200 kbps), which really prevents me from using the full-speed functionality, unless I develope my own drivers ( a hairy proposition that I'm unequivocally NOT interested in even considering thinking about contemplating). Nobody seems to have actually gotten a USB virtual COM port running at full-speed USB data rates.

...am I hunting the mythical manticore, here, or is this flat-out not possible?

...Oh yeah, and it has to be open-source. Obviously I'd love to use the CMX solutions (USB-PL and the like), but I don't happen have a spare couple thousand dollars lying around...

BTW:Hey, sorry for hijacking this thread with my LPC-centric questions...
By EmbeddedMan
#15701
roach,
My impression from reading about CDC and USB throughput (mainly on the Microchip USB forums) is that the Microsoft CDC driver (usbser.sys) is not implimented in the most efficient and speed-enchancing way. From this source (http://ww1.microchip.com/downloads/en/A ... 00956b.pdf) I see that Microchip says there's a maxium of 80KB/s - this is approximately the maximum speed I'm seeing with my UBW board. From what I've read, someone has written an improved CDC driver for Windows that can go faster, but there isn't much faster to go. (80KB/s is about 640Kb/s) One thing you will learn about USB is that the 12Mb/s is crap - you can't really use that for your speed estimations. The only thing that even approaches that speed for payload data is the Mass Storage Device class, and I think it maxes out around 10Mb/s of real data.
So the bottom line is that if 80KBytes/s is enough for you, then CDC is the way to go. If it's not, then you should maybe think of using a USB High Speed (480Mb/s) part.
What you hear about baud rates is true - for true Virtual COM port systems (like the UBW board) the baud rate that you have set on the PC side is _completely_ ignored by the PIC. The USB sub-system sends as much information as it can to the PIC, and then waits for the PIC to say that it has received that packet. Then it sends more. All of the 'handshaking' is completely taken care of by the USB protocol. (i.e. it is always going at it's maximum speed)
For a USB to serial chip (like FTDI or Silicon Labs) the baud rate is important only so that the chip knows how long to make each RS-232 bit. It has nothing to do with the transfer of information between the PC and the chip.

I hope this helps.

*Brian
By stevech
#15709
greg_corson wrote:How about a board similar to the AT90USBKEY for AVR? This thing looks really useful for experiments and projects, the only problem is that they don't seem to be available ANYWHERE, they haven't been in stock for months.
I have not found these either. Sure would like to have some of these because they support the HID mode. The BIOS in PCs runs USB keyboard in a special semi-USB-standard compliant mode - needed for use before windows' drivers come up.
User avatar
By roach
#15728
EmbeddedMan wrote:roach,
My impression from reading about CDC and USB throughput (mainly on the Microchip USB forums) is that the Microsoft CDC driver (usbser.sys) is not implimented in the most efficient and speed-enchancing way.
I understand this driver was designed with modems in mind, and not for general purpose serial comms.
From this source (http://ww1.microchip.com/downloads/en/A ... 00956b.pdf) I see that Microchip says there's a maxium of 80KB/s - this is approximately the maximum speed I'm seeing with my UBW board.
This is still 6 times faster than a regular COM port. I think I could probably live with that.
The only thing that even approaches that speed for payload data is the Mass Storage Device class, and I think it maxes out around 10Mb/s of real data.
This is my other option. Might be a hassle to load firmware, issue commands, and organize playlists on the device (it's an MP3 player). I'd have to hook up some sort of indexing algorithm to ensure the same file is not loaded twice, etc. (I won't bore you with the details).
I hope this helps.
It does indeed. Thanks, Brian.
By greg_corson
#15838
The UBW board would be great for some things, but the AVR90USBKEY also had some analog inputs, which I kinda needed.

Also the UBW appears as a serial port and I particularly wanted something that would appear as a HID (human interface device).
By EmbeddedMan
#15869
Greg,
Very soon the UBW will have analog inputs as well as several other new features.

But you're right, all of the current UBW firmware uses the virtual com port idea - no HID yet.

However, the HID example code from Microchip should run almost without modification on the UBW - you can just download it with the bootloader and try it out if you want. Eventually I want to use the UBW as a HID button input device for my MAME cabinet, so I'll be posting HID code for it in the future. But you could do it yourself pretty easily if you wanted to!

*Brian
By greg_corson
#15891
Thanks *Brian,

I realized after reading the schematic and data sheets (DUH, should have looked there first) that UBW's microcontroller had some analog inputs on a number of the dual purpose I/O pins, so this will probably do what I want with some firmware hacking. By the way, are the pin spacings on Spark's UBW board setup so they match the spacing on a solderless breadboard? ie: just solder in some of these http://www.sparkfun.com/commerce/produc ... cts_id=116 and plug it straight in?

By any chance, are there plans for something as simple as a UBW but with more I/O pins? 14 is enough for my development needs...but it would be better if it had 2-3 times as many.

If you're curious about the project this is for, see my post "USB HID development platforms (for simulator cockpits)" in the Projects section of this board. Short version, I'm trying to work out a nice simulator cockpit.

Here's a link to the post (assuming I got it right)
http://www.sparkfun.com/cgi-bin/phpbb/v ... 5607#15607