ds1337 address

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

hello,

does somebody know how to write to specific register in ds1337?

i2c_start_wait(DevAdr+I2C_WRITE);
	i2c_write(0x15);
	i2c_write(0x00);	//A1F=0
	i2c_stop();

seems not to be working. :(
The aim is to switch of A1F bit in status register.

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

Just doing a quick glance here. But have been fooling with I2C lately on AVR and am willing give worthless information. Basically I'm Donny in The Big Lebowski, well-intentioned but stupid.

I suspect that you should change the first i2c_write from 0x15 to just 15. The register in the DS1337 Real-Time Clock IC that holds the Alarm-one flag bit (bit0) is number 15. In hex that is 0x0f not 0x15.

Let us know if this changes anything.

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

It worked, thank you :D ds1337 data is in bcd and somehow unintentionally i started to use it with addresses too.