Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Reading Digital + Analog Data from Sensors / Bus

OkAd9498

New Member
Hello!

I have a PCB that uses STM32U575 MCU and it has 3 sensors shown in the image connected to it through I2C bus. Using internal ADC of the MCU I want to also read the analog data that is coming from the bus. Is there a way to do it? Maybe there is a example or a reference project which I can follow and do it.

Also Question: Do I actually need ADC or DAC?

1711443106896.png
 
Generally what you do is examine docs for allowed pin voltage range, and sometimes
the ADC are specialized and have their own range. I see no evidence in datasheet that
a direct connection is a problem, so answer yes. But I would qualify that by recommending
you see if there is an ap note devoted on using that ADC that should reveal considerations
in its use.

You may or may not know there are real cheap logic analyzer PC solutions with software that can
capture and format the data captured ? Goto ebay and do a search with "logic analyzer chip".
Might be handy to use to verify your code and design.


Regards, Dana.
 
There are ways to convert the I2C to analog signals
 
An analog signal derived from a digital signal could make
V as a f() :

1) Frequency, Period
2) Pulse height
3) Pulse width
4) Duty cycle
5) Spectral properties
6) Trise, Tfall

So its up to user what properties he / she is seeking of the digital signal.


Regards, Dana.
 
To the OP:
The microcontroller seems to have fast enough ADCs for the task.
However…..
Have you given a thought about the memory requirements, both its record length and its save rate, for the data set that will be created?
 
I always like to run ADC to DAC and test for errors due to Vref or ground noise in sensor or ADC. DAC's are usually better at this.

You ought to learn how to do this and sweep the sensor to validate calibration drift , linearity and monotonic errors with environmental changes (V,Temp). (e.g. ...0111 to ...1010 skipped 1000 and 1001)

A circular buffer of data and W/R may be used or DMA using real-time from Analog Input to Output by structured uC tasks.
 

New Articles From Microcontroller Tips

Back
Top