clock out of rtc

Discussion in 'Programmer's Corner' started by JENI, Apr 14, 2014.

  1. JENI

    Thread Starter New Member

    Apr 14, 2014
    Hai Saha...

    I need to enable the clock output of RTC pcf8563 interfacing with 89c52.
    clockoutput register for rtc is 0Dh.
    To get 32.768khz frequency, i have to load 10000000b (80h)into 0DH register.
    please help me to load this value using asm code.

    Thanks in advance..
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    That device uses the I2C (Inter Integrated Circuit) method of serial data communication. Wikipedia has a nice inter, I'm sure someone has posted some code for your processor somewhere. If not you'll have to write the code yourself.

    IIC can be a bear to get working, I say that even though it is my favorite way to talk to helper chips.

    Stop back if you get stuck.
  3. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    Seriously? :eek: I avoid it like the plague, after being forced to use it in a couple of commercial designs.

    For brute force reliability I much prefer SPI. And if pin count is an issue I will use asynch serial, which generally requires only 1 pin as most times I use it is TX only or RX only.
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    One must wonder what any of that does to aid the OP in his quest to use some specific device.
  5. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    The old 89c52 doesn't have a hardware i2c bus. You have to bit bang on a couple of I/O ports. If this is not a school assignment then consider almost any other MPU. The only place still using those ancient intel 8051 series seems to be India.

    PS I like the I2C bus, works great with only a couple of wires. I recommend either PIC or Arduino.
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Actually if JENI is stuck on using that chip then a bit bang I2C may be easier, as there are many examples on the net for that.

    Of course, they probably will all need translation from whatever language they are written in to that assembler. But the concept should come thru fine.