Author Topic: I need 3000 Hz Output sampling in MCUs  (Read 9416 times)

0 Members and 1 Guest are viewing this topic.

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: I need 3000 Hz Output sampling in MCUs
« Reply #50 on: January 19, 2023, 03:17:59 am »


I use the above Electrostatic Discharge protection devices whenever I touch the EEG electrodes.. They are, ESD mat, ESD wrist bands, both connected to ground, and even make sure the humidity is high (to naturally conduct static to ground via droplets of humidity) in air.  But I can't take chances touching the chips to trace longer period because of risk of ESD damage. The ADS1254E warns that




Therefore I would not try anymore to trace the external 24 bit ADC complex pathways to the MCU to avoid any subtle performance degradation from slight ESD damage ruining the $2000 equipment which I won't be able to buy again (I had to acquire it from licensed medical doctor for experimental purposes). Look at the back of the PCB how complex the connections are.





By the way. Do you know what the labels or wordings at the right near top mean? Also Is there a pc software where you can overlap the front and back images of the PCB together and you can rotate it in 3D and trace them? You can do it as a PCB.Wiz, right?   I won't attempt to trace the hardware in detail anymore to avoid risk of subtle ESD damage.

Fortunately. The EEG module has additional auxiliary inputs that makes use of the MSP430 built-in 12 bit ADC chip itself. So I'm looking for a generic software libarary that can read from all ADC channels and output to the FDTI USB chip.



I downloaded the latest FDTI chip drivers and it worked with the module, that means the output connection is generic.

Therefore there must be library to output the EEG  unit MSP430 built-in 12 ADC input. Can you guys share the generic firmware program to do that?

It took me weeks to figure out how to do that with the HC11 programming learning its assembling language instructions. Now I can't spend months just to figure out the basic library routine already available in the public. So kindly share the program. Thanks.
« Last Edit: January 19, 2023, 03:21:08 am by planc »
 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: I need 3000 Hz Output sampling in MCUs
« Reply #51 on: January 19, 2023, 08:19:01 am »
Ok. What MCU is easiest to interface with the 24 bit ADC ADS1254E?
Also if I put everything in breadboard. What noises would be introduced by using breadbroad only?
Avoid breadboards !

If you want to avoid reverse engineering, you may be smarter to work backwards, and search Digikey etc for Eval Boards of suitable ADCs.  Those already have chips mounted and are tested.
TI and ADi will have plenty, in SPI and i2c

Ones like this, are even already medically focused : https://www.ti.com/tool/ADS1292ECG-FE


Besides UARTS there are now available also i2c and SPI USB Bridge parts, so you could also research if no remote MCU at all is needed !
You might manage this entirely from the PC side.

Unfortunately. The direct auxiliary input of my EEG module that uses the MSP430 chip built is 12 bit ADC has full scale range of 0-2.5 volts and accuracy of 0.2 millivolts. That means if the input would be 1mv. It can only digitize it 5 levels only? This is versus the external ADC ADS1254E 24 bit with listed EEG A/D accuracy of 0.024 microvolts (NOT millivolt) and 200 millivolts A/D Full Scale Accuracy.

So your device suggestion is still the best. But the sampling limit is only 500 samples per second. Can you make it into thousands? If you have time, please download it. No problem with export as you are not uploading it to NK.

I read the following about a TI evaluation board based on EEG.

https://www.ti.com/tool/ADS1299EEGFE-PDK

and a question and answer related to it:

https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/693245/ads1299-does-the-ads1299-capture-eeg-signals-require-an-external-amplification-circuit



Unfortunately, I don't have email company account which is required to register and ask questions there.

My question is. What would happen (in an ADC context) to an EEG device that expects microvolts input if the input is in the millivolt ECG/EMG range instead? A typical EEG has 0.024 microvolts A/D accuracy and 200 millivolts A/D full scale range.

I can't interpret my EEG screen output because there is no amplitude measurements.

 

Online gf

  • Super Contributor
  • ***
  • Posts: 1470
  • Country: de
Re: I need 3000 Hz Output sampling in MCUs
« Reply #52 on: January 19, 2023, 10:41:53 pm »
I think gf meant a soundcard oscilloscope. I was thinking a sound editing program that can display the waveforms. But aren't they the same?

Your aim is to capture signals in the audio frequency range, and all I wanted to say is that soundcards (or audio interfaces, or however you want to call them) are basically capable to do that. The idea seems not to be new -- I also found this article.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2288
  • Country: au
Re: I need 3000 Hz Output sampling in MCUs
« Reply #53 on: January 19, 2023, 10:46:26 pm »
What modern high end sound that can connect it to preamp and display the output?
Search AliExpress et al for USB sound cards.
The very simplest/very cheap ones have  single MIC jacks, and then you can get  2 MIC / headphones, and then 2 MIC + Line in + SPDIF links all for quite low prices.

And the Rigolna digital oscilloscopes are expensive.
Not for what they can do.

In the 1980s. Were there sensors that could record up to 200 kHz?? If not, then this is one strong point to debunk Dr. Hunt stuff.
AM radios manage 455kHz IF and 1MHz RF sections for many decades before that.

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16273
  • Country: fr
Re: I need 3000 Hz Output sampling in MCUs
« Reply #54 on: January 19, 2023, 10:53:21 pm »
I think gf meant a soundcard oscilloscope. I was thinking a sound editing program that can display the waveforms. But aren't they the same?

Your aim is to capture signals in the audio frequency range, and all I wanted to say is that soundcards (or audio interfaces, or however you want to call them) are basically capable to do that. The idea seems not to be new -- I also found this article.

Well, conversion-wise, sure, a sound card can do the job.
A few points:
- You'll still need proper conditioning (amplification) of the signals, EEG signals are very low voltage, and you very easily get coupled noise,
- EEG requires multiple channels to be useful - something you won't find in a sound card, unless you go for like a studio audio interface with 16 or 32 channels, I wouldn't see the point of using that then rather than more ad-hoc gear,
- Important: the interface from electrodes should absolutely be ISOLATED. Anything that would be connected to a computer directly without galvanic isolation is not fit for being connected to the scalp through electrodes.
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1470
  • Country: de
Re: I need 3000 Hz Output sampling in MCUs
« Reply #55 on: January 19, 2023, 11:37:44 pm »
- You'll still need proper conditioning (amplification) of the signals

The pre-amp is supposed to do that.

Quote
- Important: the interface from electrodes should absolutely be ISOLATED.

The authors of the the PubMed paper obviously did not care. But they did not scalp through.

The question is, what's good enough?
Can we consider a laptop running on battery w/o external connection to mains or anything else as sufficienctly isolated?
Would an USB isolator between PC and an USB sound card provide sufficient isolation?
The opamp inputs are coupled via capacitors. Do they provide good enough galvanic isolation if Y types are used?
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7529
  • Country: fi
    • My home page and email address
Re: I need 3000 Hz Output sampling in MCUs
« Reply #56 on: January 20, 2023, 12:45:23 am »
But what is the maximum sampling the modern MCU can handle? Like can it handle 500,000 Hz Or is there a limit like 250,000 Hz sampling.
My current favourite, Teensy 4.0, can do 1,000,000 samples/sec continuously writing them to an SD card (in binary form); 2,500,000 samples/sec when interleaving the two ADCs.  Although the ADCs have nominally 12 bit precision, only 10 bits or so are noise-free on this board.
Teensy 4 also have a (actually two) native USB 2.0 High Speed (480 Mbit/s) interface, that I've verified can do well over 200,000,000 bits/sec (25 Mbytes/sec) in one direction.
Then again, it is an NXP i.MX RT1062 running at 600 MHz.   Costs only $24, though, and comes with Teensyduino, an Arduino add-on for programming it in the Arduino environment.

Obviously, the exact capabilities vary from MCU to MCU.  Some have only one ADC, some have several (in which case they can often be interleaved, so that one takes a sample while the other is still in the process of conversion), possibly multiplying the maximum sample rate (even from a single source signal).
Teensy LC (NXP MKL26Z64VFT4, ~ $13 but no stock right now, USB Full Speed 12 Mbit/s) runs at 48 MHz, and has a single 16-bit ADC (about 12-13 effective bits), but I haven't checked the maximum sample rate on it (but see pedvide's ADC library).  I'd expect it to be somewhere between 100,000 and 400,000 samples per second (using HIGH_SPEED and ADACK_6_2), though, if that helps.

In general, I do like microcontrollers with native USB interfaces, because of the increased bandwidth – even USB 1.1 Full Speed (12 Mbit/s) on 8-bit AVRs like ATmega32U4 can do over a million bytes per second over USB Serial – and implementation options: if you want a custom keyboard/mouse/joystick, you don't even need any OS drivers at all, just program the microcontroller USB endpoints, connect the buttons/sensors/etc., and It Just Works.

(I have looked at various data acquisition ADCs that have very nice properties, so you definitely do not have to use the internal ADC on the MCU.  A SPI bus running at a few MHz, over digital isolators like Si866x, and a small isolated DC-DC controller followed by some serious smoothing and a linear regulator, and you can have a fully isolated analog sensor frontend.  I'd love to have one of those, myself, just for fun.)

As I've mentioned before in other threads here, the aforementioned Teensies are excellent for hobbyist and development tests, but not that suitable for basing your commercial products on.  Definitely good for one-off projects; they're well designed, and the forum is friendly and knowledgeable, and the developer (Paul Stoffregen of PJRC) participates there a lot.  Only the bootloader (which you can buy separately in a pre-programmed chip) and the exact board files are proprietary.

For hobbyist and one-off purposes, I know for a fact that it is a good fit for interfacing to various kinds of sensors (Teensy 4.1 if collecting data to an SD card) and displays and such, because that's what I typically use them for.  But I am only a hobbyist, not an EE, and do not develop any products; just gadgets I or my friends or colleagues need for a project or another.  Stuff like Pt100 temperature sensors, high-frequency current monitoring for SBC current draw (to see short spikes, since they often do not have much (enough) capacitance on their main voltage buses), OLED and IPS TFT display modules, buttons and joysticks, and such.
 

Offline plancTopic starter

  • Regular Contributor
  • *
  • !
  • Posts: 149
  • Country: us
Re: I need 3000 Hz Output sampling in MCUs
« Reply #57 on: January 20, 2023, 06:08:22 am »
I think gf meant a soundcard oscilloscope. I was thinking a sound editing program that can display the waveforms. But aren't they the same?

Your aim is to capture signals in the audio frequency range, and all I wanted to say is that soundcards (or audio interfaces, or however you want to call them) are basically capable to do that. The idea seems not to be new -- I also found this article.

The problem with sound card is the low input impedance. I read in that article:



For high frequency say 5000 Hz, what is the impedance of the skin?

When I googled for the best 24 bit sound cards, for example https://www.amazon.com/192kHz-Digital-Mixing-Recording-Production/dp/B0B4YG4CBC I saw the input impedance spec as only 18.5 kOhm



My EEG has the following input impedance:



More than 1000 GigaOhm input impedance!  What sound card brand/model has this value too guys?  Is it expensive to use 1000 GigaOhm input impedance amplifier in sound card?
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: I need 3000 Hz Output sampling in MCUs
« Reply #58 on: January 20, 2023, 06:23:17 am »
Don't attach electrodes to the sound card directly, use amplifier with whatever input impedance you need.

You are swinging from one extreme of designing a whole bunch of custom equipment to the other extreme of not using any equipment at all.
Alex
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1470
  • Country: de
Re: I need 3000 Hz Output sampling in MCUs
« Reply #59 on: January 20, 2023, 01:40:00 pm »
The problem with sound card is the low input impedance. I read in that article: [...]

Well, if you continue reading, then you will read how the authors have addressed this issue by breadboarding a simple pre-amplifier, consisting of only a few components.
 

Offline eutectique

  • Frequent Contributor
  • **
  • Posts: 476
  • Country: be
Re: I need 3000 Hz Output sampling in MCUs
« Reply #60 on: January 26, 2023, 10:21:49 am »
Quote from: planc
I'm curious and need to know.

Here we go.

These are all miracles of technology. Just google "the more expansive fields were skewed upward" and you get exactly one match. (There will be two after my comment, I can prevision the future)
 

Online pcprogrammer

  • Super Contributor
  • ***
  • Posts: 4987
  • Country: nl
Re: I need 3000 Hz Output sampling in MCUs
« Reply #61 on: January 26, 2023, 11:01:40 am »
... (There will be two after my comment, I can prevision the future)

Your crystal ball is to quick  :-DD

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16273
  • Country: fr
Re: I need 3000 Hz Output sampling in MCUs
« Reply #62 on: January 26, 2023, 06:46:51 pm »
What? :popcorn:
 
The following users thanked this post: gf, eutectique, pcprogrammer

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: I need 3000 Hz Output sampling in MCUs
« Reply #63 on: January 26, 2023, 06:58:33 pm »
Yeah, this escalated quickly.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf