Go Down

Topic: Testing MCP3208 with Uno (Read 1 time) previous topic - next topic


I'm having an issue with the Michrochip 3208 ADC.

I'm using the example code from the playground  and it seems pretty straight forward

Right now all I gout out from the serial monitor is


I'd expect 4095

I've tried connecting +5V to the Channel 1 and 2 inputs but there's no effect. Has anyone had similar issues? Is there a better way to test whether the chip is working as intended?

Eventually I'd like to use pseudo-differential input but for now i'm sticking to the single ended setup used in the example until I figure out what's wrong.


That code appears to do the right thing - you are using it verbatim and have double checked the wiring? You have decoupling on the 3208?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


Got it working. I was using an Arduino compatible board with a bluetooth module that connects over SPI. It seems there's some compatibility issue here because it works fine on my actual Arduino Uno.


If you use more than one SPI device there are several issues you must address:

a) separate chip select pin is needed for each device and they must all be set HIGH initially in setup().
b) if any of the SPI setup parameters differ between devices you have to check and reprogram the SPI hardware on every use
    in case the other device used it last.
c) if using SPI from an interrupt service routine you have to disable interrupts around all calls to SPI code in the main code.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131