I was so impatient to try the suggestions made that I took the rest of the day off.
Below is the modified code. I added another digit in hopes that the change might reveal the problem...
Code:#CONFIG __config _CONFIG1, _INTRC_IO & _WDT_OFF & _PWRTE_OFF & _MCLR_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_PROTECT_OFF & _DEBUG_OFF __config _CONFIG2, _FCMEN_OFF & _IESO_OFF #ENDCONFIG OSCCON = %01110000 'SET OSC OPTIONS DEFINE OSC 8 ANSEL = %00000011 'SET ANALOG TO DIGITAL TRISA = %00000000 'SET PORTS OUTPUT TRISB = %00000000 SDA VAR PORTB.1 SCL VAR PORTB.4 OUTP VAR BYTE LP VAR BYTE CHP100 VAR BYTE CHP010 VAR BYTE CHP001 VAR BYTE CHP100 = $74 CHP010 = $72 CHP001 = $78 mainloop: FOR LP = 0 TO 9 READ LP, OUTP I2CWRITE SDA, SCL, CHP001, CHP001, OUTP 'WRITE 1's PAUSE 250 I2CWRITE SDA, SCL, CHP010, CHP010, OUTP 'WRITE 10's PAUSE 250 I2CWRITE SDA, SCL, CHP100, CHP100, OUTP 'WRITE 100's PAUSE 250 NEXT LP Goto mainloop 'LOGICAL END DATA 63, 6, 91, 79, 102, 109, 124, 7, 127, 103 End
I think there is some progress in that now, at least, each digit will work independently. Applying power with all three modules plugged in, one (random) will work. Pulling the functioning digit, one of the others begins to cycle. Regardless of which digit I remove, one will always work; the others do not. It doesn't matter which spot they occupy - as long as they have a valid address.
In addition, I tried changing the value of the I2C resistors: 3K3, 4K7, 10K0 - no change in function. The circuit is run from adequate supply and is well filtered...
I still don't understand the "control" byte well, but RTFM indicates the class should match the fixed part of the address (MSBs) and the LSB should be zero; the addresses satisfy those requirements and beyond that I don't understand well enough to make an intelligent correction.




Bookmarks