Electronics Binary Clock Mod Idea

Discussion in 'Modding' started by Gedron, 15 Jan 2004.

  1. Gedron

    Gedron What's a Dremel?

    Joined:
    31 Oct 2003
    Posts:
    249
    Likes Received:
    0
    OK, let me start this off with the comment that I know very little about designing an electronic circuit. Just never played with it very much. I do however have a considerable amount of "hands on" experience with working with electronics. I was once even "2m certified" (thats micro-miniature) which means I've fixed broken traces in the middle layer of a 7-layer circuit board.. (traces so small you literally needed a "microscope" to see them well... smaller than a hairs width) to "space environment acceptable" standards. So I feel confident that I can do this :worried:

    OK, enuff blowing my own horn, if you got this far you probably have more patience with blow-hards than I do :D

    The Idea: To have a binary clock built into the side of my PC

    Ohhh.. ahhhh... I can hear the awe wafting from your collective gasps

    Now, I could just buy one (like this one) and hack it apart then slap it into my case... but what would be the fun in that? And why would I bother posting about it here.

    Here's the pic:
    [​IMG]

    I've done some searching, and come up with a few interesting links to building one, but I'm thinking applying it to my situation will take some re-designing and I want to ping it off you guys first.

    This is the prime candidate as far as schematics go that I've found so far... but it may be completely wrong for me, and this is where you come in.

    • I want it to be in 24 hour format. (The picture above is.. the schematic is not)
    • I would prefer it to be powered by (or through) the PC's PS.
    • I want it to be easily settable (button for setting hour, min, sec)
    • I was hoping some of you might find this interesting enuff to help out
     
    Last edited: 15 Jan 2004
  2. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    Hey this is fairly simple to do, i think i saw a PIC tutorial that made one of these, thou u don't need micro skills to make one.

    I would have to say thou, that i would use a micro, that way it could be just one chip, and about 5 transistors (built in osc micros are a godsend for the lazy solder-er)

    Such code wouldn't be hard, if u need any help feal free to bug.

    You could also use the parport to do it. easyest way would be to use latches on the status pins.

    i will let someone else tell u all the 555's and counter ways :) (not to mention the logic to increment the next counter, and detect the overflows)!
     
  3. Gedron

    Gedron What's a Dremel?

    Joined:
    31 Oct 2003
    Posts:
    249
    Likes Received:
    0
    Any chance you can find a link for me?
     
  4. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    can't find it now :( i think it was on PICLIST, basically if your familiar with microcontrollers (or better yet read a PIC tutorial)

    Then this should make some sense.

    Using a sensible speed of cyrstal (or built in osc) use the TMR0 interupt to generate a function that is called every half second (this is very well documented in the datasheet).

    In this function increment a file register, and then test it, if its 120, increment the next unit (mins), and so forth. Then just devide by 2 (RLF) before outputting the status to a port.

    that wraps up the clock, all you need now is set.

    If i was designing this, so i would know which unit i was setting i would make them flash, when the up down button will change that unit. 3 microswitches, lets say they are de-bounced now, for ease. up down and set.

    Simple way of doing this is having an edit register, so that when the set button is pressed, it increments this register, or re-sets to 0 if u go too high (above the total number of units).

    This register is tested in the timer routine if set, invert the status of the apropriate TRIS bits this will create a flashing effect.

    then a simple up down, u just over ride the value in the first register, be careful on under+overflow.

    You might want to add code to see that when the up/down button has been pressed, it will auto inc/dec without u having to press it again? if so use the half second timer interupt.

    this is very vauge, i am in rush (sorry!)

    If you want me to right code for it i will, it sounds like a fun project
    (if someone makes it into a tutorial it would be cool)
     
  5. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
  6. Gedron

    Gedron What's a Dremel?

    Joined:
    31 Oct 2003
    Posts:
    249
    Likes Received:
    0
    Well, I ordered a PIC today (couldn't find one locally). It is a 16F84A-04/P I hope it will work for me, but if it doesn't it was still less than $10 with shipping and should give me something to learn with.

    I'm looking forward to this. And yeah, I'll make a tutorial (or something like it) for the project.
     
  7. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    16F84A is a bad chip imo, its very old, and very crap, it just seams to have a lot of code out for it!? (i have no idea y, maby i just don't see hte virtue of it!)

    Anyway head over to www.microchip.com pic up some free samples of the following:
    PIC16F870 PIC16F871 PIC16F877 PIC12F629 PIC16F688

    I would get 2 16F870s and 16F688's myself these are the most versitile, and should be the most common in upcomming designs.

    components for a JDM programmer if you don't already have a programmer.
    linkage:

    also, you will want.
    20mhz oscillator, 15uf caps * 2, 10K resistors o plenty, prototype board.
    would be more fun if u also had
    MAX232 + 5 10pf caps, or other rs232 voltage convertor.
    some cable u can butcher to get at the TX and RX lines.

    then u will be in buisness

    The problem with the 16F84A is that its a halfway house, and an out of date one. Its not got enough ports for most projects, its too big for the small ones. It needs an external osc etc. its a dead chip, it should be put to its grave with a tomb stone saying "Why the ************ of ******* was it so popular" it has always puzzeled me, y people grab that one of the shelf, for the most in-apropriate projects!

    In short, 84A = dead horse.
     
  8. Gedron

    Gedron What's a Dremel?

    Joined:
    31 Oct 2003
    Posts:
    249
    Likes Received:
    0
    Heh, Well, the main reason I chose this one was because I remembered seeing it when I was looking around at PIC tutorials, and it was the largest PIC that I saw listed when at the ::coff::Radio Shack::coff:: I happened to be in when the URGE to buy something happened :D

    Oh well, it wasn't very expensive, and it should give me something to experiment with still... got to get my feet wet somewhere.

    <edit>
    I sent for the samples as you suggested. Thanks for the tip. :thumb:

    I have got to find a better local electronice shop than RS.
    </edit>
     
    Last edited: 17 Jan 2004
  9. Gedron

    Gedron What's a Dremel?

    Joined:
    31 Oct 2003
    Posts:
    249
    Likes Received:
    0
    I'm looking at making a JDM Programmer with info I found on this link. There are better views of the schematic and board layout as well as a parts list.

    Is this model missing something you can see? Perhaps a better place/version you would reccomend?
     
  10. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    using the 16F84 with a JDM programmer won't work.. it least i could'nt get it working... normally you need some cind of buffer... if you still DO get it working i would be really thankful if you told me how.. ;)

    anyway.. i liked the idea, so i'm making some chematics right now... only using standard CMOS circuits.. mabye i'll go for TTL... not sure yet... i will design it for 24 hours...

    powering it off an USB port won't be any problem... even though you will have have to set it each time you turn off you'r comp... (damn.. i have to put in some sort of backup battery... mabye a CMOS battery for computers will work... )

    setting it will be a matter of pressing one button for hour and one button for minutes... (should i make one for seconds aswell? or should i just make a resetbutton? that could be great if the clocks are to be syncronized(sp??)...)


    the only problem i have at the moment is to get the 1Hz oscillator... i devider should fix that, but i don't know how to use crystals as oscillators... can anyone post some chematics?
     
  11. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    http://ourworld.compuserve.com/homepages/Bill_Bowden/dclock.htm shows a xl oscillator & 4020 divider

    Actually, it may be easier to use a cmos4060, 14-stage divide & built-in oscillator, datasheet
     
    Last edited: 17 Jan 2004
  12. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    remeber your not allowed to draw more than a certian amount of current from the USB port without requesting it!

    i can't remeber the amount right now, francily its bad enough i am posting on a forum at 1.30am after comming back from pub + t's room, let alone remeber the USB specification.

    ne way, tap the game port i think thats somehting liek 200ma.
     
  13. star882

    star882 What's a Dremel?

    Joined:
    19 Mar 2003
    Posts:
    925
    Likes Received:
    1
    USB supplies 5V at up to 500mA.
     
  14. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    well... with all the LEDs lit it will draw about 400mA +the current the IC's draw... but if i use "standard" LEDs i can run them on 10mA each.. (they run fine down to 3-5mA)... so i don't think that will be a problem...

    the only problem i have right now is the battery backup... I thought that the battery could run the circuits and the external power could run the LEDs (wich draws most of the current)... i'm not sure if i should go for TTL or CMOS... TTL draws less current, but needs 5 volts.. CMOS can go fine down to 3volts.. but i think they draw a bit more current...

    i'll draw a bit more on this and post later...


    oh! and cpemma: i found how to make a xtal oscillator, however... how do i det 1Hz? how do i devide 32768Hz down to 1Hz?
     
  15. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    eh... a little correction: CMOS draws less current than TTL... looks like i'll go for CMOS
     
  16. cpemma

    cpemma Ecky thump

    Joined:
    27 Nov 2001
    Posts:
    12,328
    Likes Received:
    55
    The 4060B is a 14-stage divider so 32768Hz /214 = 2Hz, add another flip-flop for 1Hz.

    The Fairchild datasheet shows all the component values for the crystal oscillator. :thumb:
     
  17. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    [​IMG]

    so... do you think this will work?

    i made a little change.. i have 3 rows of leds thet shows seconds-minutes-hours...

    not 6 rows (10hours-1hour-10minutes-1minue-10seconds-1second)

    the 6row wersion is no problem, but it requires 3 more IC's... (and i think the 3 row looks more proffesional (and more unique) :rolleyes:
     
  18. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    sorry i didn't explain my point very well
    Your NOT allowed to draw more than about 25ma WITHOUT requesting it.

    Ok, your NOT allowed to just tap the 5v and GND line. Its naughty its bad, and if you do it you will goto hell.

    Normally you request power in i think its 2ma intervals during the device enumeration process, only once ur power request has been accepted can you take the power.

    USB Complete is a good read, but our library is a 15 min walk, and its sunday, and i am lazy.

    In short, don't tap the USB without requesitng it (kinda hard!) so go for the game port!
     
  19. Smilodon

    Smilodon The Antagonist

    Joined:
    25 Mar 2003
    Posts:
    6,244
    Likes Received:
    102
    well... i'm running my LCD off a USB port.. and i have several keyboardlights that run off USB ports... no problems at all... I don't get a reading in the USB powermanagement though.. it just say 0mA...

    anyway.. the powersource can be whatever you want... run it off a molex if you want... USB was just an example..


    BTW: in the chematic i posted: U1 runs hours U2 runs the miutes and U3 runs the seconds... the rightmost LED is LSB and rhe left is MSB
     
  20. TheAnimus

    TheAnimus Banned

    Joined:
    25 Dec 2003
    Posts:
    3,214
    Likes Received:
    8
    Yeh its just taking power without asking for it is an easy way to make intermittent errors occur, the vast majoirty of PC crashes/hardware conflicts etc are because of reclass use of the specification.

    ne way, for the MCU happy people:
    nab yourself a
    "PCF8573P" Real Time Clock i wanted a simpler "PCF8563P" but getting them in single DIP quant. in the UK is too expensive.
    i wanted a "PIC16F688" but they aren't out yet :( so a "PIC16F737" will be used instead.
    "32.768 kHz" crystal
    some bi-polars transistors for the LED common (you might want day of week, month, year etc, if not, you won't need any!)
    "enough" 10k pull ups, 5 + needed
    a 1.2V NiCa cell for clock backup.

    Basically the micro will drive the LEDs/interface with the set time buttons (part of me wants to make its time set over rs232, and do away with buttons) The 1.2v cell will be used to keep the clock ticking when the power is off. Part of me is toying with the idea of using Bi-Colour LEDs to show an "alarm". So you could set an alarm time, and watch it chash up, Anyway the above *should* work together from data sheet skim reading, but its only ment as some pointers for those wanting to use a micro.

    Also any micro could be used, i just chose the 16F737 because its cheap, internal oscillator'd, and has an I2C bus controll, so makes that a lot easyer for us.
     

Share This Page