I have set up a test environment with the superpro and a matrix orbital glk19264A-7T display using SCL on pin 11 and SDA on pin 10. 4.7k from both lines to +5v.
The manual for the display can be found at the bottom of this page
https://www.matrixorbital.com/glk19264a-7t-1u
The display powers up and the jumpers are preset to I2C.
The display is not returning any response to my code present = 0
The code is as follows:
------[ Display Address]------------
' Matrix Orbital
' Address is 0x50 for Write and 0x51 for read
#include <I2c.bas>
#include <LPC17xx.bas>
#define I2C_SDA 10 ' Pin # 10 ' I2C SDA
#define I2C_SCL 11 ' Pin # 11 ' I2C SCL
#define I2Cspeed50 50 ' clock set to 50kb
#define I2C_LCD_ADDR 80 ' &H50
'---------------[ I2C Routines for the LCD Display ]-------------------
'-----------------------[ Init LCD ]-----------------------------------
' Initialization For ST7036i
' I2COUT (SDApin, SCLpin, addr, OUTcnt, BYREF OUTlist as string)
'----------------------------------------------------------------------
Sub Init_LCD
DIM JMDString(20) as String
DIM msgrow(20) as String ' Holds message to be displayed
DIM LCD_String(6) as String
DIM i2cPresent as integer
DIM ADx as INTEGER
DIM LCD_Row(5) as String
Dim RowNum as Integer
JMDString = "James McDougall"
Print "Init LCD"
LCD_String(0) = 254 ' Function Set Basic
' Continue to send commands in 'Basic mode'
' select protocol
LCD_String(1) = 160 '
LCD_String(2) = 0x00
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 3, LCD_String)
print "i2cPresent = "; i2cPresent
WAIT(250) ' Delay 250mS
'
LCD_String(1) = 82 ' Set Auto Line Feed wrap Off
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 2, LCD_String)
print "i2cPresent = "; i2cPresent
WAIT(250) ' Delay 250mS
'LCD_String(1) = 66 ' Display ON
' i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 2, LCD_String)
' print "i2cPresent = "; i2cPresent
' WAIT(250) ' Delay 250mS
LCD_String(1) = 88 ' Clear Display
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 2, LCD_String)
print "i2cPresent = "; i2cPresent
WAIT(250) ' Delay 250mS
LCD_String(1) = 72 ' Go to Home
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 2, LCD_String)
print "i2cPresent = "; i2cPresent
WAIT(250) ' Delay 250mS
'----------------------------------------------------------------------
' McDougall screen
'----------------------------------------------------------------------
LCD_Row(0) = 254 ' 0011 1000 0x38 Function Set Basic
LCD_Row(1) = 121 ' 1100 0000 0xC0 Set cursor
LCD_Row(2) = 1 ' 1100 0000 0xC0 Set column
LCD_Row(3) = 1 ' 1100 0000 0xC0 Set row
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 4, LCD_Row)
WAIT(250)
' send name string
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 15, JMDString)
WAIT(250) ' Delay 250mS
' Call LCD_DisplayMsg(1,3))
' i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 20, 3)
Wait(250)
JMDString = "@ Copyright 2022 "
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 20, JMDString)
' set led top to green
LCD_Row(0) = 254 ' 0011 1000 0x38 Function Set Basic
LCD_Row(1) = 90 ' 1100 0000 0xC0 Set cursor
LCD_Row(2) = 0 ' 1100 0000 0xC0 Set column
LCD_Row(3) = 1 ' 1100 0000 0xC0 Set row
i2cPresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 4, LCD_Row)
WAIT(250)
RETURN
EndSub
'----------------------------------------------------------------------
' Clear Display
'----------------------------------------------------------------------
Sub LCD_Clear
DIm clrpresent as integer
DIM LCD_Clr(2) as String
LCD_Clr(0) = 254 ' Function Set Basic
LCD_Clr(1) = 88 ' Clear Screen
clrpresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 1, LCD_Clr)
WAIT(500)
RETURN
EndSub
'----------------------------------------------------------------------
' This is common code for displaying a row on a specific line on the LCD
'----------------------------------------------------------------------
SUB LCD_DisplayMsg(BYREF rownum as integer, BYREF msgrow as String) ' Line Msg
DIM msgpresent as Integer
DIM LCD_Row(5) as String
LCD_Row(0) = 254 ' 0011 1000 0x38 Function Set Basic
LCD_Row(1) = 71 ' 1100 0000 0xC0 Set cursor
LCD_Row(2) = 1 ' 1100 0000 0xC0 Set column
LCD_Row(3) = rownum ' 1100 0000 0xC0 Set row
msgpresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 4, LCD_Row)
WAIT(250)
msgpresent = I2COut(I2C_SDA, I2C_SCL, I2C_LCD_ADDR, 20, msgrow)
Wait(250)
RETURN
EndSub
MAIN:
GOSUB Init_LCD
END
IS there something I have missed or done wrong?
Thank You