BX-24 with ds1302

Started by neilgrey February 4, 2004
Hi folks:

I've built a circuit which uses a BS2 connected to a DS1302 RTC.

For several reasons i've decided to replace the BS2 with the BX-24.

However when reviewing the docs for the BX-24 I noticed there are
some restrictions on the SHIFTIN, SHIFTOUT instructions such as:

1) The bits are shifted MSB first but the ds1302 requires LSB.
Possible work around would be to reverse the order of the bits.

2) Timing control not as flexible as in the BS2. Ie cannot control
when the BX-24 should sample bits from ds1302, ie. Before OR after
clock line pulse. Has anyone been successful in connecting the BX-24 to the ds1302
and if so, can you provide any useful pointers?

Thanx.




--- In , "neilgrey" <neilgrey@y...> wrote:
> 1) The bits are shifted MSB first but the ds1302 requires LSB.
> Possible work around would be to reverse the order of the bits.

You can use the FlipBits() function to reverse the order of the bits
if the device is little-endian.

> 2) Timing control not as flexible as in the BS2. Ie cannot control
> when the BX-24 should sample bits from ds1302, ie. Before OR after
> clock line pulse.

In my application I inverted the clock signal between the BX-24 and
the data source in order to have the data be stable when the BX-24
sampled it. In this particular case, the data source was a 74LS165
shift register which outputs the next bit on the rising edge of the
clock. I started with the clock low and the first bit already
available. The evidence suggests that the BX-24 samples the data on
the rising edge of the clock and without the inverter I wasn't
meeting the hold time on the data input.

I don't know if starting with the clock line high would have had the
same effect. I couldn't try this in my app because I'm sharing the
clock line with some positive edge triggered output registers that
control the data source. Perhaps someone can tell us if the initial
clock line state affects when the BX-24 samples the data. I would
guess that it does, sampling on the falling edge.

Don


Theres a sample program maybe more for the DS1302 in the files section.

Regards
Ian

neilgrey wrote:

>Hi folks:
>
>I've built a circuit which uses a BS2 connected to a DS1302 RTC.
>
>For several reasons i've decided to replace the BS2 with the BX-24.
>
>However when reviewing the docs for the BX-24 I noticed there are
>some restrictions on the SHIFTIN, SHIFTOUT instructions such as:
>
>1) The bits are shifted MSB first but the ds1302 requires LSB.
>Possible work around would be to reverse the order of the bits.
>
>2) Timing control not as flexible as in the BS2. Ie cannot control
>when the BX-24 should sample bits from ds1302, ie. Before OR after
>clock line pulse. >Has anyone been successful in connecting the BX-24 to the ds1302
>and if so, can you provide any useful pointers?
>
>Thanx. >
>





That was exactly what I needed!

Thanx-a-million!

Neil Ian Casey <> wrote:
Theres a sample program maybe more for the DS1302 in the files section.

Regards
Ian

neilgrey wrote:

>Hi folks:
>
>I've built a circuit which uses a BS2 connected to a DS1302 RTC.
>
>For several reasons i've decided to replace the BS2 with the BX-24.
>
>However when reviewing the docs for the BX-24 I noticed there are
>some restrictions on the SHIFTIN, SHIFTOUT instructions such as:
>
>1) The bits are shifted MSB first but the ds1302 requires LSB.
>Possible work around would be to reverse the order of the bits.
>
>2) Timing control not as flexible as in the BS2. Ie cannot control
>when the BX-24 should sample bits from ds1302, ie. Before OR after
>clock line pulse. >Has anyone been successful in connecting the BX-24 to the ds1302
>and if so, can you provide any useful pointers?
>
>Thanx. >
>
---------------------------------
Yahoo! Groups Links

To

---------------------------------