Author Topic: Digispark Clock using Charliplex kits  (Read 4193 times)

seaniesk8

  • Newbie
  • *
  • Posts: 1
Digispark Clock using Charliplex kits
« on: April 18, 2013, 01:32:35 pm »
I have been fiddling with my Charlieplex and it is working great with my new digisparks. I have managed to make it recite string letters, numbers, and various patterns. My next step is creating a clock using two separate Charlieplex kits (and 2 digissparks). I want each to display the current hour and current minute respectively. I am thinking of using a stringing technique to display numbers 10 and above. Any ideas on how I can achieve my project? I also have an arduino with a binary clock kit. Let me know if anyone can help me out! :o :o

Bluebie

  • Sr. Member
  • ****
  • Posts: 486
Re: Digispark Clock using Charliplex kits
« Reply #1 on: April 18, 2013, 05:05:37 pm »
I hate to be a bearer of bad news, but the digispark's internal clock frequency is only good to within 0.1%, and that's a best case! That means it'll be off by one second out of every thousand at minimum, or 1.44 minutes each day. It could be much worse than that, as much as 10% out if you haven't installed the 1.06 bootloader update using the Burn Bootloader function on the digisparks.


Still, I'm to understand there's one digital pin on the charlieplex shields which isn't connected. In theory you could connect this with a capacitor and a high value resistor (on the digispark side) to your mains electricity supply and use the 50 or 60hz AC signal as a clock - many electricly powered clocks use the power signal to control their time, so power companies try to adjust their frequency to precisely keep clocks accurate. Neat, huh? Maybe you could run the whole thing off a power brick that has an AC output, and use a rectifier and capacitor to supply the digispark's VIN input with 9v or whatever, while connecting the spare pin via big value resistor directly to that lower voltage AC supply. It'd be way safer than working with the mains electricity voltages.


Or you could do something really crazy like get a little analog watch and connect the spare pin to it's oscillator circuit so it pulses once ever second or so! The TinyPinChange library should be able to detect that!


Or you could just be boring and use a OneWire real time clock chip. Bleh. Or how about use software serial to make a display slave and send it commands over serial from an arduino or a third digispark running cdc232.hex or something like that? You could connect both to the same wire and just make the firmware on one look at the first byte and the firmware on the second look at the second byte, with a reset byte like 255 between each update to make sure they're lined up right. Or maybe it should read in 32-bit numbers and display them directly - then the host could output arbitrary pixel designs and you could use them to make game displays and stuff too!!! Network two digisparks together to make one be a gamepad and another be the display?