Author Topic: watchdog programming ds1286 and others need help  (Read 3431 times)

0 Members and 1 Guest are viewing this topic.

Offline VE2JFQTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
watchdog programming ds1286 and others need help
« on: January 25, 2021, 12:19:24 am »
hello, i have a problem with a ds1286 real time clock. i am a telecom technician, i have 3 ifr com-120b. all three the ds1286 battery has died! i managed to find three ds1286 in montreal, my problem is that i want to read and program them. i'm not a programmer, but i have a tl866 2 plus, but it doesn't take ds1286 or ds1284 (which contains 50bits of data. like time clock, serial number and options. i'm thinking of taking a pic programmer or arduino. I don't know these are two programs! what do you suggest to me? thank you and good day jacques
 

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: watchdog programming ds1286 and others need help
« Reply #1 on: January 25, 2021, 02:10:46 am »
hello, i have a problem with a ds1286 real time clock. i am a telecom technician, i have 3 ifr com-120b. all three the ds1286 battery has died! i managed to find three ds1286 in montreal, my problem is that i want to read and program them. i'm not a programmer, but i have a tl866 2 plus, but it doesn't take ds1286 or ds1284 (which contains 50bits of data. like time clock, serial number and options. i'm thinking of taking a pic programmer or arduino. I don't know these are two programs! what do you suggest to me? thank you and good day jacques

How about carefully sawing open the package (with a fine cutting wheel in a milling machine at a non Dremel tool plastic melting speed), remove the battery and add another battery of the same type on top of the RTC package ?

Beware the dust, don't breathe it, go slow.

Find a friend with an x-ray machine if you need to see where the battery is first.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12862
Re: watchdog programming ds1286 and others need help
« Reply #2 on: January 25, 2021, 04:27:27 am »
If you are sure you need to be able to read/write the DS1286 outside of the equipment that uses it, a PIC programmer *WON'T* help.

An Arduino Uno or Nano has enough I/O pins to access a DS1286.  It needs six address lines (connect to Arduino A0-A5), 8 data lines (connect the two LSBs to digital pins 8 and 9, and the rest of the data bus to digital pins 2-7, matching the data bit number to the arduino pin number mod 8 to make the sketch easier to code#), and three control lines: /CS, /OE and /WE (connect to digital pins 10-12).  The easiest hardware setup would be an Arduino Nano in a solderless breadboard with the DS1286 chip. It only needs max. 15mA  @5V, so you can power it from the Arduino, powered from your PC via USB.  It will need a 100nF decoupling cap between its Vcc pin and GND pin.

Then you need to write a sketch to dump the memory contents.  If you get stuck ask here.   *DON'T* test your sketch on a good chip from your equipment, get a spare or use one that's failed and been hacked to replace the battery.  During development, use 3K3 resistors in series with the data lines to prevent disaster if you accidentally enable /OE and /CE with the data bus pins set as outputs in the sketch.  Once you've got that working we can help you add the ability to write data to specific registers/locations, and once that's tested and working you can risk pulling a good chip to dump it so you can program the replacements.

N.B. *ALL* N.O.S. DS1286 modules are date expired.  They only are specified for a ten year operating or shelf life from date of manufacture and Maxim discontinued production back in 2006, so any old stock you can find is  already at 150% of its expected lifespan and is likely to either have a dead battery or to fail within a couple of years.

Re: Techman's suggestion, the battery can be approximately located with a small powerful magnet. 

There's a thread on how to Dremel in to the battery connections and patch in an external CR2032 coin cell here: https://forums.irixnet.org/thread-1370.html
However I would recommend using a small cylindrical burr from a set of Dremel burr bits rather than a drill bit to grind away enough epoxy to expose the battery pins.  Thinner wire would make a neater job of connecting the added battery holder.  If you don't have clearance above the chip, it could be located elsewhere.

I *DON'T* recommend the approach used in the attached photos I found on Google,  :palm:  :scared: but they do give you an idea of the battery and crystal locations.

# ATmega328P based Arduinos, including the Uno and Nano use digital pins 0 and 1 to communicate serially with the host PC, so you can't simply use digital pins 0-7 (AVR port D) for the data bus.  The choice of pins above uses the six upper bits of port D and the lower two of port B, so you can split the data between them on write and combine them on read using direct AVR register access and C bitwise logic operators rather than having to loop through reading or writing each byte one bit at a time using the Arduino single pin access library functions digitalWrite() and digitalRead().  Similarly you'll be setting the address directly on A0-A5 by writing port C.
« Last Edit: January 25, 2021, 01:51:09 pm by Ian.M »
 

Offline VE2JFQTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
Re: watchdog programming ds1286 and others need help
« Reply #3 on: January 25, 2021, 01:41:35 pm »
thank you. i will try the arduino! right now, I have some ds1286! so two that works fine for the time clock, but I don't have the data that is missing for my options on my device. that will come one day! what i dont understand is why i have ds1286 so the internal battery is good (because with my dremel i removed epoxy (to be able to read 3 volts from the internal battery) but when i place it in my device, I have no real time clock ???and other ds1286 whose battery has died, i add an external battery to the ic, did not come back to life? thank you and have a good day Jacques
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12862
Re: watchdog programming ds1286 and others need help
« Reply #4 on: January 25, 2021, 02:06:39 pm »
Check the signal on the SQW pin.  It should be a 1024Hz squarewave, enabled whenever Vcc is present.  If its missing, the oscillator has failed.   If its one you Dremelled to expose the battery, its likely you damaged or disconnected the crystal, which is why its advisable to only dremel the minimum to expose the battery pins from the side while holding the module in a vice to damp vibration.

OTOH, if SQW is present but date/timekeeping isn't working, the timekeeping registers may have invalid contents that prevent the device its in from using the date/time.  You'll need to program an Arduino with a sketch that initializes it with the current time, then repeatedly prints the date/time from it, and also lets you 'nudge' each of the timekeeping registers to just before the next rollover for that register so you can check its incrementing the next higher unit register properly, to confirm if its operating normally.
« Last Edit: January 25, 2021, 04:11:50 pm by Ian.M »
 

Offline VE2JFQTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
Re: watchdog programming ds1286 and others need help
« Reply #5 on: January 25, 2021, 03:30:20 pm »
thank you, I hadn't thought of crystal! I bought some boards where there is a battery and a crystal (a kit that I bought to restore the ds1286 by taking a ds1284 and adding the battery and the crystal at the same time. but I couldn't find a good ds1284, jen I bought from China, but it seems that it is fakes! it did not work! I will take my ds1286 is slowly open on the side, pins 2 and 3 to solder a crystal too, but first, I will do the test to know if I have a signal to SQL! thank you very much I will inform you of the result
have a good day
 

Offline VE2JFQTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12862
Re: watchdog programming ds1286 and others need help
« Reply #7 on: January 25, 2021, 04:59:24 pm »
Unless you are pretty certain you've damaged the crystal, it would be worth trying to access it with an Arduino, *before* trying to fit an external crystal.

That Amazon link looks reasonable if you want to get into Arduinos generally.  I got the Elegoo equivalent and was happy with it.  OTOH I had considerable previous experience with a genuine Arduino Uno so had little need of the accompanying lessons.  That kit's got at ATmega2560 based Arduino Mega2560, (the 'big brother' of the ATmega328P on Unos and Nanos), so you could use a whole 8 bit port for the data bus to your DS1286.

OTOH if you can do without all the other goodies and already have a decent quality full size solderless breadboard all you really need is a $5 Arduino Nano clone, and some old solid core ethernet cable to cut up for breadboard jumpers, a 10 pack of 3K3 resistors and a 100nF capacitor.   A few LEDs and 1K resistors would also be useful for monitoring the /INT and SQW pins.

I'd throw a three-pack of Nano clones on the order anyway, for building into projects where you don't want to tie up the Arduino Mega2560 board that came in the kit.
« Last Edit: January 25, 2021, 05:05:31 pm by Ian.M »
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: watchdog programming ds1286 and others need help
« Reply #8 on: January 25, 2021, 11:49:39 pm »
I always used old spare soldering iron to melt the plastic instead of mechanical methods.
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: watchdog programming ds1286 and others need help
« Reply #9 on: January 27, 2021, 09:52:18 am »
I've stumbled into this thread because I initially thought the topic was related to DS1486 - DS1250Y used by TDSxxx oscilloscope https://www.eevblog.com/forum/repair/dallas-ds1486-and-ds1250-replacement-designs/msg3430484/#msg3430484 as well as this one https://www.eevblog.com/forum/repair/reverse-engineer-dallas-ds1742w/

What interest me here would be to know any github or repository or open source arduino software already known able to read and/or write these DALLAS chip (DSxxxx).

On a side note, I've used many times arduino since 2008 where I recommend the Arduino MEGA or arduino DUE because they have much more pins input-output which should simplify any attempt to manage the NVRAM's installed on a dedicated protoshield.

Thanks, Albert
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12862
Re: watchdog programming ds1286 and others need help
« Reply #10 on: January 27, 2021, 10:23:57 am »
There's not much extra code involved to write readDbus() and writeDbus(data) access functions, especially if care has been taken to connect the data bus with bit significance matching that of the port, so no bit-shifting is required.  I estimate about a page of code to do it cleanly with no glitches on other pins as the data bus updates.  Once they are written and tested, there's negligible effect on the complexity of the rest of the code, so the whole eight bit port availability on the Arduino MEGA (and similar) only really win the cost/benefit competition when you need to push the bus speed as high as possible, so cant tolerate the overhead of a subroutine call + bit masking and combining/splitting bytes for every data bus access.  If other factors limit the max speed, e.g. UART bandwidth, spending more on hardware to eliminate the bus access bit twiddling will be a false optimization.

Also, devices with larger address buses may encourage the use of an Arduino with more I/O, as it avoids the need to either use an external address counter, or SPI port expanders, or to multiplex the address and data buses,  all of which will add the cost of one or more MSI logic chips to the design + the additional time to wire them up.
« Last Edit: January 27, 2021, 10:34:12 am by Ian.M »
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: watchdog programming ds1286 and others need help
« Reply #11 on: January 27, 2021, 10:34:45 am »
There's not much extra code involved to write readDbus() and writeDbus(data) access functions, especially if care has been taken to connect the data bus with bit significance matching that of the port, so no bit-shifting is required.  I estimate about a page of code to do it cleanly with no glitches on other pins as the data bus updates.  Once they are written and tested, there's negligible effect on the complexity of the rest of the code, so the whole eight bit port availability on the Arduino MEGA (and similar) only really win the cost/benefit competition when you need to push the bus speed as high as possible, so cant tolerate the overhead of a subroutine call + bit masking and combining/splitting bytes for every data bus access.  If other factors limit the max speed, e.g. UART bandwidth, spending more on hardware to eliminate the bus access bit twiddling will be a false optimization.
So nobody has published so far any open source (i.e. github) an arduino sketch with wiring instructions to read and/or write typical DSxxxx ?
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: watchdog programming ds1286 and others need help
« Reply #12 on: January 28, 2021, 03:11:41 am »
you want a sketch for reading parallel SRAM?
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 
The following users thanked this post: Ian.M

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 393
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: watchdog programming ds1286 and others need help
« Reply #13 on: January 28, 2021, 11:01:27 am »
This repo would be seem a good start for legacy SRAM's read and write https://github.com/johnzl-777/SRAM-Read-Write
 

Offline Per Hansson

  • Supporter
  • ****
  • Posts: 428
  • Country: se
Re: watchdog programming ds1286 and others need help
« Reply #14 on: January 30, 2021, 12:56:22 pm »
So nobody has published so far any open source (i.e. github) an arduino sketch with wiring instructions to read and/or write typical DSxxxx ?

There exists this one that I linked in another thread:

There exists this one I have built for BQ3287 which is direct cross compatible with Dallas DS12887 quite common in old PC's.
I modified the code so it can also output HEX dumps, useful for checking things, if anyone wants a copy let me know.
https://fritzing.org/projects/ibm-rtc-on-arduino/
 

Offline VE2JFQTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
Re: watchdog programming ds1286 and others need help
« Reply #15 on: February 20, 2021, 02:56:29 pm »
hello, i don't have much experience with arduino! but yes I would like to have a skech to be able to read and write on a ds1286
I must be able to each address in hex.
thank you
 

Offline Per Hansson

  • Supporter
  • ****
  • Posts: 428
  • Country: se
Re: watchdog programming ds1286 and others need help
« Reply #16 on: February 20, 2021, 03:16:35 pm »
You can probably use the linked sketch in my quote above as a good starting point.
To be honest I don't know how much the DS12887 differs from the DS1286
But the datasheet should reveal something, and maybe some experts here can chime in :)
 

Offline VE2JFQTopic starter

  • Contributor
  • Posts: 11
  • Country: ca
Re: watchdog programming ds1286 and others need help
« Reply #17 on: February 21, 2021, 03:26:04 pm »
i was wondering, if i take a universal programmer, the tl866. it doesn't support ds1286, but if i take another ic in the program, and i do an external modification (change the pins in place with a circuit) i could program the bytes i need?
thank you
 

Offline AMR Labs

  • Frequent Contributor
  • **
  • Posts: 258
  • Country: an
Re: watchdog programming ds1286 and others need help
« Reply #18 on: February 02, 2024, 05:42:39 pm »
I know this thread is old, but just in case would suggest you get this 1286 substitute board that is being sold on ebay. I managed to program this board and activated all applicable software only options or with the corresponding hardware in place (except the SSB and Custom Filter options which my unit does not have). Used my GQ-4X4 programmer by using the DS1225Y device configuration. Another option is to use the X28C64 configuration which also seems to work.

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

Note: I have no relation to the listing, just a satisfied customer with a COM-120B.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf