Am happy to report I've finally got the LCD working with the I2c interface, so definitely working on the mk2 remake
It's very simple test code (wasn't that simple to get it working though as it turned out, but that was down to my lack of understanding) but credit needs to go to MartynB on stardot for the original BBC code
Code: Select all
30 PROC_INIT
40 DIM M$(40) : M$="SINCLAIR QL Minerva v1.98 Mk2"
50 FOR C=1 TO LEN(M$)
60 D$=M$(C TO C)
70 C%=CODE(D$)
80 H%=(C% && HEX('F0')) || HEX('09')
90 L%=((C%*16) && HEX('F0')) || HEX('09')
100 D%=H%:I2CTXB(D%) : REMark *I2CTXB 3F D%
110 PROC_EN
120 D%=L%:I2CTXB(D%) : REMark *I2CTXB 3F D%
130 PROC_EN
140 NEXT C
150 STOP
160 DEFine PROCedure PROC_INIT
170 DATA HEX('38'),HEX('38'),HEX('38'),HEX('28'),HEX('28'),HEX('88')
175 DATA HEX('08'),HEX('88'),HEX('08'),HEX('18'),HEX('08'),HEX('68')
180 DATA HEX('08'),HEX('E8'),HEX('88'),HEX('08')
190 RESTORE 170
200 FOR D=0 TO 15
210 READ D%
220 I2CTXB(D%) : REMark *I2CTXB 3F D%
230 PROC_EN
240 NEXT D
250 END DEFine
260 DEFine PROCedure PROC_EN
270 D%=D% || HEX('04')
280 I2CTXB(D%) : REMark *I2CTXB 3F D%
290 D%=D% && HEX('FB')
300 I2CTXB(D%) : REMark *I2CTXB 3F D%
310 END DEFine
500 DEFine PROCedure I2CTXB(D%)
510 LOCal r$
520 r$=I2C_IO(CHR$(164) & CHR$(D%) & CHR$(255),0,HEX('27'),1)
530 END DEFine
Many thanks all for the various advise