clock out of rtc

Thread Starter

JENI

Joined Apr 14, 2014
1
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..
 

ErnieM

Joined Apr 24, 2011
8,377
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.
 

THE_RB

Joined Feb 11, 2008
5,438
...
IIC can be a bear to get working, I say that even though it is my favorite way to talk to helper chips.
...
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.
 

ErnieM

Joined Apr 24, 2011
8,377
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.
One must wonder what any of that does to aid the OP in his quest to use some specific device.
 
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.
 

ErnieM

Joined Apr 24, 2011
8,377
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.
 

BobaMosfet

Joined Jul 1, 2009
2,110
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.
i2c is very easy to use if you actually understand it, and easy to debug with an o-scope. It isn't as fast as SPI, but it can be as reliable. People have difficulty with it because a) they don't understand the handshake, and b) they have no clue how to use their compiler to simplify using it. '#define' isn't just a tool for creating constants.
 
Top