USBClockIt
USBClockIt is a SparkFun Electronics ClockIt kit (SparkFun sku: KIT-10013) (a simple HH:MM LED clock featuring an Atmel AVR micro-controller, running at 16MHz) modified to add in a V-USB Virtual USB interface to allow the ClockIt to be powered and synchronised via USB.
A USB cable with type-A connector was cut and soldered, along with 2 x 47R resistors, a 1k5 resistor, a 3V zener and a blue LED. Details of the circuit additions in the usbclock.c file (see below).
Contents |
ClockIt Code
Code is available at clockit project SVN repository. Also includes headers etc. for V-USB. Code uses the USB Communications Device Class.
Code is developed using Linux command line tools such as gcc-avr etc.
Code is downloaded to ATMega168 using Bus Pirate attached to standard Atmel AVR 6-pin programming header on clockit kit
Host Code
The USB ClockIt will run just plugged into a spare USB port, but it's time will not be synchronised.
The keep the time synchronised, a separate commandline application, sf7segclock needs to run on the host. For USBClockIt, the device to connect to will typically be something like /dev/ttyACM0 or similar:
./sf7segclock -p /dev/ttyACM0
Limitations
Note that the USB Communications Device Class is not specified to run at low-speed USB (as used by V-USB) and not all host controllers/OSs support CDC devices running at low-speed.