SparkFun Forums 

Where electronics enthusiasts find answers.

Hardware or product specific questions are best asked here.
User avatar
By RiskLogger
#242472
Hello,
I'm trying to replicate the Openlog Geophone Logger firmware but using the available Sparkfun ADS1015 instead of the now retired ADS122C04 on the Qwiic PT100.
As an addition, I would like to be able the record the data from multiple geophone (at least 3) using some ADS1015 at the fastest rate possible (3kHz).
Since the Geophone Logger was already made to record the data using two buffers to store the data quickly and then convert and store it on the SD card in the loop, I took it as my template.
I'm encountering a MBedOS crash as soon as I try to read a value from a ADS1015 connected via I2C. In the current updated version of the Openlog firmware, the sensors values are called, converted to string and added to a "list" one by one. In the Geophone logger, the data is collected in an Timer Interrupt which might explain the crashing.
As I don't know much about using DMA or if it is even possible to make it get data with I2C from the ADC1015, I'm hesitating going with a Sparkfun IOT RedBoard and a MAX11131BOB . With an ESP32, I could have a thread buffering the data in multiple buffers and another thread saving the data to the SD card. The MAX11131 would allow to use SPI to transmit the data faster and many differential ADC inputs for the geophones.

Any suggestions are welcome and appreciated.
Best,
RiskLogger
User avatar
By PaulZC
#242474
Hi @RiskLogger,

You need to create an array of ADS1015 instances, begin them individually and read them individually.

Another user was having - what sounds like - the same issue. It was also causing a crash:
viewtopic.php?p=242133#p242133

There is some example code in the mux hookup guide which should help:
https://learn.sparkfun.com/tutorials/qw ... no-example

I hope this gets your project going,
Paul
User avatar
By RiskLogger
#242475
Hi Paul,

To see if it is even possible I'm trying to read the data from the ADS1015 without a Mux to begin with (I do have one though for later). The MbedOS crash only happens when there is a call to get values from the ADC through I2C, like getDifferential(ADS1015_CONFIG_MUX_DIFF_P0_N1) . Since there has been some changes/updates made to the current Openlog firmware and I had to make changes for the Geophone logger code to work, there is a possibility there is a mistake in the initialization which causes this crash but the output it gives is not really helpful. I tested defining TEST_PERIOD_1 and TEST_AMPLITUDE_1 to see if the code works with "fake data" and it did.

RiskLogger
User avatar
By PaulZC
#242476
Hi,

Humm. Tricky. I don't have time to go through your modified code in detail. But I'll try and offer some suggestions that may help. (It is quite a while since I wrote that code!)

IIRC, I was using Apollo3 Core version 1.2.3 at the time. Some BIG changes took place when we moved to v2 of the core and started using Mbed. I had to make a bunch of changes to the standard OpenLog Artemis firmware when that moved to v2. But I never made the same changes to the geophone code. Right now, it may help to revert back to 1.2.3.

The code was written for the original Black SparkX version of the OLA. If you're running on a Red OLA, make sure you change the hardware version definitions to match:
Code: Select all
#define HARDWARE_VERSION_MAJOR 1
#define HARDWARE_VERSION_MINOR 0
Be thorough. If you are completely replacing the ADS122C04 with the ADS1015, make sure you've searched right through the code and replaced all mentions of ADS122C04 (SFE_ADS122C04) with ADS1015.

You may be OK without a mux, provided you configure your three ADS1015's with different addresses. It supports 0x48, 0x49, 0x4A and 0x4B. In autoDetect.ino testDevice, add those four addresses - replacing the ADS122C04 0x40, 0x41, 0x44 and 0x45.

Actually, you've got me intrigued now. New code would be a nice-to-have. Can I suggest you fork the geophone logger repo on GitHub and push your changes to your fork. Post a link here and I'll take a quick look at your changes if I can spare the time.

Cheers,
Paul
User avatar
By RiskLogger
#242549
Hi Paul,

I made a fork and implemented the code with the ADS1015 up to the point where I get a MbedOS Error. I am using the Red OLA.
Here is the fork.

The mentioned error is still present :
Code: Select all
++ MbedOS Error Info ++
15:15:25.026 -> Error Status: 0x80010133 Code: 307 Module: 1
15:15:25.026 -> Error Message: Mutex: 0x1000F244, Not allowed in ISR context
15:15:25.026 -> Location: 0x2F55F
15:15:25.026 -> Error Value: 0x1000F244
15:15:25.026 -> Current Thread: main Id: 0x1001213C Entry: 0x2F431 StackSize: 0x1000 StackMem: 0x10013DC0 SP: 0x1005FE8C 
15:15:25.026 -> For more info, visit: https://mbed.com/s/error?error=0x80010133&tgt=SFE_ARTEMIS_ATP
15:15:25.066 -> -- MbedOS Error Info --

Everything works when using the fake data #DEFINEs. I don't know right now what could be the thing triggering the MbedOS error.

Would appreciate that quick look when you have to time.

Best,
RiskLogger
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum