Searching \ for 'DS1302 timechip woes' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/timers.htm?key=time
Search entire site for: 'DS1302 timechip woes'.

Truncated match.
PICList Thread
'DS1302 timechip woes'
1998\02\20@064920 by Brenton Vettoretti

flavicon
face
Has anyone had any experience with the DS1302 serial time-chip ?

I have one big problem in that I can't get the oscillator to run with a
MultiComp 32.768k watch crystal.  The crystal has a load capacitance of 12.5
pf instead of the 6 pf as spec'd by Dallas, but by-pass caps don't help, nor
does a bleed resistor. Are there any funny or special crystal characteristics
that I should be aware of - the data sheet is a bit light in this regard.  It
says to just connect a crystal between X1 and X2. Well, I've done that and it
doesn't work. Is the 6 pf really that critical ?

My second problem is that I can't get the DS1302 to talk back to me. I can only
assume that this is because the oscillator isn't running. Could someone please
confirm this for me as I've been going nuts with two really nice routines I've
written to set and read the time, but can't test them properly.

I've only got one DS1302 device at the moment, so if anyone has one in a
bread-board (or some other scenario which would allow them to pop the crystal
out) and could confirm that without a crystal, X2 sits at half the rail
voltage with X1 at ground potential, I'd appreciate it.

If anyone is using this device, could they please provide me with details of a
known good crystal along with details of any by-pass caps, or bleed resistors
if required.

Thanks and Regards,

Brenton

1998\02\20@081109 by Anders Eliasson

flavicon
face
I've used the DS1302 in a design.
First, since the device is synchronous, you *don't* need the 32 kHz xtal to
talk to the DS1302.

Time will just stand still :)

I used a crystal from IQD, with a load capacitance of 12.5 pF, works just fine.

I'd say either your device is blown, or your program not accurate.

/Anders




*snip*

>My second problem is that I can't get the DS1302 to talk back to me. I can only
>assume that this is because the oscillator isn't running. Could someone please
>confirm this for me as I've been going nuts with two really nice routines I've
>written to set and read the time, but can't test them properly.

>If anyone is using this device, could they please provide me with details of a
>known good crystal along with details of any by-pass caps, or bleed resistors
>if required.

*snip*

1998\02\20@092428 by rlunn

flavicon
face
Brenton Vettoretti wrote:

> I have one big problem in that I can't get the oscillator to run...

   Brenton, the oscillator won't start until you clear the 'clock
   halt' flag (bit 7 of the "seconds" register).

       If your s/w to write to the chip isn't working then you can
   never clear this flag; so the oscillator will never start!

> My second problem is that I can't get the DS1302 to talk back to me.
> I can only assume that this is because the oscillator isn't running.

   No.  The 32kHz oscillator doesn't need to be running to talk
   to the chip.

   The fact that you can't receive anything from the chip suggests
   that neither can you send anything to the chip.  As above, this
   means you'll never get the oscillator to start.

> If anyone is using this device, could they please provide me with
> details of a known good crystal along with details of any by-pass
> caps, or bleed resistors if required.

   I have used a Fox crystal.  This is connected directly to the
   chip and requires no additional components.

   You're in Sydney, where I believe 'Clarke & Severn' are the
   distributors.

   BUT, I don't think your problem is the crystal.

___Bob

1998\02\20@134752 by Calvin

flavicon
face
Hi,
ê've used the 1302 with success, I could not get the 6pF crystal so I used
the 12.5pF one without a problem (besides the accuracy). I have routines
written for the BS-II (PBasic), if you want I can send them to you.

I received the following code from Octavio Nogueira from a request I posted
on this list a few weeks ago, I haven't tried it yet, but I suppose it
works, so this should help you.

--------Reposted message----------
This is the code I use with DS1202 with is identical to DS1302.
Unfortunately the comments are in Portuguese, the language
I speek, but if you need help, contact me.

;*************************************************
; Rotina para ler um dado do RTC
; recebe em W o endereco e retorna em W o valor
;*************************************************
R_RTC movwf RTC_Temp
bcf RTC_SCLK
bcf RTC_IO
Bank1
movlw B'00110000'
movwf TRISA
Bank0
bsf STATUS,C ;bit 0 vai ser 0 para READ
rlf RTC_Temp,1 ;acerta endereo
bsf RTC_TEMP,7 ;bit 7 tem que ser 1
;bcf RTC_TEMP,6 ;le da RAM
bsf RTC_RST  ;reset em 1
movlw 8
movwf RTC_Count
R_RTC0 bcf RTC_IO
rrf RTC_Temp,1
btfsc STATUS,C
bsf RTC_IO
bsf RTC_SCLK ;\
;nop   ;| clock
bcf RTC_SCLK ;/
SPAGE R_RTC0
decfsz RTC_Count,1
goto R_RTC0
Bank1
movlw B'00110001'
movwf TRISA
Bank0
clrf RTC_Temp
movlw 8
movwf RTC_Count
bcf RTC_TEMP,0
R_RTC1 bcf STATUS,C
rrf RTC_TEMP,1
btfsc RTC_IO
bsf RTC_TEMP,7
bsf RTC_SCLK ;\
;nop   ;| clock
bcf RTC_SCLK ;/
SPAGE R_RTC1
decfsz RTC_Count,1
goto R_RTC1
bcf RTC_RST  ;reset em 0
bcf STATUS,C
movf RTC_Temp,W
return

;*************************************************
; Rotina para gravar um dado do RTC
; recebe em W o endereco e em A0 o valor
;*************************************************
W_RTC movwf RTC_Temp
bcf RTC_IO
bcf RTC_SCLK
Bank1
movlw B'00110000'
movwf TRISA
Bank0
bcf STATUS,C
rlf RTC_Temp,1
bsf RTC_TEMP,7
;bsf RTC_TEMP,6 ;grava na RAM
bsf RTC_RST  ;reset em 1
movlw 8
movwf RTC_Count
W_RTC0 bcf RTC_IO
rrf RTC_Temp,1
btfsc STATUS,C
bsf RTC_IO
bsf RTC_SCLK ;\
;nop   ;| clock
bcf RTC_SCLK ;/
SPAGE W_RTC0
decfsz RTC_Count,1
goto W_RTC0
movlw 8
movwf RTC_Count
movf A0,W
movwf RTC_Temp
W_RTC1 bcf RTC_IO
rrf RTC_Temp,1
btfsc STATUS,C
bsf RTC_IO
bsf RTC_SCLK ;\
;nop   ;| clock
bcf RTC_SCLK ;/
SPAGE W_RTC1
decfsz RTC_Count,1
goto W_RTC1
bcf RTC_IO
bcf RTC_RST
return

{Original Message removed}

1998\02\20@134832 by Calvin

flavicon
face
Could you post to the list the code you used?

Gabriel

-----Original Message-----
From: Anders Eliasson <spam_OUTanders.eliassonTakeThisOuTspamINTERTEX.SE>
To: .....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU <PICLISTspamKILLspamMITVMA.MIT.EDU>
Date: Viernes 20 de Febrero de 1998 7:07 AM
Subject: Re: DS1302 timechip woes


>I've used the DS1302 in a design.
>First, since the device is synchronous, you *don't* need the 32 kHz xtal to
>talk to the DS1302.
>
>Time will just stand still :)
>
>I used a crystal from IQD, with a load capacitance of 12.5 pF, works just
fine.
{Quote hidden}

only
>>assume that this is because the oscillator isn't running. Could someone
please
>>confirm this for me as I've been going nuts with two really nice routines
I've
>>written to set and read the time, but can't test them properly.
>
>>If anyone is using this device, could they please provide me with details
of a
>>known good crystal along with details of any by-pass caps, or bleed
resistors
>>if required.
>
>*snip*
>

1998\02\20@203004 by Steve Baldwin

flavicon
face
Brenton,

> Is the 6 pf really that critical ?

Other people have made suggestions that probably cover the cause of your
problems.

Just for your information, the 6pF figure simply describes the point at
which the crystal matches the stated frequency. The manufacturer could have
measured the same part at 12pF and have a slightly different frequency
figure. An analogy would be a weather forecaster giving an average
temperature for a region and qualifying it by saying at 3pm (he could have
used 10am but the answer would be different).


BTW. I'm looking for background information on Ceramic Resonators. Things
like manufacturing techniques, material types, thickness vs frequency, etc.
There's plenty of (contradicting) information on quartz parts but not on
ceramic resonators. Anybody have any pointers ?

Steve.

======================================================
 Very funny Scotty.  Now beam down my clothes.
======================================================
Steve Baldwin                Electronic Product Design
TLA Microsystems Ltd         Microcontroller Specialists
PO Box 15-680                email: .....stevebKILLspamspam.....kcbbs.gen.nz
New Lynn, Auckland           ph  +64 9 820-2221
New Zealand                  fax +64 9 820-1929
======================================================

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...