![]() |
Forum Index : Microcontroller and PC projects : MCP3426 16bit ADC
Author | Message | ||||
ztoti Regular Member ![]() Joined: 27/10/2011 Location: CanadaPosts: 65 |
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 KingdomPosts: 10315 |
May help https://www.thebackshed.com/forum/ViewTopic.php?TID=7156&PID=75949#75949 |
||||
ztoti Regular Member ![]() Joined: 27/10/2011 Location: CanadaPosts: 65 |
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: CanadaPosts: 65 |
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: AustraliaPosts: 6283 |
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: CanadaPosts: 65 |
Sorry it is mistyping, I did: I2C write &B1101000,0,1,conf_byte |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
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 KingdomPosts: 10315 |
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: CanadaPosts: 65 |
Yes, it is 7 bit address. If is entered 8 bit address should be a problem, MMB doesn't accept 8 bit address. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |