How do I connect DS1302 to the SPI Bus of BX24

Started by djmaratt February 15, 2005

Dear friends,

Can someone please help me?

I searched a lot but I cannot seem to find wiring details for
connecting DS1302 to the BX24 SPI BUS.

I do have DS1302 data sheet that shows its pin functions but I am at
a loss when it comes to connecting ( BX 24 SPI-MOSI and SPI-MISO )
to the I/O pin of DS1302

DS1302 uses CE, I/O and SCLK for SPI connections.

This is where I have problem

SCLK on DS1302 probably goes to Bx24 - SPI-SCK
CE on DS1302 goes to Output pin ( Selected Using OpenSPI )
I/O on 1302 -----??

If you have already done this any code snippet would also be much
appreciated.

Thanks for help.
djmaratt




--- In , "djmaratt" <djmaratt@y...> wrote:
> I searched a lot but I cannot seem to find wiring details for
> connecting DS1302 to the BX24 SPI BUS.

I don't think that the DS1302 is an SPI device. If it were, it would
have SCK, MOSI and MISO pins in addition to the CS.

However, it does appear to be compatible with the BX-24's ShiftIn()
and ShiftOut() routines except that the bit ordering is backward.
You can resolve this by using the FlipBits() function before sending
and after receiving.

Don



Hi dj,
you may want to look into ds1306, I use it with SPI, I think it's a
little more expensive, but you can get it from digikey? it's easy to
use and I can help if necessary.

regards,
Ian

--- In , "djmaratt" <djmaratt@y...> wrote:
>
> Dear friends,
>
> Can someone please help me?
>
> I searched a lot but I cannot seem to find wiring details for
> connecting DS1302 to the BX24 SPI BUS.
>
> I do have DS1302 data sheet that shows its pin functions but I am at
> a loss when it comes to connecting ( BX 24 SPI-MOSI and SPI-MISO )
> to the I/O pin of DS1302
>
> DS1302 uses CE, I/O and SCLK for SPI connections.
>
> This is where I have problem
>
> SCLK on DS1302 probably goes to Bx24 - SPI-SCK
> CE on DS1302 goes to Output pin ( Selected Using OpenSPI )
> I/O on 1302 -----??
>
> If you have already done this any code snippet would also be much
> appreciated.
>
> Thanks for help.
> djmaratt