Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility #5

Open
waqasqammar opened this issue Jul 16, 2020 · 10 comments
Open

Compatibility #5

waqasqammar opened this issue Jul 16, 2020 · 10 comments

Comments

@waqasqammar
Copy link

Is this project can be used by esp32? if yes, can I also contribute by making esp32 SPI DMA support?

@adamfeuer
Copy link
Contributor

@waqasqammar I haven't tried using this on the ESP32. If it works, we can look at integrating changes for it. Do you have an ESP32/ADS1299 system?

@HarborDesigns
Copy link

HarborDesigns commented Oct 25, 2021

I am working with ADS1294 and ESP32. I am using ESP's SPI pins to communicate with the chip. I have a microSD card on board to store the overflow and excess data from from ADS chip.
Questions:

  1. I understand you have not tested the board with ESP32 but what would you recommend that from where I should start modifying the code to use it with ESP32.
  2. Since you are using USB to stream data at the baudrate of 200000 would it be possible to read the data at 115200 rate with just one channel continuous data read. If not that I might have to first store data to SD card and then read it via serial communication.
  3. Can you guide me where I can find pin definition in firmware for Arduino Due so that I can modify the pinouts as per my schematics

Any other helpful recommendation would be very much appreciated.

Thanks,

@adamfeuer
Copy link
Contributor

adamfeuer commented Oct 25, 2021

I haven't used HackEEG or an ADS1294/ADS1298 with the ESP32. But porting the driver should work. If you do get it working I would love to see it!

Here's the pin definitions:

https://github.com/starcat-io/hackeeg-driver-arduino/blob/master/hackeeg_driver/adsCommand.h#L29-L35

To port the driver you need to replace all the Arduino API commands with your own, unless you are using the ESP32 Arduino core. If you use that, it should be straightforward– just change the pin definitions, the serial port speed, the serial port number, and you should be good.

Don't use the SPI DMA, that only works on the Arduino Due. If you want DMA, you'll have to create that yourself. Or contact the previous poster for help. I would love to see that too.

Yes the library works at 115200 bps, and should be able to stream over that. You'll probably be restricted to 1000 or 2000 samples per second, or below, depending on which data encoding you use (JSON or MessagePack; MessagePack is more space efficient so can go a little faster).

Good luck!

@HarborDesigns
Copy link

I am using Arduino core for my ESP32. I came across this repository for DMA buffer using SPI. I think it should work. Will keep you posted.

@adamfeuer
Copy link
Contributor

@HarborDesigns Definitely try the driver without DMA first. For one channel at 115200, you may not need DMA.

@HarborDesigns
Copy link

@adamfeuer Would you be able to take a look at my initial code and help me with the issue. The repository is currently private and I can make you one of the collaborator of my project if you are available.

I am getting an error "Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled." which could be due to illegal instruction or handling of memory. You can find more resource related to error from here.

Let me know your thought are related to collaboration and error.

@adamfeuer
Copy link
Contributor

@HarborDesigns Sure make me a collaborator and I'll look at it, I may not be able to see what's wrong though.

@adamfeuer
Copy link
Contributor

@HarborDesigns I can't tell what's going on since your code is using too many ESP32 specific methods.

@HarborDesigns
Copy link

@adamfeuer I added a new file to the same repository which is simplified version for specific read tasks. Can you check if I am following the datasheet's read and write procedures.

You can find file here

The SPI library for ESP32 on Arduino can be found here

@adamfeuer
Copy link
Contributor

@HarborDesigns I can't help you debug this– I'd advise hooking up a logic analyzer and consulting the ADS1299/1294 data sheet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants