Shop OBEX P1 Docs P2 Docs Learn Events
having trouble programming/reading DS1393 (RTC) — Parallax Forums

having trouble programming/reading DS1393 (RTC)

MatthewMatthew Posts: 200
edited 2005-03-17 18:27 in General Discussion
Hello guys. I'm using the DS1393 RTC, and its datasheet can be found at:
http://pdfserv.maxim-ic.com/en/ds/DS1390-DS1393.pdf

My code is attached, and it's meant to read the 1/100th second register (page 13 in the datasheet has the registers).

My pins are hooked up in this manner (left side is pins from the DS1393) (page 10 in the datasheet has the pin assignments):
1-crystal
2-crystal
3-
4-PIN2
5-VSS
6-
7-PIN1
8-PIN0
9-
10-VCC

Do you all see anything wrong with the code? In the Debug screen, I see numbers increasing (Sometimes by 1, sometimes by 2, or sometimes random #'s/letters. They change like every 2-3 seconds). It's supposed to display 1/100ths of a second.

Any help will be greatly appreciated!

Thanks,
Matthew

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2005-03-16 05:18
    Some things to double check...

    Does your 32.768kHz crystal have a 6pF load capacitance?

    What are you testing this circuit on?

    There are strict layout guidelines on page 12 for the placement
    of the crystal. From personal experience with other time
    keeping devices of this nature, there is enough parasitic
    capacitance in a SSB to prevent your oscillator from working
    properly.

    Regardless of the crystal's operation, you should still be
    able to communicate with the chip. Try enabling the square
    wave output mode on page 16. If you don't have a scope, try
    setting the rate select bits to something audible and try to
    drive a piezo speaker. This should at least determine if
    your crystal is oscillating or not.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • MatthewMatthew Posts: 200
    edited 2005-03-16 05:36
    Beau,

    This is the crystal I'm using:
    http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?Ref=349550&Row=77807&Site=US

    The weird thing is that Digikey says it has a load capacitance of 6pF, however the datasheet says 12.5pF.

    As far as the circuit, I'm just using the breadboard on a Homework board. The DS1393 was soldered onto a uSOP to DIP adapter (all of the connections were tested by a multimeter).
  • Beau SchwabeBeau Schwabe Posts: 6,547
    edited 2005-03-16 06:12
    Matthew,

    Check and make sure that the part you have in hand from the packing order sheet matches the 6pF
    version you should have.

    The SSB or Solderless BreadBoard used here will create too much parasitic capacitance for the
    crystal to function properly. There is a solution using a SSB that allows you to stand-off the oscillator
    from the SSB. I will try to post a picture, but basically you can use an 8-DIP wire wrap socket as an
    adapter by bending only posts 1 & 2 of the socket at 90 deg ( the oscillator pins) and solder the crystal
    directly to these posts as close to the base of the 90 deg bend as possible. (snip the excess post length
    before soldering the crystal)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe - Mask Designer III

    National Semiconductor Corporation
    (Communication Interface Division)
    500 Pinnacle Court, Suite 525
    Mail Stop GA1
    Norcross,GA 30071
  • MatthewMatthew Posts: 200
    edited 2005-03-17 18:27
    Got it working! There was an error in the code.

    Matthew
Sign In or Register to comment.