PDA

View Full Version : MCP3424 18-bit ADC



guintec
- 20th April 2022, 03:15
This is my first submission.
Hi, I am a person who enjoys crafts.
I would like to check an 18-bit ADC using an MCP3424, but I am not competent enough to write the code. Can some one please give me the I2CREAD source code?
The PIC I am using is PIC18F8723.
Thank you in advance for your help m(_ _)m.

Ioannis
- 20th April 2022, 08:43
This chip is not plug and play. You need to decide how it is supposed to work (various modes at page 18 of the datasheet), meaning you have to setup the configuration register and then try to work with the converter.

The device code is 1101 (factory set) and you have to blend it with the address pins A0,A1,A2 in the address byte, the first byte sent to the chip (page 19-21). I would tie the A0 and A1 to ground and have an address of 000 combined with the 1101, that is 1101000. This will be the first byte in the I2C command. But you have to do the config first.

Ioannis

guintec
- 20th April 2022, 09:01
Hello, Ioannis.
Thank you for your explanation.
My knowledge is still insufficient to understand it, but I will study further the parts you explained.
I am looking for a reference source code in picbasic format, but I am having trouble finding good information.
If you know of a good reference (source code), please let me know further.
Thank you very much.
guintec.

Ioannis
- 20th April 2022, 13:07
Well, the best reference is in your PBP manual on I2CRead and I2CWrite commands. If you really want a ready made ready to run code for this specific chip, well, I think is not going to happen. I do not have this chip and I guess no one else. Or there would be some sample codes.

Your best chance is to have a circuit, some test and if your code fails, post it to have a look and help on that.

Ioannis

guintec
- 20th April 2022, 23:57
Good day. Ioannis.
Thank you for your comments.
Now that the components and test circuit are ready, I will proceed with the actual programme coding. ^^

guintec.