Page 1 of 1

get average voltage

Posted: Tue Nov 06, 2012 6:08 pm
by Puddy32
Hi
I have to get the average value of 4 inputs to a philips pcf8591 using I2C and a 16F88. However I have read that the pic cant handle I2C that well and I will have ' bit bang' the data. I dont really know what this means.If anyone could give me some idea of the c code I would be very grateful.
the pcf is a a/d d/a converter.I have to take four inputs, read the digital data into the pic, get the average and send it back to the pcf that sends out the average analog output.

Re: get average voltage

Posted: Tue Nov 06, 2012 6:26 pm
by Enamul
However I have read that the pic cant handle I2C that well and I will have ' bit bang' the data. I dont really know what this means.
Where you read that? PIC can handle I2C excellent and the PIC you have selected don't have hardware I2C. But you can always use software I2C which is implemented in Flowcode and can be used very easily. Do you have Flowcode or you want to do that in C as you don't have Flowcode?

Re: get average voltage

Posted: Wed Nov 07, 2012 9:02 pm
by Puddy32
I have to do it in c.
So if the pic doesnt have hardware I2C how do you use it.

Re: get average voltage

Posted: Wed Nov 07, 2012 9:31 pm
by Enamul
Hi,
you can have a look following link..
http://www.keil.com/i2c/examples.asp