Shop OBEX P1 Docs P2 Docs Learn Events
$2 Clock Kit - Page 5 — Parallax Forums

$2 Clock Kit

1235789

Comments

  • jmg wrote: »
    erco wrote: »
    That's my clock, but different from your PCB.

    Is the pin-mapping the same ? - can one MCU be used to test another board ?
    I'm hoping my second clock kit will have the same board and hence the same MCU. If not, it was only $2.19 and I can just build the new kit and hope it works better than the first.

  • It's yet too soon to be ensured of the exact board model you'll receive, when the new one finally reaches your hands.
    Anyway, its good to observe that the one that is actually being promoted at ebay, is a someway cleaner version, of the same basic circuit.

    They obviously eliminated the diodes and resistor associated to an eventual battery input connector.

    They also seems to got rid of the 4k7 resistor that was paralleling the internal ~100k, available at the RST pin. Perhaps they also improved a bit the 10uF reset cap quality, so the external resistor isn't needed, no more.

    Unfortunatelly, in the quest for the smalest possible cost, they also got rid of the 100uF electrolitic filter cap. It sure will demmand a bit more attention, towards having a cleaner (noise-wise) 5V supply.
  • ercoerco Posts: 20,257
    edited 2018-04-04 01:52
    Another "C51" clock kit for somebody who likes soldering LEDs a lot more than I do... https://www.ebay.com/itm/4-Digit-LED-Electronic-Clock-Kit-C51-Time-Temperature-Light-Sensor-LED-DIY/202274005923

    s-l1600.jpg
  • It didn't occur to me when I ordered this clock that the source code does not seem to be available so if you want to modify it you have to write your own from scratch.
  • This is the clock we should all be assembling! It uses an AVR processor and displays the time in binary.

    https://www.ebay.com/itm/DIY-electronic-Kit-Binary-Clock-24-LED-atmega8-real-time-DS1302-SMD-Arduino/292374766763?hash=item4412e4e4ab:g:DDcAAOSwmgJY6gr2

    Of course, it's quite a bit more expensive and requires SMD soldering.
  • jmgjmg Posts: 15,175
    edited 2018-04-04 03:34
    David Betz wrote: »
    It didn't occur to me when I ordered this clock that the source code does not seem to be available so if you want to modify it you have to write your own from scratch.

    If you cannot find a listing (seems there should be one somewhere...), you might be able to read back the code, if the part is not secured ?
    See the data for pgm details, just needs fixed pins, and a pulse on XTAL1 outputs the next read byte. Unclear if you need to pulse Vpp, but I think just RST _/= is enough to start RD with RST=H
    There is also a device ID read you can use to check connections.

    A quick Google does find the attached ASM source, here - but a quick look Assembles ok, but I think it's for a stop-watch, and not a clock. Circuit looks very similar, may need some pin-remap.
    My quick Sim shows a LED MUX active, but I cannot make it count ?

    Addit: more source (in C) for another variant is here - but I think is truncated ?

    Addit: more C source attached below, this one from http://atmega32-avr.com/clock-controllerv1-1-using-at89c2051/
  • Thanks for the link! Interestingly, there are comments suggesting that the ATtiny4313 can be swapped for the AT89C2051. It would certainly be easier to program.
  • ercoerco Posts: 20,257
    edited 2018-04-04 03:57
    This line follower also uses the AT89C2051. Must be a cheap chip!

    https://www.ebay.com/itm/401516975526

    Edit: under a buck per chip here


  • jmgjmg Posts: 15,175
    edited 2018-04-04 04:27
    David Betz wrote: »
    Thanks for the link! Interestingly, there are comments suggesting that the ATtiny4313 can be swapped for the AT89C2051. It would certainly be easier to program.

    Needs a new post to attach - this is a SDCC compatible C source file, from links on here http://atmega32-avr.com/clock-controllerv1-1-using-at89c2051/, via wayback...
    It would need pin-remap and some tweaks.
  • jmgjmg Posts: 15,175
    edited 2018-04-04 04:30
    jmg wrote: »
    Needs a new post to attach - this is a SDCC compatible C source file, from links on here http://atmega32-avr.com/clock-controllerv1-1-using-at89c2051/, via wayback...
    It would need pin-remap and some tweaks.

    and this one is newer version, called Source Code clock3.c, and SCH - looking very close to the kits now... tho the buttons may map differently.

  • Cluso99Cluso99 Posts: 18,069
    erco wrote: »
    Another "C51" clock kit for somebody who likes soldering LEDs a lot more than I do... https://www.ebay.com/itm/4-Digit-LED-Electronic-Clock-Kit-C51-Time-Temperature-Light-Sensor-LED-DIY/202274005923

    s-l1600.jpg
    Saw those when I ordered my 6 digit clocks. Still waiting. My 2 grandchildren are about to have school holidays so I thought the clocks would be a good soldering lesson for them.
  • jmgjmg Posts: 15,175
    David Betz wrote: »
    Actually, I'm wrong. In fact all of the LEDs come on at one time or other although only one at a time. I also hear beeps from the speaker sometimes. This always happens only right on power up and never later.
    If you are sure the power supply is clean, and not sagging, I did find this interesting bug in the Start:Stop Timer, (which is why it failed to run on Sim Debug properly).
    ;           MOV SP,STACK           ;Original broken line
                    MOV SP,#STACK      ;Fixed, correct stack INIT
    

    ie old code was loading stack from random memory value, instead of that stack base location. result is a lottery for actual Stack, which == erratic startup.
    Not CLOCK code, but just maybe they made the same error - with such low RAM usage MOST of the time, this would work.
    eg If you try 100 deep power downs (short Vdd/Gnd) do any start better than others ?
  • jmg wrote: »
    David Betz wrote: »
    Actually, I'm wrong. In fact all of the LEDs come on at one time or other although only one at a time. I also hear beeps from the speaker sometimes. This always happens only right on power up and never later.
    If you are sure the power supply is clean, and not sagging, I did find this interesting bug in the Start:Stop Timer, (which is why it failed to run on Sim Debug properly).
    ;           MOV SP,STACK           ;Original broken line
                    MOV SP,#STACK      ;Fixed, correct stack INIT
    

    ie old code was loading stack from random memory value, instead of that stack base location. result is a lottery for actual Stack, which == erratic startup.
    Not CLOCK code, but just maybe they made the same error - with such low RAM usage MOST of the time, this would work.
    eg If you try 100 deep power downs (short Vdd/Gnd) do any start better than others ?
    Actually, I've never had the clock come up and actually work. The best I've seen is slight flashes in one of the LEDs or maybe a chirp on the speaker. Even those are infrequent.
  • erco wrote: »
    Another "C51" clock kit for somebody who likes soldering LEDs a lot more than I do...

    Blue LEDs look cool, but don't put this where someone is expected to sleep. Really can mess with a person's Circadian rhythm.

  • ercoerco Posts: 20,257
    David Betz wrote: »
    It didn't occur to me when I ordered this clock that the source code does not seem to be available so if you want to modify it you have to write your own from scratch.

    Wow... that would be a huge "re-inventing the wheel" effort. And require a lot of (wait for it...) TIME to calibrate. I wonder if the existing software is temperature calibrated to adjust for thermal drift? Some MCUs can swag ambient temperature.

  • erco wrote: »
    David Betz wrote: »
    It didn't occur to me when I ordered this clock that the source code does not seem to be available so if you want to modify it you have to write your own from scratch.

    Wow... that would be a huge "re-inventing the wheel" effort. And require a lot of (wait for it...) TIME to calibrate. I wonder if the existing software is temperature calibrated to adjust for thermal drift? Some MCUs can swag ambient temperature.
    Yeah, I know. It should be pretty easy to write new code. Heck, there's only 2K of code space on that MCU. How much code could there be? :-)

  • K2K2 Posts: 693
    edited 2018-04-04 18:09
    A few years ago, IC Station offered a kit to produce a large ring of WS2812 RGB LEDs. Once assembled, it looked something like this. They still offer a smaller ring kit, but the big ring seems to have gone away. Now I'm sorry I bought only one.

    Anyway, I think the ring is a great idea for displaying seconds (while a conventional HH:MM display is centered inside the hoop). A multitude of dynamic color schemes could be used to mark the advancing seconds, far beyond a single LED or a single color.

    Of course there is no better way to drive a large string of RGB LEDs than with a Propeller. :)

    Edit: Banggood seems to be carrying the same thing.
  • jmgjmg Posts: 15,175
    edited 2018-04-04 21:37
    David Betz wrote: »
    erco wrote: »
    David Betz wrote: »
    It didn't occur to me when I ordered this clock that the source code does not seem to be available so if you want to modify it you have to write your own from scratch.

    Wow... that would be a huge "re-inventing the wheel" effort. And require a lot of (wait for it...) TIME to calibrate. I wonder if the existing software is temperature calibrated to adjust for thermal drift? Some MCUs can swag ambient temperature.
    Yeah, I know. It should be pretty easy to write new code. Heck, there's only 2K of code space on that MCU. How much code could there be? :-)

    FYI, the ASM code for the stopwatch timer above, is ~ 750 bytes, and the C Clock3 code needs minor update edits to compile on SDCC with 4 warnings, to 1016 bytes.
    Either could be used as a basis.
    Note the tiny4313 has lower pin drive ability than the 2051, and reset needs inverting. The direct mux drive here, pushes the micro a little..

    Addit:
    More source is here https://github.com/zerog2k/stc_diyclock
    and here https://github.com/aFewBits/stc-led-clock
    Those are not quite the same hardware designs, but are 8051 cores, low pin count, and MUX leds, so could port to these kits easier than starting with a blank-page.
  • jmgjmg Posts: 15,175
    erco wrote: »
    I wonder if the existing software is temperature calibrated to adjust for thermal drift? Some MCUs can swag ambient temperature.
    hehe, the time/stopwatch code I ran above, came in at 'almost' one second viz .990305, .990485, .990583 ~.991383 ;) ( off, and with interrupt jitter, not much point in tempco on that ! )
    Some quick & simple fixes, to lock in a 4.0000ms tick, and use that, and that now reports 1.000s within the Sim jitter.

    The 12MHz Xtals are much more temperature stable than 32kHz ones, so there is not much point in chasing thermal drift.

    I was just now pondering doing a GPS 1pps calibrate readout, to allow a compile-time zero correction of the Xtal variation, likely a few 10's of ppm.
    Next step would be a TCXO, and the clipped sine GPS ones are high precision, low cost, and should AC couple into XTAL1 ok.


  • ercoerco Posts: 20,257
    My bigger 6-digit clock kit arrived today, must carve out some build time soon.
  • ercoerco Posts: 20,257
    Here's a handy $3 lamp that worked well for soldering my $2 clock.

    https://www.ebay.com/itm/232130777450
  • erco wrote: »
    Here's a handy $3 lamp that worked well for soldering my $2 clock.

    https://www.ebay.com/itm/232130777450
    Did your $2 clock work when you finished soldering it? I sent them a message on eBay about mine and they asked me to send pictures of my PCB. I sent the pictures but haven't heard anything back. I'm still suspecting an unprogrammed MCU.

  • jmgjmg Posts: 15,175
    David Betz wrote: »
    .... I'm still suspecting an unprogrammed MCU.
    Yes, something is suss...
    Can you pgm AT89C2051, or have someone nearby who can pgm AT89C2051 ?
    or, there is a sub $10 ZIF40 programmer on eBay that includes AT89C2051 - search SP200S programmer.

    I've modified the timer/stopwatch code I grabbed, to allow easy pin remap and LED polarity flip, so that could remap to your PCB design ?
    - at least give you a board that does something :)
    Looks like it can mange 1s LSB mm:ss, but the code is quick enough to allow tenths/hundredth/milliseconds LSB , for LAB timing uses ?

  • jmg wrote: »
    David Betz wrote: »
    .... I'm still suspecting an unprogrammed MCU.
    Yes, something is suss...
    Can you pgm AT89C2051, or have someone nearby who can pgm AT89C2051 ?
    or, there is a sub $10 ZIF40 programmer on eBay that includes AT89C2051 - search SP200S programmer.

    I've modified the timer/stopwatch code I grabbed, to allow easy pin remap and LED polarity flip, so that could remap to your PCB design ?
    - at least give you a board that does something :)
    Looks like it can mange 1s LSB mm:ss, but the code is quick enough to allow tenths/hundredth/milliseconds LSB , for LAB timing uses ?
    I don't have a way to program the AT89C2051. I'm wondering if they locked the flash when they installed the clock program. Of course, I'm claiming they probably forgot to program the chip and if that's the case then it probably isn't locked. I think I found an Arduino program for programming the AT89C2051. I guess I could try that.

    Here's the link to the Arduino programmer article: http://ceptimus.co.uk/?p=216
  • jmgjmg Posts: 15,175
    David Betz wrote: »
    Here's the link to the Arduino programmer article: http://ceptimus.co.uk/?p=216
    That looks ok, tho for that amount of wiring, I'd probably favour the sub $10 eBay programmer (free shipping) , with ZIF included...

    David Betz wrote: »
    I don't have a way to program the AT89C2051. I'm wondering if they locked the flash when they installed the clock program. Of course, I'm claiming they probably forgot to program the chip and if that's the case then it probably isn't locked. I think I found an Arduino program for programming the AT89C2051. I guess I could try that.
    Even if locked, an Erase allows you to reprogram. It would be worth trying to read the device, just in case there is code that is not secured, that is largely ok.

    Can you confirm this schematic from a earlier post, is for your PCB ?
  • David BetzDavid Betz Posts: 14,516
    edited 2018-04-05 22:19
    jmg wrote: »
    David Betz wrote: »
    Can you confirm this schematic from a earlier post, is for your PCB ?
    That's not exactly my circuit. Mine has an additional resistor, a couple of diodes and an additional cap. It supports either a 3V or a 5V power supply. I've only tried the 5V supply input though.

  • jmg wrote: »
    David Betz wrote: »
    Here's the link to the Arduino programmer article: http://ceptimus.co.uk/?p=216
    That looks ok, tho for that amount of wiring, I'd probably favour the sub $10 eBay programmer (free shipping) , with ZIF included...
    Got a link?

  • David Betz wrote: »
    jmg wrote: »
    David Betz wrote: »
    Here's the link to the Arduino programmer article: http://ceptimus.co.uk/?p=216
    That looks ok, tho for that amount of wiring, I'd probably favour the sub $10 eBay programmer (free shipping) , with ZIF included...
    Got a link?
    Maybe this one although it's close to $20.

    https://www.ebay.com/itm/51-MCU-programming-support-AT89C52-24C02-93C46-300-kinds-of-chip-USB-burner/291961336451?hash=item43fa407283:g:OdoAAOSwmgJY52CH
Sign In or Register to comment.