i2c example adc mcp3426 wanted

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times

i2c example adc mcp3426 wanted

Post by rene »

Hello boys and girls ...

Question ...
Who has experience or can help me to get a MCP3426A0. 16 bit i2c working

I can not get it done. (not even after much struggling and trying) :oops:
The i2c FC example do not help me. :(


Ecio works .....
The display works ...
I2c MCP3426 ADC not yet.
connected as in manual ...
http://ww1.microchip.com/downloads/en/D ... 22226a.pdf

Now I'm looking for a example...:

ECIO40 or other PIC with i2c and the MCP3426 in 12bit mode ..
Value of channel 1 Visible on 2x16 LCD display
A value back 1 times per second, wil be fast enough.

Who can and will help me.??

Thanks,

Rene

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: i2c example adc mcp3426 wanted

Post by Benj »

Hi Rene,

Do you have your project so far you could upload so we can see where your getting stuck and so were not starting from scratch.

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times

Re: i2c example adc mcp3426 wanted

Post by rene »

additional information from microchip site:
Adress; = 000

I2C_start();
I2C_sendbyte(0b11010001); // MCP4326 address byte with READ command for ADC CH1
I2C_readbyte(); // Read Upper Data Byte
I2C_Ack(); // Send ACK so ADC can send Lower data Byte
I2C_readbyte(); // Read Lower data Byte
I2C_Nack(); // Send NAK to ADC
I2C_stop(); // Send Stop
Last edited by rene on Wed May 15, 2013 12:12 pm, edited 1 time in total.

User avatar
rene
Posts: 56
Joined: Sun Sep 13, 2009 11:27 am
Location: Dordrecht - Nederland
Has thanked: 5 times
Been thanked: 2 times

Re: i2c example adc mcp3426 wanted

Post by rene »

For those who find it important ......

Communication with the MCP3426 via I2C succeeded.
Attached you will find the example program, as it currently operates.
There is still to do some work, but with this I can move on.
Suggestions and improvements are always welcome, It was my first encounter with i2c :cry:

My previous versions and post are deleted, because these do not contribute.

Greeting and thanks ...

Rene
Attachments
i2cmcp3426v4_ecio.fcf
running with valid data
(21.9 KiB) Downloaded 610 times

Post Reply