i am working on a project w/ 5 ea MCP23017 16 bit I2C port expanders
the expander chips are spread across 4 different pcbs and are reading switches and driving status leds
i have things working pretty well but there is a mystery which i hope someone can help me chase down
conditions:
PBP is v2.60, PM is 4.08
PIC is 16F819
20MHz ext cer res (running fine)
using the I2CREAD and I2CWRITE commands
pins chosen are the SDA and SCL hardware pins just in case i want to use the hardware I2C some day
very weak pullups are at each port chip, 100K, the primary 10K pullups are at the source (not ideal i know but the runs are short)
the mystery:
('3' and '4' below refer to the I2C address in decimal, 'A' & 'B' refer to the two 8 bit ports on the chip)
PORT3B & 3A (expander port chip) is on pcb1, PIC is on pcb1 also
PORT4B & 4A (expander port chip) is on pcb2
when i read and write to 3A and/or 3B pcb1 everything is happy,
when i add a line to write to 4B then the data on 3A gets scrambled, the added line is directly after the 3A Write and simply mimics the action on 3A on another port on another board with different bit polarities and bit positions
if i REM the 4B I2CWRITE line all is well again
i beat my head on this for quite a while (no I2C monitor at hand) and then FINALLY connected pcb2 (it had been disconnected prior) and then suddenly both 3 & 4 worked correctly !
it has been my prior experience that with I2CREAD and I2CWRITE that you could do this 'open loop', i.e. if no slave chip was present the program would march on it's merry way without issues
although it is working once connected i am not comfortable proceeding without getting to the bottom of this
any thoughts or tips much appreciated, i hope this was clear
Bookmarks