// // We remove part of the plastic from a cheap battery powered quartz clock // to expose the two wires of the motor coil. We then solder long wires to these // exposed motor terminals so we can connect them to Port 1 pin 4 and Port 1 pin 5. // Now we remove the battery from the clock, and use the Launchpad to send the // signals to the coil instead of the normal clock electronics. // // This lets us run the clock at high speed, or at much lower speeds if we like. // // To get an approximation to real time, a delay of 1,000 milliseconds (one second) // would be close. For truly quartz-accurate timing, solder the crystal onto the board, // and use a timer set for one second intervals. You can do the XOR in an interrupt routine. // // Some clocks will only run as fast as 240 milliseconds per tick before they get totally // confused (some really cheap $2.88 Walmart clocks I tried). The $25 Staples wall clock, // which seems to have the same movement as Westclock clocks do, can run with a 20 millisecond // period (50 times faster than normal time). But sometimes they start up going backwards // when run that fast, and sometimes they don't start. // // I don't know why the clocks like to run clockwise, but presumably they are designed to // do that reliably. That they can run backwards was a pleasant surprise, and it may be // that pushing the second hand backwards by hand might get them to do that. I have yet // to remove the front face and try that. // // With the big Staples wall clock, I can run it with a 20 millisecond period and get it // to run backwards about 1/5th of the time. I just keep hitting the RESET button on the // Launchpad until it's running backwards. // void setup( void ) { P1DIR = 0b110000; P1OUT = 0b100000; } void loop( void ) { P1OUT ^= 0b110000; delay( 25 ); }