Talking to a Dallas Semi DS1393...

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I'm a bit new to AVRs (but getting there). I'm using gcc-avr and want to talk to a DS1393 RTC.

This device has SCLK and an I/O pin (and a CE, but I'll always have that enabled).

Are there any gcc-avr (or other C compiler) examples that might get me started?

Thanks

Nick

Nicko

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The DS1393 has a SPI interface and, depending on the AVR you intend to use, it likely does as well. Look in the User Projects section of the Academy - there are a number of examples for GCC.

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dharper wrote:
The DS1393 has a SPI interface and, depending on the AVR you intend to use, it likely does as well. Look in the User Projects section of the Academy - there are a number of examples for GCC.

The DS1393, unlike the 1390 &'91, is TWO/THREE wire, not SPI. Hence the question.

Any ideas, anyone?

Thanks

Nick

Nicko

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry - you're right. When I looked on the Maxim web site the first thing they mentioned was SPI but it looks like they have the DS1390-DS1393 all lumped together and only the first two are SPI. Looking at the protocol description for the DS1393, it looks like they have merged MISO and MOSI into a single I/O line. I suspect the only way you'll be able to talk to it will be to bit-bang an interface. I poked around a bit and didn't find anything even close that you could start with. Just out of curiosity, why are you using the 1393 if the 1390 and 1391 will give you direct hardware support with the AVR?

Dave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This doesn't address what you asked, but I recently got rid of a Dallas RTC on a client's legacy board by replacing the old micro with and AVR and then using a watch crystal to calibrate the internal oscillator of an AVR and then using the AVR as the RTC. The client was delighted with the cost savings. If you are interested, this is done on the AVR Butterfly which provides the schematic and source code to do it.

Good Luck,
Joe

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

smileymicros wrote:
This doesn't address what you asked, but I recently got rid of a Dallas RTC on a client's legacy board by replacing the old micro with and AVR and then using a watch crystal to calibrate the internal oscillator of an AVR and then using the AVR as the RTC. The client was delighted with the cost savings. If you are interested, this is done on the AVR Butterfly which provides the schematic and source code to do it.

I need the RTC as I want to use the battery back-up modes for an embedded device that can lose its main power. The DS139x are really nice, cheap, devices.

I'm using the '93 variant ATM as it has the reset output & the SQW/INT pin, but it turns out that I could probably do without the reset. However, pin count is important, and SPI uses 4 pins and the three-wire uses... well, one less pin!

MAXIM support, who were very prompt, suggested I look at the DS1302 which has a similar interface, and for which they provide sample code. Its some of the worst C I've seen, but it works...

Nick

Nicko