Keeping track of date and time

Started by David Sousa Mendes October 6, 2009
> ... I2C, SPI, 3-Wire, 1-Wire.

All of those protocols can be used, each very differently. SPI is
implemented in hardware; the others must be bit-banged in code.
Examples of each except, perhaps, 1-wire, are in the group's Files
section, I believe.

Four SPI devices can be connected simultaneously, sharing MOSI, MISO,
SCK, Vcc and ground, and each device needs its own /CS pin. SPI is fast
and easy in code, using SPICmd(); it would be my preference. Many
others, though, seem to prefer I2C.

Here's a comparison: http://pdfserv.maxim-ic.com/en/an/AN619.pdf

Out of the three protocols I have used everything but the 1 wire. I like
the I2c (Personal pref) mostly
because you can use the same two wires to communicate with several low
bandwidth devices. I currently
use it with an LCD, temperature monitor and static ram.
As far as two SPI chips communicating at the same time...do you mean on the
same set of wires or actually
communicating simultaineously. In the first case I believe you will need
one additional wire and in the second
you will need to run some sort of multi-tasking or a multi-processor like
the Parallax Propeller.

From: b... [mailto:b...] On Behalf Of
David Sousa Mendes
Sent: Tuesday, October 13, 2009 11:40 AM
To: b...
Subject: Re: [BasicX] Re: Keeping track of date and time

Hello fellows
I'm still trying to choose the best MAXIM's RTC for my application...
But in their site:
One can see that they have RTC with several serial protocols: I2C, SPI,
3-Wire, 1-Wire.
I'm a bit lost here...
1 - Which of these protocols can be used with BasicX24?
2 - Can I have 2 SPI chips communicating at the same time with the BasicX24?
3 - Is the 3-Wire protocol the normal serial protocol one uses to
communicate, for instance with a serial LCD?


David M.

Dynatest Confidential
Note: This message and any attachment hereto is intended solely for the use of
the designated recipient(s) and their appointed delegates and may contain
confidential information. Any unauthorized use, disclosure, copying, or
distribution of its contents is strictly prohibited. If you have received this
message in error, please destroy it and advise the sender immediately by phone,
email, or fax. Thank you for your cooperation

Hello everybody!

I was thinking about using the quartz crystal from a damaged bx24 on a RTC DS1302.
Does anyone know if it is compatible?


> ... compatible?

No. The DS1302 - and most inexpensive timekeeping devices, like your
watch, a digital stopwatch, clock radio, some wireless phones, etc. -
use a 32.768Hz crystal that can be easily divided to 1Hz. The BX-24
crystal is 7.3728MHz, which is a common convenient frequency to derive
serial communication rates.

There is also a small cylindrical 32.768kHz crystal on many PC
motherboards, new and old; search through your junkbox and you're likely
to find one.

> ... 32.768Hz...
Should be 32.768kHz.
I'm trying to connect a RTC (DS1305) to BX24 using SPI protocol.
Does anyone know if any I/O port from the basicx can be configured to
Serial In, Serial Out and SCLK?
And how to we say to the program which pins are we using for each?
(apart from the CE pin which is defined in OpenSPI procedure)

David M.

> ... if any I/O port from the basicx can be configured to Serial In,
Serial Out and SCLK?

No, MISO, MOSI and SCK are fixed and are available on the edge of the
BX-24 module, the center three of seven holes. On the BX-24p schematic
they are on connector H8.
And how do I physically connect what so ever to those opened holes?

> ...how do I physically connect...

I've used a few methods, but the most simple is to simply solder three
small wires to the holes.

You can also, though, use headers to connect to header pins like this:
http://rightime.com/images/DSCN0260a.JPG , or add socket pins like this:
http://rightime.com/images/DSCN0263a.JPG . The latter must be mated with
a socket to suit, perhaps a subset of this:
http://groups.yahoo.com/group/basicx/photos/album/1482585026/pic/33080814/view?picmode=&mode=tn&order=ordinal&start=1&count &dir=asc

As Tom Becker suggested, I connected my SPI wires to connector H8...
I'm using the following lines:
MOSI - connected to DataIn of my RTC
MISO - connected to DataOut of my RTC
SCLK - connected to SCLK
VCC - connected to Vccc1
Gnd - connected to GROUND

My problem is that, every time I try to download my program into the BX,
with my wires connected to H8, the download stucks and I get the error:
"Error verifying external EEPROM "

If I disconnect H8, no problems appear...
Any ideas?

David M.