SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By greg_corson
#15607
Hi,

I'm looking to do some experimenting with user interfaces and need a development platform with a number of I/O pins and at least 4 analog inputs. In particular, I'd like something that has a USB connection direct to the micro-controller and is compatible with an available HID protocol driver like
http://www.obdev.at/products/avrusb/index.html so it can plug into a PC without requiring special drivers on the PC side.

I'm mostly interested in experimenting with user interface devices, so I'd like to have a platform that is as easy as possible to program the microcontroller, preferably right through the USB in-circuit.

To start out with I want to interface a number of lighted buttons with I/O pins both sampling the switches and driving the lights at various brightness levels. Eventually I will probably be connecting a few dials, encoders and strain gauges.

Initially it looked like the AV90USBKEY would have been a good board to use for this, but I can't find anyone who has it in stock.

If you have any suggestions, please let me know...I don't want to spend masses of cash getting started on this, so a solution that has free or near-free compilers/assemblers...etc would be real helpful.

Thanks
Last edited by greg_corson on Sat Jul 15, 2006 6:08 pm, edited 1 time in total.
By cheesy
#15651
I really like the PIC18F2455/2550/4455/4550 series of microcontrollers.

SparkFun just started selling a board with everything you need...

http://www.sparkfun.com/commerce/produc ... cts_id=762

It's preloaded with some serial port software (but if you really wanted to you can reload other code onto it using the bootloader)
By greg_corson
#15839
Does this board have enough power to be reconfigured with HID device drivers? I really want HID because it allows PC apps to use the device without special drivers (ie: you could make a joystick that a game could use without code mods)

Also, the UBW board doesn't have analog in, which I will eventually need.
By cheesy
#15841
The way I understand it, the PIC USB bootloader is includeded, so you can reprogram it with whatever code you want.

I haven't looked at the schematic, but if the pins on the board are just connected directly to the pins on the chip, you can use them as analog inputs, provided you program it with the correct code.
By greg_corson
#15843
So I looked back at the schematic and the PIC chip datasheet (DUH, should have done that first) and realized there are a bunch of analog inputs on this thing (wonder why the SparkFun catalog doesn't mention this).

Sounds like it's pretty much what I need, though I want to replace the firmware with a HID driver, it looks like microchip has some example drivers and source code for this.

So I guess my last remaining question is how much other stuff I need to get started? It looked like the "student edition" of microchip's compilers is free (right?) Is that pretty much the only other thing I need? Not too familiar with the PIC chips, with this UBW board is there much risk of turning it into a brick with a bad program or is the usb bootloader code protected?

I've been coding since the Intel 8080 was new and have done a lot of embedded stuff off and on, but have no experience with modern microcontrolers. Any hints/tips/lookouts would be appreciated.
By wiml
#15845
You can always use the ICSP pins to recover from bad firmware, but according to the UBW page, the bootloader will refuse to overwrite itself, so you should be safe.

The ICSP is probably how the bootloader got onto the chip in the first place. It's a very symple synchronous serial protocol you can drive with any spare I/Os you have access to, like the modem control lines on a serial port. Or a second UBW, probably, come to think of it :)
By greg_corson
#15890
Thanks for the advice. In case you're curious, what I'm trying to do is solve an I/O problem for a game Simulator cockpit.

Back in the early 90's I was chief software engineer on the Virtual World Entertainment Simulator cockpits (see http://kangarookoncepts.tripod.com/VWEpix.htm). Lately I've been trying to find a good solution to the biggest problem we had which was interfacing a PC to nearly 100 controls (lighted buttons, joysticks, footpedals, switches).

Basically I want something that can scan the buttons, drive the button LEDs at about 4 different brightness levels (or colors) and/or read analog or optical encoder based joysticks. I think with a bit of firmware hacking the UBW should be able to do this.

One of the biggest problems in these cockpits was that the wiring harness for all this stuff was a nightmare. It looks like the UBW design is cheap enough that there could be one board for every 4-8 lighted buttons, then wire everything back via off-the-shelf USB cables/hubs.

I was thinking the CAN bus might be better for this (no need for hubs, right?) but I haven't got a lot of experience with this.

If anyone has any suggestions about better ways to do this, please let me know.
Thanks!
User avatar
By leon_heller
#15893
greg_corson wrote:Hi,

I'm looking to do some experimenting with user interfaces and need a development platform with a number of I/O pins and at least 4 analog inputs. In particular, I'd like something that has a USB connection direct to the micro-controller and is compatible with an available HID protocol driver like
http://www.obdev.at/products/avrusb/index.html so it can plug into a PC without requiring special drivers on the PC side.

I'm mostly interested in experimenting with user interface devices, so I'd like to have a platform that is as easy as possible to program the microcontroller, preferably right through the USB in-circuit.

To start out with I want to interface a number of lighted buttons with I/O pins both sampling the switches and driving the lights at various brightness levels. Eventually I will probably be connecting a few dials, encoders and strain gauges.

Initially it looked like the AV90USBKEY would have been a good board to use for this, but I can't find anyone who has it in stock.

If you have any suggestions, please let me know...I don't want to spend masses of cash getting started on this, so a solution that has free or near-free compilers/assemblers...etc would be real helpful.

Thanks
I've just designed a little USB development board that uses the PIC18F2455, and is intended for use with Brad Minch's software (which includes HID examples):

http://pe.ece.olin.edu/ece/projects.html

It has an ICD 2 connector (Microchip, not Olimex) and a small prototyping area. I made the PCB at home, and the artwork (PDF) is available to anyone who wants to build his own. As it's a single-sided board, connections have to be made direct to the PIC pins, they are not brought out to pads.

Schematic, layout and artwork are here:

http://www.leonheller.com/usb

Leon
By EmbeddedMan
#15894
Greg,
I don't think there would be any problem getting the UBW to do what you want it to do. The Microchip HID example code should run almost exactly as is on the UBW, and you can then modify it to read whatever number of A/Ds (there are 10 available on the UBW) and buttons (up to 15) you wanted, or make some of them outputs, etc.

As a side note, my first job was working for Honeywell. I was hired to help build hardware and software for a flight simulator that was designed for user interface controls testing for the HSCT (high speed civil transport) program. It was really fun - all of our controls were wired directly into a network of PCs with I/O cards. A wiring nightmare, but one that work(ed) well.

*Brian
Last edited by EmbeddedMan on Wed Jul 19, 2006 6:58 am, edited 1 time in total.
By greg_corson
#16063
bikedude, BetaInnovations looks pretty nice! Though I think I prefer the idea of a number of small boards mounted on/near the actual switches, connected by USB to the idea of one big board you have to connect everything to.

The one-big-board approach requires a pretty complicated wiring harness and the longer wires are more subject to noise/static, wiring mistakes and damage.

The ideal thing would be to make a PCB that was a "stick" of 4-8 lighted buttons, a microcontroller and USB connector.

Another thing that would be real handy (but would probably require a CPU with more juce than a PIC) would be a module that had something like a 5 inch color LCD display with 8-16 lighted buttons around the outer edge. Connected back to the main PC it's the ideal thing for "instrument panels", you cold program it to display a bunch of gauges and then just send the gauge positions to it over USB from the host. If anyone has seen anything like this, let me know!