Hi guys !

Long time no see.

I really wish to get started with electronics for a long time and I finally decide with an idea that I just have.

I would like to build a device that I can connect to the PC (preferability USB, so it won't even need its own batteries) and control from it.
In fact, it would be something not too much advanced to begin : for the moment, I would like to be able to turn on and off a LED programmatically from the PC by sending data to the device.

One funny use I see to it would be email notifications... a smtp checker software would check for the emails periodically and switch the LED on or off depending there is messages or not.

That said, I have really no idea where to start (ie : what parts are needed to make it) with and I would also like you to give me some advices for this kind of projects.

Thanks a lot.
Posted on 2004-02-28 17:58:28 by JCP
I would start with something much simpler than that, like using the serial or parallel ports. That can be done with easy-to-find components.
Anyway, here is a link that can help you get an idea about USB: http://www.beyondlogic.org/usbnutshell/usb1.htm
Posted on 2004-03-09 11:25:08 by VVV
I've been pushing in the USB field for a while (on very small and slow steps). Its not as easy as you would first think. There is alot of software level protocals that have to be Hand-shaked at the hardware level, within somewhat precise time frames.

Long story short is you need a usb protocol ready hardware chip. Sounds simple? Well not exactly. The catch to all this is USB protocal also expects the hardware device durring the protocol hand-shaking phase to announce itself as to what "type" of hardware it is connected as. (The secret to how it acts in a Universal manor). Type infomation is hardware specific and can sometimes give driver info back to the OS. So its virtually impossible for manufacturers to make as hardware chip for the protocal hand-shaking required, and leave some of it open for user specific type information.

The solution is then design your own usb chip for your next wiget (way too much overhead / time /cost for a hobbiest), or get an microprocessor based chip and program it with protocol info. Microchip makes a USB PIC but the catch here is the ever popular EEPROM memory is not provided in this series. Only the EPROM and PROM versions are available. This makes design challenging again because you need a UV eraser to erase before reprogramming a EPROM chip. UV erasing time cycle is about 10-15min! So you have to be damn sure of your source up front before another test is carried out, because the development time with draaaaaag and draaaag waiting for each erase cycle (even if you back up with a couple chips for efficiency!).

There is some other alternatives out there but they all seem to have their catch 22 associated with them. The best alternate i've seen is a hardware only chip for the handshaking on the bus, and a fire-wire serial communication in and out of the chip. So essientially its more of a protocol translator, from USB to firewire, which can be delt with by a down stream processor.

I would be only more than happy to hear someone tell me im wrong and show me a simpler way... becuase I too wanted to do just what your asking for at one point, and im still not there! (Albeit I tend to get distracted easily ;) )

Posted on 2004-03-09 22:55:27 by NaN
If you are interested in USB stuff I suggest you check out Jan Axelrod's Lakeview Research site. Jan is the author of "USB Complete," a book I have and recommend.

I've tried, modified, and suceeded in using his HID (Human Interface Device) code to make a demo board that's really quite usefull, providing 24 output lines (connected to LEDs to see their state) and 5 input lines. The computer end code was done in VB6 as an exe server (so it ran in its own thread, a USB read will block the thread until it either times out or sends info). The sample has one bug, occasionally a write doesn't work; the workaround for the bug is to send back the state info after a write, and if it is incorrect to write it again.

Microchip has a demo board, I recomend getting it, just so you have SOMETHING you know works in both hardware and software. After you have your IC working on it, you can transfer the chip to your own breadboard to see if your electronics build is good.

Trying to debug both electronics and code together is madness.

(Sorry, I cannot post my code as MY personal home computer is currently not booting due to some 'issues')
Posted on 2004-03-11 06:41:47 by Ernie
I've modified a few USB interfaces on the device end. The code I've worked with is proprietary, and not a derivative of code supplied by the chip manufacturers. So I can't show any part of that code.

For some designs, I've used the Cypress EZ-USB (originally an Anchor Chips design). For about US$100, I can get the USBSIMM (link) board and use the free Cypress SDK to build working firmware. The board has a full microprocessor address and data bus, 32K static RAM, and a 64K (8K x 8) serial EEPROM.

Without a boot ROM, the chip acts as a valid full speed (12Mbps) device (complete with valid device information) with only download/upload capabilities. With the built in download (USB) command, you can load firmware over the USB cable. You can also store bootable firmware in a serial (IIC) EEPROM. A signature byte tells the microcontroller that the EEPROM contains firmware.

Oh, and NaN mentioned catches. The toolchains supplied in the Cypress SDK are evaluation versions of the Keil 8051 software. However, free '51 assemblers are available, but not necessarily compatible with the Intel/Keil syntax. (Sort of like NASM/FASM vs. MASM/TASM.) You would need to convert the C code to assembly language. The source for the framework and the libraries are all there. Or you could start with John Hyde's code, see the link to Jan Axelson's site in Ernie's post.)
Posted on 2004-03-12 21:40:46 by tenkey
But pocket never full enough with exported jobs...lol. Oh well that's the way it is and we in US never where afraid of competition. Anyway I thought this may or may not be of use to you. I built this program as an NT hardware user interface. Unfortunately I don't have time to include a mini-assembler/disassembler but it has all source code and subroutines can be modified easily in the driver to access whatever port you like. You can edit memory anywhwere. Sufficient learning curve but if you have questions just bark.

P.S. you'll need Four-F's KMD kit (the include files if you wish to edit the driver)
Posted on 2004-03-12 21:58:19 by mrgone
I've come across several USB-based projects which were used for a variety of things, and all had one thing in common - they were all based on the guts of a usb-ready mouse :)
Posted on 2004-03-12 23:28:24 by Homer