Skip to content

Commit 57922e3

Browse files
authored
Merge pull request #55 from sparkfun/release_candidate
Merging release_candidate: updates for v1.8
2 parents a602ac6 + 8e1fec4 commit 57922e3

10 files changed

+102
-8
lines changed

Binaries/OpenLog_Artemis-V10-v18.bin

172 KB
Binary file not shown.

Binaries/OpenLog_Artemis-X04-v18.bin

170 KB
Binary file not shown.

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Change Log
22
======================
33

4+
v1.8
5+
---------
6+
7+
* Added a fix to make sure the MS8607 is detected correctly [54](https://github.com/sparkfun/OpenLog_Artemis/issues/54)
8+
* Added logMicroseconds [49](https://github.com/sparkfun/OpenLog_Artemis/issues/49)
9+
* Added an option to use autoPVT when logging GNSS data [50](https://github.com/sparkfun/OpenLog_Artemis/issues/50)
10+
411
v1.7
512
---------
613

Firmware/OpenLog_Artemis/OpenLog_Artemis.ino

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
This firmware runs the OpenLog Artemis. A large variety of system settings can be
1212
adjusted by connecting at 115200bps.
1313
14+
The Board should be set to SparkFun Apollo3 \ SparkFun RedBoard Artemis ATP.
15+
1416
v1.0 Power Consumption:
1517
Sleep between reads, RTC fully charged, no Qwiic, SD, no USB, no Power LED: 260uA
1618
10Hz logging IMU, no Qwiic, SD, no USB, no Power LED: 9-27mA
@@ -69,10 +71,13 @@
6971
(done) Add support for the MPRLS0025PA micro pressure sensor
7072
(done) Add support for the SN-GCJA5 particle sensor
7173
(done) Add IMU accelerometer and gyro full scale and digital low pass filter settings to menuIMU
74+
(done) Add a fix to make sure the MS8607 is detected correctly: https://github.com/sparkfun/OpenLog_Artemis/issues/54
75+
(done) Add logMicroseconds: https://github.com/sparkfun/OpenLog_Artemis/issues/49
76+
(done) Add an option to use autoPVT when logging GNSS data: https://github.com/sparkfun/OpenLog_Artemis/issues/50
7277
*/
7378

7479
const int FIRMWARE_VERSION_MAJOR = 1;
75-
const int FIRMWARE_VERSION_MINOR = 7;
80+
const int FIRMWARE_VERSION_MINOR = 8;
7681

7782
//Define the OLA board identifier:
7883
// This is an int which is unique to this variant of the OLA and which allows us
@@ -82,7 +87,7 @@ const int FIRMWARE_VERSION_MINOR = 7;
8287
// the variant * 0x100 (OLA = 1; GNSS_LOGGER = 2; GEOPHONE_LOGGER = 3)
8388
// the major firmware version * 0x10
8489
// the minor firmware version
85-
#define OLA_IDENTIFIER 0x117 // Stored as 279 decimal in OLA_settings.txt
90+
#define OLA_IDENTIFIER 0x118 // Stored as 280 decimal in OLA_settings.txt
8691

8792
#include "settings.h"
8893

Firmware/OpenLog_Artemis/Sensors.ino

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ void getData()
3535
sprintf(rtcTime, "%02d:%02d:%02d.%02d,", adjustedHour, myRTC.minute, myRTC.seconds, myRTC.hundredths);
3636
strcat(outputData, rtcTime);
3737
}
38+
39+
if (settings.logMicroseconds)
40+
{
41+
char microseconds[11]; //
42+
sprintf(microseconds, "%d,", micros());
43+
strcat(outputData, microseconds);
44+
}
3845
} //end if use RTC for timestamp
3946
else //Use GPS for timestamp
4047
{
@@ -821,6 +828,8 @@ void printHelperText(bool terminalOnly)
821828
strcat(helperText, "rtcDate,");
822829
if (settings.logTime)
823830
strcat(helperText, "rtcTime,");
831+
if (settings.logMicroseconds)
832+
strcat(helperText, "micros,");
824833
}
825834
} //end if use RTC for timestamp
826835
else //Use GPS for timestamp

Firmware/OpenLog_Artemis/autoDetect.ino

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,8 +576,8 @@ void configureDevice(node * temp)
576576

577577
sensor->saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the current ioPortsettings to flash and BBR
578578

579-
//sensor->setAutoPVT(true); //Tell the GPS to "send" each solution
580-
sensor->setAutoPVT(false); //We will poll the device for PVT solutions
579+
sensor->setAutoPVT(nodeSetting->useAutoPVT); // Use autoPVT as required
580+
581581
if (1000000ULL / settings.usBetweenReadings <= 1) //If we are slower than 1Hz logging rate
582582
// setNavigationFrequency expects a uint8_t to define the number of updates per second
583583
// So the slowest rate we can set with setNavigationFrequency is 1Hz
@@ -1273,6 +1273,7 @@ deviceType_e testDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portNumb
12731273

12741274
//Given an address, returns the device type if it responds as we would expect
12751275
//This version is dedicated to testing muxes and uses a custom .begin to avoid the slippery mux problem
1276+
//However, we also need to check if an MS8607 is attached (address 0x76) as it can cause the I2C bus to lock up if not detected correctly
12761277
deviceType_e testMuxDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portNumber)
12771278
{
12781279
switch (i2cAddress)
@@ -1283,7 +1284,53 @@ deviceType_e testMuxDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portN
12831284
case 0x73:
12841285
case 0x74:
12851286
case 0x75:
1287+
{
1288+
//Ignore devices we've already recorded. This was causing the mux to get tested, a begin() would happen, and the mux would be reset.
1289+
if (deviceExists(DEVICE_MULTIPLEXER, i2cAddress, muxAddress, portNumber) == true) return (DEVICE_MULTIPLEXER);
1290+
1291+
//Confidence: Medium - Write/Read/Clear to 0x00
1292+
if (multiplexerBegin(i2cAddress, qwiic) == true) //Address, Wire port
1293+
return (DEVICE_MULTIPLEXER);
1294+
}
1295+
break;
12861296
case 0x76:
1297+
{
1298+
//Ignore devices we've already recorded. This was causing the mux to get tested, a begin() would happen, and the mux would be reset.
1299+
if (deviceExists(DEVICE_MULTIPLEXER, i2cAddress, muxAddress, portNumber) == true) return (DEVICE_MULTIPLEXER);
1300+
1301+
// If an MS8607 is connected, multiplexerBegin causes the MS8607 to 'crash' and lock up the I2C bus... So we need to check if an MS8607 is connected first.
1302+
// We will use the MS5637 as this will test for itself and the pressure sensor of the MS8607
1303+
// Just to make life even more complicated, a mux with address 0x76 will also appear as an MS5637 due to the way the MS5637 eeprom crc check is calculated.
1304+
// So, we can't use .begin as the test for a MS5637 / MS8607. We need to be more creative!
1305+
// If we write 0xA0 to i2cAddress and then read two bytes:
1306+
// A mux will return 0xA0A0
1307+
// An MS5637 / MS8607 will return the value stored in its eeprom which _hopefully_ is not 0xA0A0!
1308+
1309+
// Let's hope this doesn't cause problems for the BME280...! We should be OK as the default address for the BME280 is 0x77.
1310+
1311+
qwiic.beginTransmission((uint8_t)i2cAddress);
1312+
qwiic.write((uint8_t)0xA0);
1313+
uint8_t i2c_status = qwiic.endTransmission();
1314+
1315+
if (i2c_status == 0) // If the I2C write was successful
1316+
{
1317+
qwiic.requestFrom((uint8_t)i2cAddress, 2U); // Read two bytes
1318+
uint8_t buffer[2];
1319+
for (uint8_t i = 0; i < 2; i++)
1320+
{
1321+
buffer[i] = qwiic.read();
1322+
}
1323+
if ((buffer[0] != 0xA0) || (buffer[1] != 0xA0)) // If we read back something other than 0xA0A0 then we are probably talking to an MS5637 / MS8607, not a mux
1324+
{
1325+
return (DEVICE_PRESSURE_MS5637);
1326+
}
1327+
}
1328+
1329+
//Confidence: Medium - Write/Read/Clear to 0x00
1330+
if (multiplexerBegin(i2cAddress, qwiic) == true) //Address, Wire port
1331+
return (DEVICE_MULTIPLEXER);
1332+
}
1333+
break;
12871334
case 0x77:
12881335
{
12891336
//Ignore devices we've already recorded. This was causing the mux to get tested, a begin() would happen, and the mux would be reset.

Firmware/OpenLog_Artemis/menuAttachedDevices.ino

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ bool detectQwiicDevices()
5151

5252
//First scan for Muxes. Valid addresses are 0x70 to 0x77 (112 to 119).
5353
//If any are found, they will be begin()'d causing their ports to turn off
54+
//testMuxDevice will check if an MS8607 is attached (address 0x76) as it can cause the I2C bus to lock up if we try to detect it as a mux
5455
uint8_t muxCount = 0;
5556
for (uint8_t address = 0x70 ; address < 0x78 ; address++)
5657
{
@@ -73,6 +74,11 @@ bool detectQwiicDevices()
7374
Serial.printf("detectQwiicDevices: multiplexer found at address 0x%02X\r\n", address);
7475
muxCount++;
7576
}
77+
else if (foundType == DEVICE_PRESSURE_MS5637)
78+
{
79+
if (settings.printDebugMessages == true)
80+
Serial.printf("detectQwiicDevices: MS8607/MS5637 found at address 0x%02X. Ignoring it for now...\r\n", address);
81+
}
7682
}
7783
}
7884

@@ -901,13 +907,17 @@ void menuConfigure_uBlox(void *configPtr)
901907
if (sensorSetting->logpDOP == true) Serial.println(F("Enabled"));
902908
else Serial.println(F("Disabled"));
903909

904-
Serial.flush();
905-
906910
Serial.print(F("13) Log Interval Time Of Week (iTOW): "));
907911
if (sensorSetting->logiTOW == true) Serial.println(F("Enabled"));
908912
else Serial.println(F("Disabled"));
909913

910914
Serial.printf("14) Set I2C Interface Speed (u-blox modules have pullups built in. Remove *all* I2C pullups to achieve 400kHz): %d\r\n", sensorSetting->i2cSpeed);
915+
916+
Serial.print(F("15) Use autoPVT: "));
917+
if (sensorSetting->useAutoPVT == true) Serial.println(F("Yes"));
918+
else Serial.println(F("No"));
919+
920+
Serial.flush();
911921
}
912922
Serial.println(F("x) Exit"));
913923

@@ -950,6 +960,8 @@ void menuConfigure_uBlox(void *configPtr)
950960
else
951961
sensorSetting->i2cSpeed = 100000;
952962
}
963+
else if (incoming == 15)
964+
sensorSetting->useAutoPVT ^= 1;
953965
else if (incoming == STATUS_PRESSED_X)
954966
break;
955967
else if (incoming == STATUS_GETNUMBER_TIMEOUT)

Firmware/OpenLog_Artemis/menuTimeStamp.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,13 @@ void menuTimeStamp()
6464
}
6565
Serial.print(F("9) Local offset from UTC: "));
6666
Serial.println(settings.localUTCOffset);
67-
67+
6868
}
6969

70+
Serial.print(F("10) Log Microseconds: "));
71+
if (settings.logMicroseconds == true) Serial.println(F("Enabled"));
72+
else Serial.println(F("Disabled"));
73+
7074
Serial.println(F("x) Exit"));
7175

7276
int incoming = getNumber(menuTimeout); //Timeout after x seconds
@@ -75,12 +79,14 @@ void menuTimeStamp()
7579
settings.logDate ^= 1;
7680
else if (incoming == 2)
7781
settings.logTime ^= 1;
82+
else if (incoming == 10)
83+
settings.logMicroseconds ^= 1;
7884
else if (incoming == STATUS_PRESSED_X)
7985
return;
8086
else if (incoming == STATUS_GETNUMBER_TIMEOUT)
8187
return;
8288

83-
if (settings.logDate == true || settings.logTime == true)
89+
if ((settings.logDate == true) || (settings.logTime == true))
8490
{
8591
//Options 3, 8, 9
8692
if (incoming == 3)

Firmware/OpenLog_Artemis/nvm.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ void recordSystemSettingsToFile()
154154
settingsFile.println("imuAccDLPFBW=" + (String)settings.imuAccDLPFBW);
155155
settingsFile.println("imuGyroFSS=" + (String)settings.imuGyroFSS);
156156
settingsFile.println("imuGyroDLPFBW=" + (String)settings.imuGyroDLPFBW);
157+
settingsFile.println("logMicroseconds=" + (String)settings.logMicroseconds);
157158
updateDataFileAccess(&settingsFile); // Update the file access time & date
158159
settingsFile.close();
159160
}
@@ -394,6 +395,8 @@ bool parseLine(char* str) {
394395
settings.imuGyroFSS = d;
395396
else if (strcmp(settingName, "imuGyroDLPFBW") == 0)
396397
settings.imuGyroDLPFBW = d;
398+
else if (strcmp(settingName, "logMicroseconds") == 0)
399+
settings.logMicroseconds = d;
397400
else
398401
Serial.printf("Unknown setting %s on line: %s\r\n", settingName, str);
399402

@@ -471,6 +474,7 @@ void recordDeviceSettingsToFile()
471474
settingsFile.println((String)base + "logpDOP=" + nodeSetting->logpDOP);
472475
settingsFile.println((String)base + "logiTOW=" + nodeSetting->logiTOW);
473476
settingsFile.println((String)base + "i2cSpeed=" + nodeSetting->i2cSpeed);
477+
settingsFile.println((String)base + "useAutoPVT=" + nodeSetting->useAutoPVT);
474478
}
475479
break;
476480
case DEVICE_PROXIMITY_VCNL4040:
@@ -866,6 +870,8 @@ bool parseDeviceLine(char* str) {
866870
nodeSetting->logiTOW = d;
867871
else if (strcmp(deviceSettingName, "i2cSpeed") == 0)
868872
nodeSetting->i2cSpeed = d;
873+
else if (strcmp(deviceSettingName, "useAutoPVT") == 0)
874+
nodeSetting->useAutoPVT = d;
869875
else
870876
Serial.printf("Unknown device setting: %s\r\n", deviceSettingName);
871877
}

Firmware/OpenLog_Artemis/settings.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ struct struct_uBlox {
128128
bool logiTOW = false;
129129
uint32_t i2cSpeed = 100000; //Default to 100kHz for least number of CRC issues
130130
unsigned long powerOnDelayMillis = 1000; // Wait for at least this many millis before communicating with this device
131+
bool useAutoPVT = false; // Use autoPVT - to allow data collection at rates faster than GPS
131132
};
132133

133134
#define VL53L1X_DISTANCE_MODE_SHORT 0
@@ -349,6 +350,7 @@ struct struct_settings {
349350
int imuAccDLPFBW = 7; // IMU accelerometer DLPF bandwidth - default to acc_d473bw_n499bw (ICM_20948_ACCEL_CONFIG_DLPCFG_e)
350351
int imuGyroFSS = 0; // IMU gyro full scale - default to 250 degrees per second (ICM_20948_GYRO_CONFIG_1_FS_SEL_e)
351352
int imuGyroDLPFBW = 7; // IMU gyro DLPF bandwidth - default to gyr_d361bw4_n376bw5 (ICM_20948_GYRO_CONFIG_1_DLPCFG_e)
353+
bool logMicroseconds = false; // Log micros()
352354
} settings;
353355

354356
//These are the devices on board OpenLog that may be on or offline.

0 commit comments

Comments
 (0)