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

$2 Clock Kit

1234689

Comments

  • jmgjmg Posts: 15,175
    edited 2018-04-05 23:53
    David Betz wrote: »

    Very close, but search for SP200S programmer to get a number of listings of variants of the same thing....
    I the the SP200SE (for enhanced ?) is what you need ?

    hmm, downloaded that & I see that supports AT89C/AT89S, but does not mention AT89LP, (but does do some SPI AVRs ? ) seems development stopped a while ago, and they moved onto more advanced programmers for $$$ ?
    There is Ardunio info for AT89LP Programmer - No Vpp, simpler wiring.

    An alternative is to just buy an AT89LP2052, and SPI pgm that, no Vpp needed. Appears to run AT89C2051 code at same speed, in default modes. Oops, was thinking of AT89LP51RB2...
    Turns out the AT89LP2052 does not start-up quite the same, core is always faster and timers also always faster - so a 2052 build is needed.
  • jmgjmg Posts: 15,175
    edited 2018-04-05 22:39
    David Betz wrote: »
    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.
    It's this pin mapping I wanted to check : (modify to match your PCB, if needed - short P3.0. then short each of P1.1..P1.7, to confirm left digit, a..f mapping)
    IF Pinout_dBetz=1
    
    SEG_A    BIT     P1.7    ; Hi removes shunt
    SEG_B    BIT     P1.5
    SEG_C    BIT     P1.2
    SEG_D    BIT     P1.3
    SEG_E    BIT     P1.4
    SEG_F    BIT     P1.6
    SEG_G    BIT     P1.1
    
    DIG_1    BIT     P3.0    ; LOW Enables leftmost DIGIT
    DIG_2    BIT     P3.1
    DIG_3    BIT     P3.2
    DIG_4    BIT     P3.7
    
    START    BIT     P3.4    ; Push Button, LOW = closed assumed
    STOP     BIT     P3.5    ; Push Button, LOW = closed assumed
    RESETS   BIT     P1.0    ; unused in code, use for 1s toggle check = INT0
    CRO_P32  BIT     P1.0
    
    BUZZER   BIT     P3.3    ; Low beeps
    ; ~~~~~~~~~~~~~~~~ Edit below 6 lines to suit PCB design 
    SEG_ON  MACRO    SEG_pin
            SETB     SEG_Pin  ; active HI  (Shunt drive)
    ;        CLR      SEG_Pin  ; Active LO   (series drive)
    ENDM
    SEG_off  MACRO    SEG_pin
            CLR      SEG_Pin  ; active HI  (Shunt drive)
    ;        SETB      SEG_Pin  ; Active LO  (series drive)
    ENDM
    DIG_ON  MACRO    DIG_pin
    ;        SETB     DIG_Pin  ; active HI  (Trx Drive)
            CLR      DIG_Pin   ; Active LO  (No Trx)
    ENDM
    DIG_off MACRO    DIG_pin
    ;        CLR     DIG_Pin   ; active HI  (Trx Drive)
            SETB      DIG_Pin  ; Active LO  (No Trx)
    ENDM
    
    BUZ_off MACRO    BUZ_pin
    ;        CLR     BUZ_Pin   ; active HI   (Mosfet?)
            SETB      BUZ_Pin  ; Active LO  (PNP Trx)
    ENDM
    BUZ_ON MACRO    BUZ_pin
    ;        SETB     BUZ_Pin   ; active HI  (Mosfet?)
            CLR      BUZ_Pin  ; Active LO  (PNP Trx)
    ENDM
    
    else ;original pinout/polarities
    
    

  • jmg wrote: »
    Very close, but search for SP200S programmer to get a number of listings of variants of the same thing....
    I the the SP200SE (for enhanced ?) is what you need ?
    Maybe this one? It says it can handle the AT89C2051. I don't really want to use one of the newer chips because they're a lot more expensive and are out of stock in most places I checked.

    https://www.ebay.com/itm/Microcontroller-24-93-Series-EEPROM-Programmer-Boost-SP200SE-SP200S-24-93-SP200-/171470388355
  • jmgjmg Posts: 15,175
    David Betz wrote: »
    jmg wrote: »
    Very close, but search for SP200S programmer to get a number of listings of variants of the same thing....
    I the the SP200SE (for enhanced ?) is what you need ?
    Maybe this one? It says it can handle the AT89C2051. I don't really want to use one of the newer chips because they're a lot more expensive and are out of stock in most places I checked.

    https://www.ebay.com/itm/Microcontroller-24-93-Series-EEPROM-Programmer-Boost-SP200SE-SP200S-24-93-SP200-/171470388355

    Sure, that looks good.
    If you can score the "new version' image, with STC 90C58RD+, that looks to have loader support in their STC-ISP (Ver6.86L) , which means you could upgrade the firmware, if you can ever locate code for that.
    If you confirm / fix the pin map, I can post a hex file that will light things up...


  • jmg wrote: »
    David Betz wrote: »
    jmg wrote: »
    Very close, but search for SP200S programmer to get a number of listings of variants of the same thing....
    I the the SP200SE (for enhanced ?) is what you need ?
    Maybe this one? It says it can handle the AT89C2051. I don't really want to use one of the newer chips because they're a lot more expensive and are out of stock in most places I checked.

    https://www.ebay.com/itm/Microcontroller-24-93-Series-EEPROM-Programmer-Boost-SP200SE-SP200S-24-93-SP200-/171470388355

    Sure, that looks good.
    If you can score the "new version' image, with STC 90C58RD+, that looks to have loader support in their STC-ISP (Ver6.86L) , which means you could upgrade the firmware, if you can ever locate code for that.
    If you confirm / fix the pin map, I can post a hex file that will light things up...

    I'm not sure I understand. Do you mean that if I don't get the board with the STC 90C58RD+ chip on it I won't be able to reprogram my AT89C2051?

  • jmgjmg Posts: 15,175
    edited 2018-04-06 09:15
    David Betz wrote: »
    I'm not sure I understand. Do you mean that if I don't get the board with the STC 90C58RD+ chip on it I won't be able to reprogram my AT89C2051?
    Sorry if I was unclear - I'm talking here about the programmer firmware, which will (of course) come preloaded.
    Just maybe, there could be some update in the future**, to add new devices, in case that cannot all be done PC-Side.

    Their pictures show more than one PCB design (you have to love Chinese eBay listings !) - the SyncMOS SM8958 I'm not sure how to program, but the STC90C58RD+ shows in the menu of my
    STC-ISP (Ver6.86L) PC software, and I have programmed other STC parts using that PC software and TTLUART-USB bridges.
    (Aliexpress show STC90C58RD+ one for $6.80, free shipping)

    I would expect both/all models to program the AT89C2051 fine, - I've asked the person listed in the Willar Progammer help-about, if AT89LP2052 support is planned, or in some new release ?

    I also find that this link
    https://github.com/PeterVH/ArduinoISP/tree/at89
    from this page
    https://petervanhoyweghen.wordpress.com/

    mentions "Add support for the at89lp2052 and at89lp4052." and used the pairing of [Ardunio + avrdude]
    - from the signatures in the file, (below) that looks to actually mean "Add support for the AT89LP4052 and AT89LP51ED2" - tho edits to signatures are easy to do.

    That makes AT89LP4052 looking hassle free to add ?

    avrdude -C avrdude-at89lp.conf -P /dev/ttyACM0 -b 19200 -c stk500v1 -p lp51 -U flash:w:knight-rider.ihx

    & the provided config file avrdude-at89lp.conf, has everything the avrdude SPI interface needs to know about the lp51 or lp40

    checking that .conf
         id            = "lp40";
         desc          = "at89lp40";
         stk500_devcode   = 0xF0;
         signature        = 0x1E 0x45 0xFF;   
    

    Data says
    AT89LP2052: 1EH 25H FFH
    AT89LP4052: 1EH 45H FFH << OK for above conf sig line. Pin compatible with AT89C2051, but faster. No Vpp needed, SPI pgm
         id            = "lp51";
         desc          = "at89lp51";
         stk500_devcode   = 0xF1;
         signature        = 0x1E 0x64 0x65;
    
    Data says
    AT89LP51: 1EH 54H 05H
    AT89LP52: 1EH 54H 06H
    AT89LP51RB2 1EH 62H 72H 58H D7H ECH EFH
    AT89LP51RC2 1EH 63H 72H 58H D7H ECH EFH
    AT89LP51IC2 1EH 63H 69H 58H D7H ECH EFH
    AT89LP51RD2 1EH 64H 72H 58H D7H ECH EFH
    AT89LP51ED2 1EH 64H 65H 58H D7H ECH EFH << OK for above conf sig line.
    AT89LP51ID2 1EH 64H 69H 58H D7H ECH EFH


    Addit: ** There is some suggestion of source for the firmware, at least for non-enhanced, but I've not located a live link yet,.
  • Cluso99Cluso99 Posts: 18,069
    My pair of 6-digit clock kits arrived today. Just in time for school holidays in a weeks time.
    Hoping not to have the problems with the micro :(
  • ercoerco Posts: 20,257
    I built my 6 digit clock but she's got problems. I've been over the board several times. The chip gets warm after a few seconds so I unplug it. It's weird, there are ~17 resistors, all 1 ohm. That feels wrong to me. No schematic.

    So I'm batting .500 on my clock kits. I need to build another 4-digit one to get back in the game!

  • ercoerco Posts: 20,257
    Well I guess I found the problem! All those 1-ohm resistors are wildly wrong, if the schematic at http://www.icstation.com/electronic-clock-digital-display-module-electronic-suite-p-2042.html is right. With some serious unsoldering, perhaps I can salvage my reputation. If the magic smoke remains intact.

    Note to other 6-digit C51 builders: Don't rush, check everything!
    950 x 1100 - 594K
  • Cluso99Cluso99 Posts: 18,069
    My kit has 1K and I think 2K resistors. I only had a quick look at the pcb and I recall seeing the 1K resistors whenitook the pcb from the bag.
    Yep, you learn to just recognise resistors without thinking about the band colors.
  • In order to make myself feel a little better after my failure with the clock kit I assembled a Micromite Backpack kit I bought a long time ago. It works perfectly! It's kind of cool. It has a PIC MCU programmed with Micromite BASIC and attaches to the back of a 2.8" LCD.

    http://geoffg.net/MicromiteBackpackV1.html
  • MikeDYurMikeDYur Posts: 2,176
    edited 2018-04-07 13:04
    Way late for the digital clock party, but thanks to erco, he has brought me back from a lonely disinterested purgatory.

    One of the first kits I put together was a digital clock, printed circuit board and parts, and I had to come up with power supply, switches and a cabinet. To this day I couldn't tell you what it was based on, a single chip if I remember.

    But I had that digital LED clock that was all the rage in the mid 70s, and didn't have to depend on noisemakers anymore, especially the ones that flipped a digit @ one minute intervals.

    Trying to take advantage of these cheap kits before the last boat sails, because it is comforting to just solder something sometimes.
    I'll hold on to the memories, because there are to many cheap thrills out there now, and we will have to dispose of the junk someday.
    But quality is resellable, and I can't afford to put too much money in something that will be produced even cheaper, and eventually they will be paying us to take it off there hands.

    Hoping I will still be welcome here with people of similar interests and friends that I wish I have made, as I did not have any thoughts of other microcontrollers.
    Anyway I sure do miss the camaraderie and all the fun around the Parallax Forums, the rest of the world is just kind of faceless and bland.

    BTW: And yes I will behave Jim.

    Well I made an attempt, but will not beg for forgiveness. I personally done nothing to be ashamed of, but post a couple of off topic threads. There must be an underlying problem here, as I have read comments on the loss of forum members. Never bothered to look what was said about me after I left, but can only imagine that it was a feeding frenzy, the element of a wolf pack on a single lamb comes to mind.
    I would be happy to leave, if someone would delete my account, or tell me how to do it. Now is the time to go while I can still hold my head up high.

    Mike
  • Erco,

    Sometimes it's hard to tell what the color on those Chinese made resistors are so someone might have grabbed the wrong ones or they were placed in the wrong bin.
    What's the seller's rating? You might get another kit or a refund.


    David,

    Was your uC in conductive foam or an ESD bag?
  • Genetix wrote: »
    David,

    Was your uC in conductive foam or an ESD bag?
    It was in conductive foam.

  • ercoerco Posts: 20,257
    edited 2018-04-07 04:33
    Fortunately I just got a hoard of 1K resistors. Let's see what happens with a beer and a few soldering irons.

    Wait... strike that, reverse it.

    Edit: Success!



  • K2K2 Posts: 693
    erco wrote: »
    Here's a handy $3 lamp that worked well for soldering my $2 clock.
    https://www.ebay.com/itm/232130777450
    Can't beat "...good feelings and strong brightness!"
    erco wrote: »
    I built my 6 digit clock but she's got problems. I've been over the board several times. The chip gets warm after a few seconds so I unplug it. It's weird, there are ~17 resistors, all 1 ohm. That feels wrong to me. No schematic.
    My six-digit clock kit came with seven 470 Ohm resistors, seven 4.7k resistors, and a couple of 10k resistors. They seem to be well-chosen as the intensity of the colon LEDs match the intensity of the seven segment displays well.

    It came with a decent schematic that I could scan and post here if it would be of any help.

  • Hi K2

    Although I've didn't yet came to the party with my own one (cause, in fact, I've didn't yet ordered one), it seems there are even more variants available for that kind of kit, than there are for the Influenza virus.

    And all we know the more samples of some virus we could get, the better the chances we could produce new vacines, to get rid of the bad effects they use to produce.

    Then, if you could put some information about your kit into the pool, it'll surelly help others too.

    Henrique
  • jmgjmg Posts: 15,175
    edited 2018-04-07 03:57
    David Betz wrote: »
    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.

    Did you check the pin-mapping I listed above against your PCB/LED ?
    I've added COLON flash and IDLE features to the UpTimer, when the Pin-map is confirmed I can upload it.

    General Summary:
    To (re)Pgm AT89C2051, the eBay/AliExpress ZIF40 programmers that find on search for SP200SE look good for $6.80
    Newer ones with STC90C58RD+ will allow firmware changes to the programmer, (but no read-of-old firmware-code).
    I'm tempted to buy 2 or 4, so I can keep one for 89C2051, and fiddle with code in the others :)

    To Pgm alternatives of AT89C2052/4052, the avrdue with config file above works.

    For other possible Clock examples, I did find an active C51 Clock code base here (2 buttons, 4 digits)
    https://github.com/zerog2k/stc_diyclock/releases
    That's a different PCB/MCU, but still same C51 core. - remap of PCB looks ok, as SEGs are all on one port, DIG on another, only wrinkle is
    your DIG are not adjacent, so if-else is needed.

    Written in C, one variant I checked mapped like this
     0x5be      = 1470  main
    0x622-0x5be = 100   adc
    0x91e-0x622 = 764   ds1302
    0xa03-0x91e = 229   Libs
    TOP                2563
    
    ie just too large for AT89C2051, (ok in AT89C4051 etc), but that code includes ADC and DS1302 read, features not present in the sub $2 DIY Clocks.
    Strip that, and you have 350 bytes spare, for SW clock H:M:S to fit inside the 2051.

    If your code ambitions go above 4k :) - AliExpress have
    STC12C5616AD-35I-PDIP20 ($8.78/10 FS) 16kF 4kEE << plenty of code headroom. Pin equiv to 89C2051.

    To pgm STC parts (STC12C5616AD-35I-PDIP20, STC90C58RD+) needs USB-UART.TTL, and PC software - there is
    STC-ISP - STC's own GUI
    or
    https://github.com/grigorig/stcgal
    That Python stcgal ( the name is a play on avrdude ) is quite broad in the STC support, and is command line.
    Probably be useful for Prop1/Prop2 downloads too... more Python downloaders are appearing
  • K2K2 Posts: 693
    edited 2018-04-07 04:47
    Yanomani wrote: »
    ...if you could put some information about your kit into the pool, it'll surely help others too.
    Henrique

    Six-digit clock schematic:
    six_digit.jpg

    Four-digit clock schematic:
    four_digit.jpg
    1805 x 1332 - 359K
    1295 x 916 - 416K
  • K2K2 Posts: 693
    SD.jpgFD.jpg
    3665 x 2821 - 698K
    3263 x 2603 - 505K
    SD.jpg 698.4K
    FD.jpg 505.1K
  • jmgjmg Posts: 15,175
    K2 wrote: »
    Four-digit clock schematic:
    A LED part I found indicated the DP drives the upper colon DOT with DIG3 and the lower colon DOT with DIG4, so you can drive them independently if you wanted to.
    Can anyone with a board, confirm that internal setup ? (the other decimals are not connected to anything)

  • Here is the source code for the "4 bits clock". The comments are a bit hard for me to read.
  • Cluso99Cluso99 Posts: 18,069
    My 6-digit clock has 3 buttons and no battery. I'll post a pic as soon as I can.
  • ercoerco Posts: 20,257
    Cluso99 wrote: »
    My 6-digit clock has 3 buttons and no battery. I'll post a pic as soon as I can.

    Mine is like Cluso's. I got her working, I added a video update about 8 posts back.

    I also received a kit yesterday for the 4-digit square board variant that David Betz has.

    Related, I'll try to connect a power bank as a backup battery/base. K2 has the only board I've seen with a coin battery backup, at the expense of a beeper.
  • YanomaniYanomani Posts: 1,524
    edited 2018-04-07 17:25
    A warning about coin cell batteries does applies here:

    As can be seen at some of those cheap clock circuits, the coin battery holder has/could have a silkscreened label near it (it could be also stated somewhere, e.g. schematic or data/instruction sheet), stating it is meant to have a CR2032 type cell mounted at that position.

    THIS IS A PLAIN WRONG STATEMENT, POSSIBLY LEADING TO SOME DANGEROUS SITUATIONS, ONLY TO SAY A MINIMUM.

    CR2032 type cells, by design, are not intended to be recharged.

    LR2032, LIR2032 and alike li-ion batteries are indeed designed to be recharged, and also displays a slightly higher voltage, about 3.6V, what, based on the clock circuits I'd seen till this moment, could be a wise improvement to help maintaining the 89C2051 working in the Low-power idle mode, if it has been programmed to do so (at least it someway compensates for the diode drop it the supply path, towards the microcontroller).

    Those batteries also have an embossed print at their bodies, stating they are recahargeable, thus, safe to be used at this type of circuit.

    In low-power idle mode, and provided the display and other power consuming circuits could be isolated from the 3V (~3.2V) supply, the microcontroller will keep working at the intended 12MHz (based on available schematics and datasheets) and it'll only need to have the 5V power supply restored, in order for the display and other circuits to properly work, and the battery cell would be recharged, thru the ~4k7/10k resistor, mounted in parallel with the diode that avoids directly connecting the 3.6V cell to the 5V supply.


    As currently designed at theese boards, the 89C2051 isn't meant to enter its Low-power idle mode, because, doing so, would put the cpu into sleep, thus incapable of keeping the clock/timer programm runing.

    ATM, the 3V power input circuit, as provided at the boards that implemented it, only avoid excessively draining the cell battery, since, at ~3V, the 89C2051 will only consume about 4-5mA, wich is aproximately half its consumption, when powered by ~5V.

    As for the cell-charging series resistor, I haven't yet studied if this is a good/safe circuit for the intended purpose. Some concerns could arise about that setup doesn't having any provisions to limit the recharge voltage to the maximum safe level and charge rate of the battery used. More to come...

    Henrique

    P.S. Low-power idle mode entering/exiting is explained at the AT89C2051 datasheet. Some provisions should be made to ensure its effectiveness.

    P.S. II - I should have done a thoroughly read at it (datasheet explanation about low-power idle mode) and should also had it completely understood, before posting something about it. Sorry.
  • ercoerco Posts: 20,257
    edited 2018-04-07 17:56
    Splurge: the 6-digit kit is $3 now: https://www.ebay.com/itm/263466631219

    4-digit ~$1.78: https://www.ebay.com/itm/263452474429
  • erco wrote: »
    Splurge: the 6-digit kit is $3 now: https://www.ebay.com/itm/263466631219

    4-digit ~$1.78: https://www.ebay.com/itm/263452474429
    I ordered a programmer and 10 AT89C2051 chips. Let's hope that is enough to get my $2 clock kit working! :-)
  • ercoerco Posts: 20,257




    David Betz wrote: »
    I ordered a programmer and 10 AT89C2051 chips. Let's hope that is enough to get my $2 clock kit working! :-)


    Take the long way home, Boss!

  • jmgjmg Posts: 15,175
    edited 2018-04-07 22:48
    David Betz wrote: »
    Here is the source code for the "4 bits clock". The comments are a bit hard for me to read.

    That's good. Where did you find that ?

    Looks quite close, but seems to drive DIG4 from P3.3, not P3.7 of the SCH ? - can you check your actual PCB layout ? I guess that makes Buzzer P3.7 ? (idles Hi)
    - ah, find a commented line google says is ; CLR P3.7; Alarm output

    Seems to be more DisAsm than original ASM, but I guess that's likely where it came from anyway - someone else's ASM... ;)

    Assembles to 662 bytes and shows 12:00 in the simulator, (P3.3 fixed) I'll leave it running.

    Have to figure out what the buttons mean...

    Now says 12:06, so seems we have a pulse.
    Attached is the HEX file.

    Addit: now shows 14:10 2H04later, so seems to be about right....
    To clarify the HEX file is original code, the P3.3 fix was applied to the Simulator mapping - I think it can be remapped in the code with little effort, if the PCB designs are <>
  • jmgjmg Posts: 15,175
    Yanomani wrote: »
    As currently designed at theese boards, the 89C2051 isn't meant to enter its Low-power idle mode, because, doing so, would put the cpu into sleep, thus incapable of keeping the clock/timer programm runing.
    P.S. Low-power idle mode entering/exiting is explained at the AT89C2051 datasheet. Some provisions should be made to ensure its effectiveness.
    P.S. II - I should have done a thoroughly read at it (datasheet explanation about low-power idle mode) and should also had it completely understood, before posting something about it. Sorry.

    'Low power' is relative in a LED clock, with Shunt segment drive ;)

    However, there is a IDLE mode in the 89C2051 that stops flash read, and runs Xtal+timers+interrupts, and that mode can looks to drop ~9mA to ~1.8mA (5V) or to 0.9mA(3v) on the curves @ 12MHz
    - but the code needs to be written to use interrupts, and IDLE when it can.

    At 12MHz the MCU still draws about 1mA, and the LEDs draw much more than that.

    Best call this a 'not for battery use' clock I think....

Sign In or Register to comment.