ds1307_how_to_access_ram
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ds1307_how_to_access_ram [2011/09/12 21:39] – tomgee | ds1307_how_to_access_ram [2011/09/12 21:44] (current) – tomgee | ||
---|---|---|---|
Line 3: | Line 3: | ||
The Ram on the device starts at address 0x08. The first 7 locations are the RTC.\\ | The Ram on the device starts at address 0x08. The first 7 locations are the RTC.\\ | ||
- | {{: | + | {{: |
+ | |||
+ | To get to the start of RAM, use the following code: | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | This will set the I2C address to 0x68, the DS1307 Address.\\ | ||
+ | The second line sets the register index to 8, the start of RAM.\\ | ||
+ | The third line, Wire.endTransmission(); | ||
+ | |||
+ | Subsequent reads from the chip will start at 8. For example, to read 4 bytes from the chip:\\ | ||
+ | | ||
+ | |||
+ | The above line will put the 4 bytes into the receive buffer. To fetch the bytes: | ||
+ | |||
+ | | ||
+ | { | ||
+ | byte c = Wire.receive(); | ||
+ | Serial.print(c, | ||
+ | Serial.print(" | ||
+ | } | ||
+ |
ds1307_how_to_access_ram.1315877955.txt.gz · Last modified: 2011/09/12 21:39 by tomgee