External board test

(Just testing the bus line)

The external board contains

8wire IO port - PCF8574P - address 0x4E - simple port write test (only lower 4 wires connected to LEDs)

D/A A/D - PCF8591P - address 0x98 - read from ad0 only

Thermometer - LM75 - address 0x90 - minimal program with 1 degree increments

SCL = PORTC.3 (pin18) - - SDA = PORTC.2 (pin 17) . . same bus as the EEPROM connects to


' test I2C expansion board
' PCF8574P at 0x4e - 8 line I/O
' PCF8591P at 0x98 - 4 A/D in, 1 A out (not used)
' LM75 at 0x90 - thermometer
AllDigital
Lcdinit
Symbol scl = PORTC.3
Symbol sda = PORTC.2
Dim addr As Word
Dim analog_in As Byte
Dim temperature As Byte
Dim i As Byte
i = 0

loop:
Lcdcmdout LcdClear
I2CRead1 sda, scl, 0x90, temperature
I2CRead1 sda, scl, 0x99, analog_in '0x98+1 to force read mode
I2CWrite1 sda, scl, 0x4e, i
Lcdcmdout LcdLine1Home
Lcdout "Temperature ", #temperature
Lcdcmdout LcdLine2Home
Lcdout " i ", #i, " An0 ", #analog_in
WaitMs 500
i = i + 1
If i = 16 Then i = 0
Goto loop