Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:55 02 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : MCP3426 16bit ADC

Author Message
ztoti
Regular Member

Joined: 27/10/2011
Location: Canada
Posts: 65
Posted: 06:34am 24 Apr 2021
Copy link to clipboard 
Print this post

I want to use AD Converter MCP3426 (I2C 16bit ADC and PGA in one package) in my project, but after two days with no success I will give up on it. Is anyone has experience with this IC, I need a small MMB example.

Thank you,

Zoran
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 06:58am 24 Apr 2021
Copy link to clipboard 
Print this post

May help

https://www.thebackshed.com/forum/ViewTopic.php?TID=7156&PID=75949#75949
 
ztoti
Regular Member

Joined: 27/10/2011
Location: Canada
Posts: 65
Posted: 06:21am 25 Apr 2021
Copy link to clipboard 
Print this post

Thank you Peter, it's brilliant code as always.
I got the voltage=0 but I'll continue to play and will post the result.
Thank you again,

Z.
 
ztoti
Regular Member

Joined: 27/10/2011
Location: Canada
Posts: 65
Posted: 03:44am 26 Apr 2021
Copy link to clipboard 
Print this post

Hi Peter,
I worked with your basic sample but I couldn't read any information from MCP3426.
I did troubleshooting and I saw that the PIC32 send to the ADC just one byte information (just address with 9 clocks), please see the picture.

The command: I2C write &B1101000,0,conf_byte
conf_byte = &B10000000   ' ch=1,one shot,12bit,G=1

The result is on the picture. The last bit (the yellow color) on the picture is always "1" for I2Cwrite and I2Cread, the red bit is "0" for I2C write, but "1" for I2C read.
Doesn't matter what number is conf_byte, the result is always same as on the picture bellow.

Any idea what I do wrong?

Thank you

Z.



 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 04:34am 26 Apr 2021
Copy link to clipboard 
Print this post

You are missing the 'length' parameter
The command: I2C write &B1101000,0,conf_byte


should be
The command: I2C write &B1101000,0,1,conf_byte


Jim
VK7JH
MMedit
 
ztoti
Regular Member

Joined: 27/10/2011
Location: Canada
Posts: 65
Posted: 01:46pm 26 Apr 2021
Copy link to clipboard 
Print this post

Sorry it is mistyping, I did:
I2C write &B1101000,0,1,conf_byte
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 01:56pm 26 Apr 2021
Copy link to clipboard 
Print this post

If you are only seeing one byte then this suggest that the address or the wiring is wrong and the uP is not seeing the ACK after sending the address. Check the address set up of the chip, the pullups are in place and that SDA and SCK are the right way round. What does mm.i2c report?
Edited 2021-04-26 23:57 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 02:04pm 26 Apr 2021
Copy link to clipboard 
Print this post

Your address is wrong - should be

I2C write &B1101000,0,1,conf_byte 'note 7-bit address not 8

Edited 2021-04-27 00:04 by matherp
 
ztoti
Regular Member

Joined: 27/10/2011
Location: Canada
Posts: 65
Posted: 03:10pm 26 Apr 2021
Copy link to clipboard 
Print this post

Yes, it is 7 bit address. If is entered 8 bit address should be a problem, MMB doesn't accept 8 bit address.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025