switch on leds from windows pc with attiny45

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
Posts: 1
Joined: Tue Jan 03, 2012 3:46 pm

switch on leds from windows pc with attiny45

Post by iepaul » Tue Jan 03, 2012 4:01 pm

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?

Posts: 6
Joined: Mon Aug 15, 2011 2:31 pm

Re: switch on leds from windows pc with attiny45

Post by Tim_BandTech.Com » Tue Jan 03, 2012 5:25 pm

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

Peter Chaffe
Rank 1
Rank 1
Posts: 20
Joined: Fri Dec 02, 2011 12:25 pm

Re: switch on leds from windows pc with attiny45

Post by Peter Chaffe » Tue Jan 03, 2012 9:34 pm

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...

Post Reply