I2c-pcf8591
I succeeded to put a Philips PCF8591 analog I/O chip to work on my stamp 2p.
The PCF8591 has 4 analog inputs and 1 analog output and it is possible to
connect a whole chain of I2C chips to one stamp 2p. (up to 255 in theory,
but about 30 is a more feasible limit)
The code I used is basically:
I2CIN 8, $91, $40, [noparse][[/noparse]AD]
This gives me the voltage on pin A0 of the PCF.
I had some dificulty understanding the manual as it was not clear to me from
there that the $A1 in the manual is composed from 1. the fixed part of the
chip's ID which is unique to each I2C-chiptype and 2. the user selectable
part depending on the wiring of the pins A1, A2 and A3 and not only the
read/write bit.
But......, it works fine now!
And there are many possibilities to extend my stamp using several I2C I/O
chips and even complete audio-preamp and -equalizing chips. Look at the
website of Philips (only one letter 'l') to see what they have for you.
Klaus
The PCF8591 has 4 analog inputs and 1 analog output and it is possible to
connect a whole chain of I2C chips to one stamp 2p. (up to 255 in theory,
but about 30 is a more feasible limit)
The code I used is basically:
I2CIN 8, $91, $40, [noparse][[/noparse]AD]
This gives me the voltage on pin A0 of the PCF.
I had some dificulty understanding the manual as it was not clear to me from
there that the $A1 in the manual is composed from 1. the fixed part of the
chip's ID which is unique to each I2C-chiptype and 2. the user selectable
part depending on the wiring of the pins A1, A2 and A3 and not only the
read/write bit.
But......, it works fine now!
And there are many possibilities to extend my stamp using several I2C I/O
chips and even complete audio-preamp and -equalizing chips. Look at the
website of Philips (only one letter 'l') to see what they have for you.
Klaus