Maker Pro
Maker Pro

Ds1302

Have any one ever used a DS1307 RTC ?

give me the technical tips in handling it and also coding hints to
interface it with Aduc841 microconverter.

Help please.

Thanks
nava
 
D

Damir

Jan 1, 1970
0
Have any one ever used a DS1307 RTC ?

give me the technical tips in handling it and also coding hints to
interface it with Aduc841 microconverter.

Help please.


Have you ever used Google?
 
A

Anthony Fremont

Jan 1, 1970
0
Have any one ever used a DS1307 RTC ?

I'm sure plenty of people have, including myself.
give me the technical tips in handling it

When handling it, try to limit the amount of static electricity you
expose it to. Also try not to bend the pins too much.
and also coding hints to interface it with Aduc841 microconverter.

I don't know anything about Aduc841 microcontrollers, but if it has I2C
capability you should have no trouble talking to it. I'm using a PIC
16F88 and manually bit-banging the I2C and it works perfectly. I have a
DS1307 and two serial eeproms on the I2C bus. Every 30 seconds, the PIC
takes a temperature reading (LM34), reads the clock and logs the data to
the eeproms. It's been running for many months on a breadboard without
issue. As long as you read the datasheet and follow its advice, you
shouldn't have any trouble getting it to work. I have a lithium backup
battery hooked up as well as a 5V supply that is switched on and off. I
use the square wave output of the DS1307 to wake the PIC every second.
Everything works just as it should. Currently, it is also blinking (50%
duty) a blindingly bright, green LED (NTE-30038 10,500mcd typical) once
per second.

The biggest problem I had in getting it to work was not using stiff
enough pull-up resistors. I2C is pretty hateful about that kinda stuff.
;-)
 
D

Don McKenzie

Jan 1, 1970
0
Have any one ever used a DS1307 RTC ?

give me the technical tips in handling it and also coding hints to
interface it with Aduc841 microconverter.

Help please.

Thanks
nava

there are some tips at:
http://www.dontronics.com/rtc.html
that may help

Don...


--
Don McKenzie
E-Mail Contact Page: http://www.dontronics.com/e-mail.html

Micro,TTL,USB to 1.5" color LCD http://www.dontronics.com/micro-lcd.html
USB,RS232 or TTL to VGA Monitor http://www.dontronics.com/micro-vga.html
World's smallest USB 2 TTL Conv http://www.dontronics.com/micro-usb.html
 
Sir

I have tried i2c betwn two Aduc's.I have just only transmitted from
the
master and no receive process is done.

So the slave will receive the data and not transmits at all.

This is kept in interrupt polling in slave routine such as,
when slave receives data from master the i2ci bit set in the I2CCON
register of aduc841.(slave mode)

so in the interrupt routine i have just compliment a port pin to
indicate that the slave had receive or responded to the master's
request.

whether my procedure is correct?


____________________

steps for slave routine
____________________

configur aduc841in slave mode

enable interrupts

wait till interrupt occurs /* interrupt occurs when the master
transmits to slave and the slave responds to it. */

if (interrupt)
{
cpl port // to indicate the slve's response
}

is this is correct?

Note:
Master transmission is checked only in simulation.when 0x80 given in
code the shifted data such as 0x40 occurs in the simulation. This is
keenly explained in (Aplli. Note uc001)from analog devices.

In my master routine i am sending address and data continuously.
But there is no interrupt sense in slave. how to check this and whether
any changes to be done.
Kindly help me to solve the same.

reply expected eagerly

Thanking you,
Nava.
 
A

Anthony Fremont

Jan 1, 1970
0
Sir

I have tried i2c betwn two Aduc's.I have just only transmitted from
the
master and no receive process is done.

So the slave will receive the data and not transmits at all.

How do you know the slave is listening? Are you sending the proper
address?
This is kept in interrupt polling in slave routine such as,
when slave receives data from master the i2ci bit set in the I2CCON
register of aduc841.(slave mode)

so in the interrupt routine i have just compliment a port pin to
indicate that the slave had receive or responded to the master's
request.

whether my procedure is correct?

I don't understand. It sounds like you have 2 microcontrollers, is that
correct? Can you post a schematic of your circuit?

____________________

steps for slave routine
____________________

configur aduc841in slave mode

enable interrupts

wait till interrupt occurs /* interrupt occurs when the master
transmits to slave and the slave responds to it. */

if (interrupt)
{
cpl port // to indicate the slve's response
}

is this is correct?

Note:
Master transmission is checked only in simulation.when 0x80 given in
code the shifted data such as 0x40 occurs in the simulation. This is
keenly explained in (Aplli. Note uc001)from analog devices.

In my master routine i am sending address and data continuously.
But there is no interrupt sense in slave. how to check this and whether
any changes to be done.
Kindly help me to solve the same.

reply expected eagerly

You have to send the "address" of the device you are trying to
communicate with.

Here is the PIC assembler code I use to communicate with the DS1307 RTC.

; To read the rtc, we have to set the address by pretending to do a
write. Once
; we set the address, we abort the write by doing a STOP instead of
transferring a
; byte to be written.

; Set address by starting a write procedure and then aborting it

call I2C_Start

movlw b'11010000' ; I2C /Write command to
RTC
call I2C_WriteByte
call I2C_Ack

movfw rtcregister ; Set address to slot
number
call I2C_WriteByte
call I2C_Ack


call I2C_Stop ; Abort the write after
setting address pointer

; Now read from current address

call I2C_Start

movlw b'11010001' ; I2C Read command
call I2C_WriteByte
call I2C_Ack

call I2C_ReadByte ; Read in a byte
movwf rtcvalue ; and save it

call I2C_SendNAck

call I2C_Stop ; Done
 
F

Frank Bemelman

Jan 1, 1970
0
Sir

I have tried i2c betwn two Aduc's.I have just only transmitted from
the
master and no receive process is done.

What has that to do with a DS1302? DS1302 does not have a I2C interface.
 
D

David Collier

Jan 1, 1970
0
DS1307 doesn't keep accurate time without an external capacitor - runs a
few seconds a day out.

See latest datasheet.

David




*Subject:* Ds1302
*From:* [email protected]
*Date:* 24 Jan 2006 10:30:20 -0800

Have any one ever used a DS1307 RTC ?

give me the technical tips in handling it and also coding hints to
interface it with Aduc841 microconverter.

Help please.

Thanks
nava


David Collier

email can be sent to Dexdyne.com , under name from_usenet@
 
A

Anthony Fremont

Jan 1, 1970
0
Respected Sir
Please find my (Block Diagram) in your mail.

That will not work, I do not post my real e-mail address to Usenet for
obvious reasons. You need to post your diagram to
alt.binaries.schematics.electronics, or use ASCII art to post it here.

You might find this useful:
http://www.tech-chat.de/files/AACircuit1_28_6.zip

It is the "famous" Andy's ASCII-circuit program for producing ASCII art
schematics.
 
A

Anthony Fremont

Jan 1, 1970
0
David Collier said:
DS1307 doesn't keep accurate time without an external capacitor - runs a
few seconds a day out.

See latest datasheet.

Could you please elaborate more on that? I just download the datasheet
and I don't see what you're talking about. The sheet I downloaded is
REV 071405. There is no mention of an external capacitor in the
document text nor in any of the schematics. BTW, I would expect a 20ppm
crystal, combined with other factors to be off by as much as 2
seconds/day anyway.
 
Top