An easy to use RTC, GPS and SD memory card interface
brought to you by
( RED Markers point to Pin # 1 of each header )
Note: to use the SoftwareSerial libary:
SoftwareSerial sws(6, A7);
NOTE : These pins are intended to be used for changing I2C address. Default program uses 88 as the base address (although this is completely arbitrary as long as the address does not conflict with any other devices on your I2C bus.
NOTE: Use ATMEGA internal pull-ups on these pins. For instance, to set internal pull-up on pin 8 use this code snippet:
PB0 (Arduino Pin 8)
PB1 (Arduino Pin 9)
To change I2C Address, jumper one or both of these ports to GND
This interface provides time, position, and motion information when the GPS receiver is tracking without a large processing or memory burden on the host processor. The data is read from a large table stored on the I2GPS depicted above. To read from the table, send one byte of data to the I2GPS to set the starting address. Then request the desired number of bytes to read. For instance, to read latitude and longitude, start at address 0x04 and read 8 bytes. You can also log GPS data to a file open for writing. (See SD interface). Some helper functions are defined I2GPS.h. See interface below.
* Read n_byte from slave starting from offset address addr.
* Store result stored in dest (which must be at least n_byte long).
* Return true if successful.
* Must be preceded with call to Wire.begin()
void gps_raw_write(uint8_t addr, uint8_t n_byte, uint8_t *source);
* write single byte
void gps_raw_write1(uint8_t addr, uint8_t data_byte);
* Read n_byte bytes from I2GPS starting at address addr.
* Store result in dest.
* Must be preceded by a call to Wire.begin()
bool gps_raw_read(uint8_t addr, uint8_t n_byte, uint8_t *dest);
gps_raw_read(I2GPS_LAT_ADDR, 4, (uint8_t*)&lat);
Read latitude in .001 of a degree
gps_raw_read(0, 32, gps_data);
Read 32 bytes of GPS data starting from address 0..
gps_raw_read(I2GPS_YEAR_ADDR, 6, ymdhms);
Read GPS year, month, day, hour minute, second.
The SD interface works in very much the same way but it is a little more complicated because it adds the step of opening and closing a file. There can only be one file open at a time on the I2GPS.