Electronics > Projects, Designs, and Technical Stuff
ADC MCP3204 measuring completely off?!
<< < (3/4) > >>
nemail2:

--- Quote from: mk_ on October 31, 2018, 11:44:36 am ---SW is ok? No summingerrors after some minutes because of some kind of overrange inside some register?

Can you decode the SPI-stuff  with a logicanalyser so that you can locate the problem if it is on the ADCs or at the uc - side?

--- End quote ---

That's a good idea, I'll do that. Thanks! I have a chinese ripoff salae logic analyzer and an SDS1104X-E scope, one of them will manage to capture the SPI data and decode it.


strange thing is, though: NOW the issue starts after a few minutes. right after I finished soldering everything together, everything worked for days(!). So it seems to me like something got damaged. Literally nothing changed, suddenly errorneous readings after a few minutes where there were no wrong readings for hours earlier. Very strange and I'm very excited to find out what's wrong here :-)
mk_:

--- Quote from: nemail2 on October 31, 2018, 11:58:04 am ---
strange thing is, though: NOW the issue starts after a few minutes. right after I finished soldering everything together, everything worked for days(!). So it seems to me like something got damaged. Literally nothing changed, suddenly errorneous readings after a few minutes where there were no wrong readings for hours earlier. Very strange and I'm very excited to find out what's wrong here :-)

--- End quote ---

ESD
nemail2:
yeah might be.. although i'm quite cautious and i've never lost a device to ESD, until now... but there's always a first time.
the whole case is printed of PET-G, maybe the case got charged up. I'll try to put ESD bags everywhere beneath the mainboard so it won't be exposed to the case anymore and see if that helps.
didn't think of that yet..

thanks again!
nemail2:
success :-)

after hooking up my scope, i noticed that SPI to the ADC was at 10 MHz, regardless of what clock divider was set in the code. So I changed the ADC library to use SPITransactions (https://www.arduino.cc/en/Tutorial/SPITransaction), set the frequency to 1 MHz and that solved my issue. Readings are bang on again.

Thanks for the hint to try to decode the SPI data :-)

What I'm still curious about: Using the scope and decoding the SPI, I was reading the correct values using the scope but the software did have the wrong values. Not exactly sure how this is possible, assuming the Teensy 3.5 + the library didn't have any issues with 10 MHz. Clearly the correct values were visible on the SPI bus.
Only thing I could imagine, is that the TXB0104 level shifters flipped some bits at that frequency. However they're rated for 100Mbps data rate at 3.3V on the lower voltage side so I'm not really sure here either.

Anyway, glad it works now and thanks again for your suggesstions!
SiliconWizard:

--- Quote from: nemail2 on November 05, 2018, 04:47:16 pm ---What I'm still curious about: Using the scope and decoding the SPI, I was reading the correct values using the scope but the software did have the wrong values. Not exactly sure how this is possible, assuming the Teensy 3.5 + the library didn't have any issues with 10 MHz. Clearly the correct values were visible on the SPI bus.

--- End quote ---

It's possible that you're using the wrong SPI mode (there are 4). A very common issue with SPI devices which all seem to be implementing a different mode ;D
The timings (setup/hold time) could still be within specs with the wrong mode at 1 MHz but not at 10 MHz. Just a thought.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod