Page 1 of 1

switch on leds from windows pc with attiny45

Posted: Tue Jan 03, 2012 4:01 pm
by iepaul
I am new to avr programming and I am looking to create a usb device that I can switch on or off two leds from my PC. I have an attiny45 and a windows 7 pc. I think if I can switch on and off leds I can later control relays.

I have seen a project that is similar but it is for linux and the source code no longer seems to be available http://davehillier.wordpress.com/2009/0 ... -the-cube/

Can anybody give me some ideas where to begin with this project?

Re: switch on leds from windows pc with attiny45

Posted: Tue Jan 03, 2012 5:25 pm
by Tim_BandTech.Com
The catch is to understand USB.
I have begun to understand USB, but I have not finished yet.
There are likely many device classes which you could get this going under, but the one you choose should probably be one that you will use for future projects. Then you will move more cleanly. 'Cleanly' here is pejorative, and the overhead of USB is worthy but expensive as well.

- Tim

Re: switch on leds from windows pc with attiny45

Posted: Tue Jan 03, 2012 9:34 pm
by Peter Chaffe
The powerSwitch project on this site will give all the info you need!

I have recently used an atTiny45 to do just that, ie a one channel external switch/relay.
A slight re-hash of the firmware source code is all that is needed for it to work.

LibUsb employs a driver wizard which will create the required 32/64 bit driver,
and is the approach that I would recommend.

The example host command-line c code shows how to handle send/receive,
it is also possible to port this to other languages...