Searching \ for 'Serial timeeper HT 1380' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/serials.htm?key=serial
Search entire site for: 'Serial timeeper HT 1380'.

Truncated match.
PICList Thread
'Serial timeeper HT 1380'
1999\02\11@012726 by Javier

flavicon
face
Hi
I4m trying to interface a PIC (f84) with a Serial timekeeper from Holtek
HT1380, has anybody already written some routines to communicate with the
HT1380??
What kind of routine should I use to read or write, when the function
description says "All data is entered on the rising edge of SCLK and outputs
on the falling edge of SCLK" ? I4m a bit confused with this !!
Thanks in advance
Javier

1999\02\11@074240 by WF AUTOMACAO

flavicon
face
Javier wrote:
>
> Hi
> I4m trying to interface a PIC (f84) with a Serial timekeeper from Holtek
> HT1380, has anybody already written some routines to communicate with the
> HT1380??
> What kind of routine should I use to read or write, when the function
> description says "All data is entered on the rising edge of SCLK and outputs
> on the falling edge of SCLK" ? I4m a bit confused with this !!
> Thanks in advance
> Javier

Javier, the HT1380 works as the DS1302...I think!

Sorry, i have use the HT1380 with C only! (CCS)

Miguel

1999\02\11@100305 by Ravi Pailoor

flavicon
face
part 0 1112 bytes content-type:text/plain; charset=x-user-definedHi Javier,

Please find attached the assemble source code for interfacing HT 1380 with
16C54.

You can find the interfacing I/O lines from the source.

Bye

Pailoor
 
 

Javier wrote:

> Hi
> I4m trying to interface a PIC (f84) with a Serial timekeeper from Holtek
> HT1380, has anybody already written some routines to communicate with the
> HT1380??
> What kind of routine should I use to read or write, when the function
> description says "All data is entered on the rising edge of SCLK and outputs
> on the falling edge of SCLK" ? I4m a bit confused with this !!
> Thanks in advance
> Javier

--
Chip Technologies
Microchip Design Consultant

No. 70, 9th Main Road,
Mathikere,
Bangalore - 560 054.
INDIA
Tel   : +91-80-3362807
Fax   : +91-80-3369451
Email : spam_OUTchiptechTakeThisOuTspamvsnl.com
Webpage : http://business.vsnl.com/chiptech
 

Content-Type: application/x-unknown-content-type-asm_auto_file; name="Rtc.asm"
Content-Disposition: inline; filename="Rtc.asm"

Attachment converted: wonderland:Rtc.asm (????/----) (00029DFD)

1999\02\15@142339 by Javier

flavicon
face
Hi Ravi,
Thanks a lot for the routines, they really helped to figure out how the HT
works !!!
But  I couldn4t interface the F84 with HT1380.
I just put LIST p=16f84 and compiled it !!! This didn4t work, I also made a
programme myself, without success  :-(
What is the problem, I can4t figure it out ?? I just connected Pin 6 of Pic
with SCLK, 7 with I/O and 8 with RST, no resistors no caps. !! Is it easy to
damage the RTC ??How??
Another thing I didn4t see before is the instruction  "goto $+1" I thought
it was some kind of delay.Can I leave the Wdt off ??
Thanks in advance
Javier


-----Mensaje original-----
De: Ravi Pailoor <.....chiptechKILLspamspam@spam@VSNL.COM>
Para: PICLISTspamKILLspamMITVMA.MIT.EDU <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
Fecha: Jueves 11 de Febrero de 1999 12:00 p.m.
Asunto: Re: Serial timeeper HT 1380


Hi Javier,

Please find attached the assemble source code for interfacing HT 1380 with
16C54.

You can find the interfacing I/O lines from the source.

Bye

Pailoor



Javier wrote:

> Hi
> I4m trying to interface a PIC (f84) with a Serial timekeeper from Holtek
> HT1380, has anybody already written some routines to communicate with the
> HT1380??
> What kind of routine should I use to read or write, when the function
> description says "All data is entered on the rising edge of SCLK and
outputs
> on the falling edge of SCLK" ? I4m a bit confused with this !!
> Thanks in advance
> Javier

--
Chip Technologies
Microchip Design Consultant

No. 70, 9th Main Road,
Mathikere,
Bangalore - 560 054.
INDIA
Tel : +91-80-3362807
Fax : +91-80-3369451
Email : EraseMEchiptechspam_OUTspamTakeThisOuTvsnl.com
Webpage : http://business.vsnl.com/chiptech

1999\02\15@170855 by Peter Tran

flavicon
face
I tried to communicate Dallas DS1302 (serial timekeeping chip) with 16f84,
but it didn't work too.  I used 32.768 kHz crystal and two 10pF connected
from pin2 and 3 to ground. My circuit look right, but I don't know why I
only received the "1".
{Original Message removed}

1999\02\15@171648 by WF AUTOMACAO

flavicon
face
Peter Tran wrote:
>
> I tried to communicate Dallas DS1302 (serial timekeeping chip) with 16f84,
> but it didn't work too.  I used 32.768 kHz crystal and two 10pF connected
> from pin2 and 3 to ground. My circuit look right, but I don't know why I
> only received the "1".

For "Reading", you must first, do a "Write" following a STOP...

Miguel

1999\02\15@173349 by Peter Tran

flavicon
face
Yes, first I write a command to select the address and mode, then
read...,but still not work.
----- Original Message -----
From: WF AUTOMACAO <wfspamspam_OUTAMBIENTE.COM.BR>
To: <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU>
Sent: Monday, February 15, 1999 7:15 PM
Subject: Re: Serial timeeper HT 1380


>Peter Tran wrote:
>>
>> I tried to communicate Dallas DS1302 (serial timekeeping chip) with
16f84,
>> but it didn't work too.  I used 32.768 kHz crystal and two 10pF connected
>> from pin2 and 3 to ground. My circuit look right, but I don't know why I
>> only received the "1".
>
>For "Reading", you must first, do a "Write" following a STOP...
>
>Miguel
>

________________________________________________________
NetZero - We believe in a FREE Internet.  Shouldn't you?
Get your FREE Internet Access and Email at
http://www.netzero.net/download.html

1999\02\15@213541 by Ravi Pailoor

flavicon
face
Today evening I will upload the software that I actually used to test the RTC.
It is in my office.

> But  I couldn4t interface the F84 with HT1380.
> I just put LIST p=16f84 and compiled it !!! This didn4t work, I also made a
> programme myself, without success  :-(
> What is the problem, I can4t figure it out ?? I just connected Pin 6 of Pic
> with SCLK, 7 with I/O and 8 with RST, no resistors no caps. !!

Will send you the schematic that I used.

> Is it easy to damage the RTC ??How??

Yes, When the RTC is outputting the data, if the PIC drives the same line low,
you have a cooked RTC. Well I didi it !

> Another thing I didn4t see before is the instruction  "goto $+1" I thought
> it was some kind of delay.

GOTO $+1 means GOTO $ (current location) + one forward location jump.
GOTO $-1 means GOTO $ - one backward location jump
GOTO $+5 means GOTO $ + 5 forward locations jump.

> Can I leave the Wdt off ??

I use CLRWDT in all my software. You can leave the WDT off.

Bye

Pailoor
-----------------------------------------------------------------------
Chip Technologies
Microchip Design Consultant

No. 70, 9th Main Road, Mathikere, Bangalore - 560 054. INDIA
Tel   : +91-80-3362807, Fax   : +91-80-3369451
Email : KILLspamchiptechKILLspamspamvsnl.com , Webpage : http://business.vsnl.com/chiptech
-----------------------------------------------------------------------
 

1999\02\15@222817 by Wagner Lipnharski

picon face
> Peter Tran wrote:
> >
> > I tried to communicate Dallas DS1302 (serial timekeeping chip) with 16f84,
> > but it didn't work too.  I used 32.768 kHz crystal and two 10pF connected
> > from pin2 and 3 to ground. My circuit look right, but I don't know why I
> > only received the "1".

Peter, you need to understand that it is very difficult to help someone that doe
sn't say what is the problem.  It looks like when my wife comes in and say that
she did everything
but her car doesn't work.  Did what? What doesn't work? Why don't you just write
a data flow sequence between your processor and the DS1302? Perhaps doing that
you can find the
problem by yourself (what happens very often).

Wagner.

1999\02\15@224304 by dave vanhorn

flavicon
face
>> Peter Tran wrote:
>> >
>> > I tried to communicate Dallas DS1302 (serial timekeeping chip) with 16f84,
>> > but it didn't work too.  I used 32.768 kHz crystal and two 10pF connected
>> > from pin2 and 3 to ground. My circuit look right, but I don't know why I
>> > only received the "1".

The circuit I have shows the cap in paralell with the crystal.

Perhaps we can work through our problems together. I'm writing this on the
AVR 8515 processor, and I've gotten as far as sending a control byte
(Address and command) which looks ok on the scope, but for some reason the
subsequent read of the data comes back as all 1s. Since I am reading the
seconds register, I expected to get a constantly changing value.

The chip is definitely outputting the ones though, so something's going on :)

1999\02\15@225129 by Wagner Lipnharski

picon face
The DS1302 is answering the ACK bit after your control byte is sent?
Wagner.

dave vanhorn wrote:
{Quote hidden}

1999\02\15@230209 by dave vanhorn

flavicon
face
At 10:48 PM 2/15/99 -0500, Wagner Lipnharski wrote:
>The DS1302 is answering the ACK bit after your control byte is sent?
>Wagner.

I don't show an "ack bit" in my docs..

I'm trying to read the seconds register (adrs 0) as in ficure 3 from the
datasheet.
I start with reset low, then set clock and data low, then  RST high. (About
a uS between transitions)
Then I output D0, and take clock high, then low,
Same for D1,D2...D6
On D7, I take the clock high, and then exit my send byte routine.
The calling routine calls the receive byte routine, which sets the data pin
as an input, and takes clock low, waits about a uS, samples data, then
takes clock high, repeat for all 8 bits.  The output from the chip is
driven high..

If I do a burst read of the clock, I get different data in each byte, but I
don't see the sort of constant increment that I ought to see in an RTC.

I can email scope waveforms.

1999\02\16@002746 by Javier

flavicon
face
Thanks Ravi for the help, I really didn4t  thought it was that difficult !!
Bye
Javier
PD Besides it gives me some hope, if somebody else could do it work, why
shouldn4t I  :-)

-----Mensaje original-----
De: Ravi Pailoor <RemoveMEchiptechTakeThisOuTspamVSNL.COM>
Para: spamBeGonePICLISTspamBeGonespamMITVMA.MIT.EDU <TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU>
Fecha: Lunes 15 de Febrero de 1999 23:33 p.m.
Asunto: Re: Serial timeeper HT 1380


Today evening I will upload the software that I actually used to test the
RTC.
It is in my office.

> But I couldn4t interface the F84 with HT1380.
> I just put LIST p=16f84 and compiled it !!! This didn4t work, I also made
a
> programme myself, without success :-(
> What is the problem, I can4t figure it out ?? I just connected Pin 6 of
Pic
> with SCLK, 7 with I/O and 8 with RST, no resistors no caps. !!

Will send you the schematic that I used.

> Is it easy to damage the RTC ??How??

Yes, When the RTC is outputting the data, if the PIC drives the same line
low,
you have a cooked RTC. Well I didi it !

> Another thing I didn4t see before is the instruction "goto $+1" I thought
> it was some kind of delay.

GOTO $+1 means GOTO $ (current location) + one forward location jump.
GOTO $-1 means GOTO $ - one backward location jump
GOTO $+5 means GOTO $ + 5 forward locations jump.

> Can I leave the Wdt off ??

I use CLRWDT in all my software. You can leave the WDT off.

Bye

Pailoor
-----------------------------------------------------------------------
Chip Technologies
Microchip Design Consultant

No. 70, 9th Main Road, Mathikere, Bangalore - 560 054. INDIA
Tel : +91-80-3362807, Fax : +91-80-3369451
Email : RemoveMEchiptechspamTakeThisOuTvsnl.com , Webpage : http://business.vsnl.com/chiptech
-----------------------------------------------------------------------

1999\02\16@035713 by g.daniel.invent.design

flavicon
face
If the Holtec chip is like the DS1307 (I2C) then it needs to be started,
a bit in an early register I think.

regards,
Graham Daniel.

Peter Tran wrote:
>
> I tried to communicate Dallas DS1302 (serial timekeeping chip) with 16f84,
> but it didn't work too.  I used 32.768 kHz crystal and two 10pF connected
> from pin2 and 3 to ground. My circuit look right, but I don't know why I
> only received the "1".

1999\02\16@103802 by Ryan Miller

flavicon
face
Something that bit me with the DS1302 (is your chip similar?) is that
data-in to the RTC is on the rising edge and data-out is on the falling edge
and you start reading on the same clock pulse as the last data-in bit. I
kept trying to put an extra pulse in there and would read only 1's. From
your description, you might be doing this already, but it might help the
others who are having problems.

Ryan

{Quote hidden}

1999\02\16@114151 by Ravi Pailoor

flavicon
face
part 0 250 bytes content-type:application/x-unknown-content-type-asm_auto_file; name="picrtc.asm"</x-html>
Content-Type: application/x-unknown-content-type-asm_auto_file; name="picrtc.asm"
""
Content-Disposition: inline; filename="picrtc.asm"

Attachment converted: wonderland:picrtc.asm (????/----) (0002A133)

1999\02\16@114504 by Wagner Lipnharski

picon face
Hi Dave, I am sorry about the ack bit, I made a confusion about the protocol use
d by the DS1302. I mixed it up with I2C. :(

Ryan observed a good point about the clock falling edge for reading bits from th
e device to the microcontroller.

The book says that during the "up" level of the clock, the I/O pin is in tri-sta
te (to be able to "read" the bit sent by the microcontroller into the device), b
ut you are sampling
(reading) the I/O pin with clock low, so you are doing the right thing.


1) The time (tCC) between the raise of reset and the first clock raise must be a
minimum of 4 microsecond for a of 2.5Vcc or 1 microsecond for 5Vcc.  You said 1
microsecond between
transitions. I think even using a 5Vdc it is too close to the timming marginal.
Try 2 or 3 us.

2) The time (tCDD) between the falling clock and data valid (read) is from 200 t
o 800 nanoseconds (2.5 - 5Vdc), you said to be waiting "about" 1 microsecond.  A
gain, increase that
time for a longer safe value.

3) The minimum time (tCWH) the reset line must be down is from 1 to 4 microsecon
d (5Vdc - 2.5Vdc), you do not specify it clearly, so gives the chip a minimum of
8us of "relax"
please.

4) Clock up or low time (tCH or tCL) must be a minimum of 0.25 to 1 microsecond
(5Vdc - 2.5Vdc).  Make sure to be following it nicelly.

5) During the problems debuging I use to multiply the minimum timmings for 10, s
o you can see it better even at the scope.

6) Try to use a 47pF-1nF capacitor at the SCLK to ground, to avoid any possible
glitches.

7) Try another part.

Wagner Lipnharski
UST Research Inc
Orlando, Florida
http://ustr.net

Ryan Miller wrote:
{Quote hidden}

1999\02\16@114515 by dave vanhorn

flavicon
face
At 07:34 AM 2/16/99 -0800, Ryan Miller wrote:
>Something that bit me with the DS1302 (is your chip similar?) is that
>data-in to the RTC is on the rising edge and data-out is on the falling edge
>and you start reading on the same clock pulse as the last data-in bit. I
>kept trying to put an extra pulse in there and would read only 1's. From
>your description, you might be doing this already, but it might help the
>others who are having problems.


I caught that one :)

It's fun writing code when you have to hop all over the datasheet to get
the information.

1999\02\16@114648 by Peter Tran

flavicon
face
Me too, my simulation seemed right, but the timer chip returned all 1s. I
think it might relate to time delay scheme of DS1302.
{Original Message removed}

1999\02\16@120126 by dave vanhorn

flavicon
face
At 11:42 AM 2/16/99 -0500, Wagner Lipnharski wrote:
>Hi Dave, I am sorry about the ack bit, I made a confusion about the protocol
>used by the DS1302. I mixed it up with I2C. :(

Had me panicking for a moment.. Too many chips, too many protocols. :)


>1) The time (tCC) between the raise of reset and the first clock raise must
>be a minimum of 4 microsecond for a of 2.5Vcc or 1 microsecond for 5Vcc.
>You said 1 microsecond between
>transitions. I think even using a 5Vdc it is too close to the timming
>marginal. Try 2 or 3 us.

I would, but Mr Scope says nothing's happening. I'm not in a case where the
waveform "almost makes it", there's only an intermittent dip of about half
a volt, in an RC discharge sort of curve. It would take a VERY long time
for that curve to hit zero.

>2) The time (tCDD) between the falling clock and data valid (read) is from
>200 to 800 nanoseconds (2.5 - 5Vdc), you said to be waiting "about" 1
>microsecond.  Again, increase that
>time for a longer safe value.

I'll try it, but Mr scope dosen't give me a lot of hope.

>3) The minimum time (tCWH) the reset line must be down is from 1 to 4
>microsecond (5Vdc - 2.5Vdc), you do not specify it clearly, so gives the
>chip a minimum of 8us of "relax"
>please.

That one might be violated, I'm looping to make it easier to scope, but I
can put a big delay in there.
The only purpose for setting the lines in the beginning in my routine is in
case they were left "dirty" by another routine.. I guess I will need to add
the 8uS delay to that part as well

>4) Clock up or low time (tCH or tCL) must be a minimum of 0.25 to 1
>microsecond (5Vdc - 2.5Vdc).  Make sure to be following it nicelly.

>5) During the problems debuging I use to multiply the minimum timmings for
>10, so you can see it better even at the scope.

Not a problem here, but I may be a little tight on the legal limits.

>6) Try to use a 47pF-1nF capacitor at the SCLK to ground, to avoid any
>possible glitches.

None observed, and I hate putting caps on driven lines. Bad EMI juju.

>7) Try another part.

That's a distinct possibility. I had to replace the CPU on this proto
already because the pin that connects to the RTC's data pin couldn't
drive.. It's all SMD, and it's the only one I have, so I can't just replace
easily. I emailed the hardware guy for a replacement chip today.

1999\02\17@213220 by Javier

flavicon
face
Thanks Ravi,
the code worked perfect with the F84 !!! :-)
Do you know why the other code didn4t work, seemed ok ??
Next I4ll try the Burst mode and add a backup battery, I4ll use 2 diodes to
switch the batt on when the main power supply is off, do you think it will
work ??
Bye
Javier

   -----Mensaje original-----
   De: Ravi Pailoor <chiptechEraseMEspam.....VSNL.COM>
   Para: EraseMEPICLISTspamMITVMA.MIT.EDU <RemoveMEPICLISTEraseMEspamEraseMEMITVMA.MIT.EDU>
   Fecha: Martes 16 de Febrero de 1999 13:40 p.m.
   Asunto: Re: Serial timeeper HT 1380


   Hi Javier,
   Please find attached the code for HT 1380 which I wrote to test the RTC.
This is the actual code that worked with a 16C54.

   Sorry there is no schematic, I just rigged it on a breadboard and
tested.

   Try this and let me know.

   Bye

   Pailoor
   -----------------------------------------------------------------------
   Chip Technologies - Microchip Design Consultant

   No. 70, 9th Main Road, Mathikere, Bangalore - 560 054. INDIA
   Tel          : +91-80-3362807, Fax   : +91-80-3369451
   Email       : RemoveMEchiptechspam_OUTspamKILLspamvsnl.com
   Webpage : http://business.vsnl.com/chiptech ( Updated on 16th February )
   -----------------------------------------------------------------------

1999\02\18@022950 by Ravi Pailoor

flavicon
face
Javier wrote:

> Thanks Ravi,
> the code worked perfect with the F84 !!! :-) Do you know why the other code
> didn4t work, seemed ok ??

Javier,

If you mean OTHER CODE, the one I sent earlier ? Well that had bugs in it. I
just sent it for your immediate reference.

> Next I4ll try the Burst mode and add a backup battery, I4ll use 2 diodes to
> switch the batt on when the main power supply is off, do you think it will
> work ??

Need to have a current limiting resistor in series with the one with the
battery. The Dallas DS1302 has a battery charging and switching circuit inside
it. Have a look at the data sheet of DS1302.

Bye

Pailoor

{Quote hidden}

--
---------------------------------------------------------------------
Chip Technologies - Microchip Design Consultant

No. 70, 9th Main Road, Mathikere, Bangalore - 560 054. INDIA
Tel    : +91-80-3362807, Fax   : +91-80-3369451
Email  : spamBeGonechiptechSTOPspamspamEraseMEvsnl.com,
Webpage : http://business.vsnl.com/chiptech ( Updated on 16th February )
---------------------------------------------------------------------
 

1999\02\18@180114 by Gabriel Gonzalez

flavicon
face
> Next I4ll try the Burst mode and add a backup battery, I4ll use 2 diodes
to
> switch the batt on when the main power supply is off, do you think it will
> work ??

You don't need the diodes with the DS1302, it does the switching
automatically, you just have to connect the battery to Vcc1, and the supply
to Vcc2.

Gabriel

1999\02\19@102823 by ryan pogge

flavicon
face
it is  in BCD are you taking that into account?
this is the problem i had with the DS1307

you have to mask the high and low bits and do a
switch or bitwise shift 4 places

say you read the seconds into variable B0

B3 = B0 & $0f
B2 = B0 & $f0
     B2 = B2 >> 4         'shift bits right 4 places

this will have to be changed to assembler, but it gives you
an idea.

then to display the seconds you send   B2,B3
unless you are useing some hardware that automatically
decodes BCD


Regards,
Ryan


>If I do a burst read of the clock, I get different data in
each byte, but I
>don't see the sort of constant increment that I ought to
see in an RTC.
>
>I can email scope waveforms.

1999\02\19@134858 by Javier

flavicon
face
Unfortunately I use Ht1380, wich lacks of this automatic switching and have
to find another way to use a backup battery :-( !!!
Suggestions are welcome
Bye
Javier

-----Mensaje original-----
De: Gabriel Gonzalez <KILLspamtgospamBeGonespamCHIH1.TELMEX.NET.MX>
Para: EraseMEPICLISTspamEraseMEMITVMA.MIT.EDU <@spam@PICLIST@spam@spamspam_OUTMITVMA.MIT.EDU>
Fecha: Jueves 18 de Febrero de 1999 19:59 p.m.
Asunto: Re: Serial timeeper HT 1380


>> Next I4ll try the Burst mode and add a backup battery, I4ll use 2 diodes
>to
>> switch the batt on when the main power supply is off, do you think it
will
>> work ??
>
>You don't need the diodes with the DS1302, it does the switching
>automatically, you just have to connect the battery to Vcc1, and the supply
>to Vcc2.
>
>Gabriel

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