Jump to content
  • 0

MCC172 .a_in_scan_read() returns Zero every other value


Alexplace2001

Question

Hello I have a MCC172 board on a raspberry pi 4 running on bookworm OS. Everything seems to work fine, but when I collect data every other value is near to zero. 

I'm logging the data using the fft_scan.py python example in the mcc172 folder.  I also tried my own code and I get the same result. 

Here is how the data looks like:

ime data (V)
-0.442388
0.004422
-0.441754
0.004609
-0.441301
0.004313
-0.440768
0.004711
-0.440261
0.004175
-0.439663
0.004668
-0.439011
0.005475
-0.438566
0.004116

 

I used a mcc128 on the same system and worked with no issue. 

 

Thanks in advance

 

Alex

 

Data.png

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello @Alexplace2001.

The fft_scan.py Python example acquires blocks of analog input data for both channels on the MCC 172.  If you have a sensor on the second channel, move it to the first input channel to verify the sensor works and test the first sensor on the second channel to confirm the second channel works.

Regards,

Fausto

Link to comment
Share on other sites

  • 0

Hello Fausto 

 

Thanks for the quick reply.

I had a 3.7kOhm resistor on the second channel, and I was reading both channels. I changed my program to separate the output array from .a_in_scan_read() for every other value and it seems to work fine. 

Just confirm this is the normal functionality:

When reading the data array from .a_in_scan_read() for two channels in a mcc172 the format is:

[ch1,ch2,ch1,ch2,ch1,ch2,ch1,ch2.....................]

And when reading data from two channels on a mcc128 the format is:

[ch1,ch1,ch1,ch1,ch1,ch1,ch1,ch1,ch2,ch2,ch2,ch2,ch2,ch2,ch2,ch2]

 

If this is correct the example in "daqhats/examples/python/mcc172/fft_scan.py" should be updated to reflect that.

Thank you very much.

Alex

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...