It would be simpler but theres no sensor out there on my budget.(Hobbyist) Besides I want to learn how to write a library and how to read sensors with registers through I2c or SPI.
I went a ahead and bought 10xA1335 sensor chips and I am planning to use them with I2C communication.
Now they come pre-programmed with a I2C address and two hardware pins to change the address so you can use 4 of them out of the box by setting the hardware pins. :)
When you want to use more than 4 one need to change the first 5 bits in the register to a new address, coupled with the hardware pins.. gives you another 4 sensors and so on. :)
To set the new address in EEPROM memory you set a couple of enable bits and register addresses. Once everything is set you need to pulse the VCC pin (normally at 5V) with something like 17V to make it permanent.
How do you that? :confused:
Extracts from Data sheet and programming manuals:
Address: 0x319 (continued)
EEPROM Register Reference (continued)
I2C Slave Address
Sets the 5 MSB of the I2C slave address. 2 LSB of address set by the
logic state of the SA0 and SA1 pins.
The final step in writing to EEPROM is sending programming pulses on the EEPROM programming pin (the VCC pin) to set the bitfields. The VCC pulse profile necessary for EEPROM programming is shown in Figure 17. Minimum and maximum times
are described in Table 17. After EEPROM has been written, it is recommended to cycle power to the device.
Pulse Voltage min: 18V Typical: 19V Max:19.5V