Author Topic: Help understanding MCP3201 Datasheet.  (Read 885 times)

0 Members and 1 Guest are viewing this topic.

Offline fc3000Topic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: gb
Help understanding MCP3201 Datasheet.
« on: December 01, 2023, 05:27:08 pm »
Hi all.
Referring to MCP3201 Datasheet: https://ww1.microchip.com/downloads/en/devicedoc/21290f.pdf
On page 19 'SERIAL COMMUNICATION' it describes the method for getting data from the device.

If i understand correctly the clocking method is to generate two clocks, to initialize the device.
And then another 12 clock to get the data.
And the sequence of data is Bo first up to B11.
Is this correct?
thank you.
Regards
Technology is Magic Made real.   (Elon Musk)
 

Offline globoy

  • Frequent Contributor
  • **
  • Posts: 286
  • Country: us
Re: Help understanding MCP3201 Datasheet.
« Reply #1 on: December 01, 2023, 05:42:28 pm »
Count the positive edges.  I think you have to give it 3 clocks and then latch B11 on the rising edge of the 4th clock.  So this means a total of 15 clock edges to get a word of data.  The first clock triggers the sample.

And then if you keep clocking the data order switches to LSB and on the 16th clock you get B1 again followed by B2, etc.  I guess they figured for the potential cost of a bunch of clocks at the beginning you could get the data in either endianness and not have to deal with it in software.
 
The following users thanked this post: fc3000

Offline fc3000Topic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: gb
Re: Help understanding MCP3201 Datasheet.
« Reply #2 on: December 02, 2023, 03:50:34 pm »
Hi globpy.
Thank you for the help.
I got it working now. I can read data.
However the readings seems to be incorrect when the voltage is low.
Foe example, at 2.1V I get 0.7V out of the Adc.
The readings get much more precise when the input voltage gets close to 2.8V.
I looked t the datasheet, but I got confused by all the charts.

Can someone tells me which chart describes this error?

Regards.
« Last Edit: December 02, 2023, 05:05:40 pm by fc3000 »
Technology is Magic Made real.   (Elon Musk)
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5699
  • Country: mn
Re: Help understanding MCP3201 Datasheet.
« Reply #3 on: December 02, 2023, 05:33:55 pm »
What is your Vref?
How are your IN+ and IN- wired?
Readers discretion is advised..
 

Offline fc3000Topic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: gb
Re: Help understanding MCP3201 Datasheet.
« Reply #4 on: December 03, 2023, 11:41:36 am »
Hi thank you for the reply.
I have a Vref of 4.096.V
Regards
Technology is Magic Made real.   (Elon Musk)
 

Offline fc3000Topic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: gb
Re: Help understanding MCP3201 Datasheet.
« Reply #5 on: December 04, 2023, 07:53:24 pm »
Just a not to let you know.
I have found the final issue.
The problem was in the software.

Regards.
Technology is Magic Made real.   (Elon Musk)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf