Shop OBEX P1 Docs P2 Docs Learn Events
DS3232 RTC and I2C — Parallax Forums

DS3232 RTC and I2C

GuyvoGuyvo Posts: 21
edited 2007-10-12 13:22 in Propeller 1
Hi props,

On my custom made board I put a DS3232 RTC interfaced bij I2C. I used the I2CWrite/read functions of the I2Cobject written by James Burrows based on the code of Jon Williams. This works fine but if I do some measurements with logic analyser I noticed that the SCL frequency is only 25KHz which is far from the maximum I2C bus speed of 400KHz. (some chips have even 1M !) Of course the main reason is that it's written totally in SPIN code. It would be more appropriate to write the low level clockings in assembler driven by a software BitDelay and HalfBitDelay. I don't know if somebody did this before but I love to give it try.

I could start a seperate COG given the data byte for I2C read/write by the PAR mechanism do the clockings and than stop the COG. I'm not sure this is the good approach because i'm rather new in the prop world. But because it is not obvious to do inline assembler maybe this is the only way to do so.

If anyone can give me some other ideas they are welcome. And if I have an object proper working which can deal with maximum I2C bus speed I will post it on the object collector.

Cheers
Guy

Comments

  • RaymanRayman Posts: 14,162
    edited 2007-10-12 12:23
    This could be useful for writing/reading from a i2c memory chip. But, it seems a little overkill for talking to a RTC!
  • GuyvoGuyvo Posts: 21
    edited 2007-10-12 12:50
    Agree on the overkill for RTC but my intention was to write something general for I2C devices using full clock speed. And there are some application with other I2C chips (eg EEPROM or PCF serie) that defenitly benefit a higher speed than 25Khz ! (means only approx 3KBytes/s on data exchange) My final project will interface a PCA9698 which supports the FAST I2C bus of 1M.
    The PCA9698 provides 40-bit parallel input/output (I/O) port expansion for I2C-bus applications organized in 5 banksof 8 I/O. If you must fast interact with I/O changes on the chip the more speed you have on the bus the better.

    Guy
  • RaymanRayman Posts: 14,162
    edited 2007-10-12 13:22
    That PCA9698 chip does sound interesting!· A fast i2c driver for that would make sense...· I have a PCF8574N on my desk that I was thinking about using...· It only has 8 I/O pins, but it's in a PDIP package, good for prototyping...

    This chip could also benefit from a faster i2c driver (assuming there's a free cog).

    On a side note:· I bet the Prop ROM has a fast i2c driver in it somewhere...· I suppose we could "just" dissassemble the ROM and find the i2c driver...
Sign In or Register to comment.