Digole
©DIGITAL
SOLUTIONS

Serial Display emulator    New Display User manual

Forum login or
Login:
Password:
  
Forum Catagory
Digole Serial Display (210)
  12864 LCD/OLED module (24)
  24064 LCD module (3)
  Color LCD Modules (29)
  Color OLED module (20)
  Online Emulater (5)
  Universal GLCD module (1)
  Universal Text LCD module (2)
Mini Display Panels (0)
  Mini LCDs (0)
  Mini OLEDs (0)
Pattern Drive Module (0)
~Buy & Sell on Digole (2)
~Others~ (5)
Forum : Digole Serial Display : Color LCD Modules :

 Search Forum.. 
 Creat New Topic   Reply 

Digole 4.3inch display reading data or touch screen info via I2C

I am using a PIC18F97J60 to talk to a Digole 4.3inch display.   Using I2C mode.  All my write commands for graphics, text, cursor position, color, screen brightness work.

But reading data from the display, RPNXYI, RDBAT, RDTMP just gives me a 0xFF and 0xFFFF respopnses (no data just passive 3.3K ohms pull up resistor to 5v

so the pin doesn't float for diagnostics).  Is there an I2C waveform capture to indicate what the response should look like?   Should the last bit in the address field be

0 or 1 or maybe that doesn't matter?   Should I wait 20uS or 50uS for the display to fetch the data after sending the comand string?  Should I resend the address field

again before looking for the data bytes?  Maybe there is a bit rate limit for reading data vs writing data?   After writing this, I will slow down the bit rate to see if that has an impact.

The I2C interface program I have works for reading registers on 3 axis accelerometers, LM75B and some other volatile gas sensors... so I think the read commands need to be an exact format

the Digole display is seeking that I am missing something simple.

 

RE:Digole 4.3inch display reading data or touch screen info via I2C

Does your display have touch panel installed? 

These commands only work when touch panel and chip installed.

RE:Digole 4.3inch display reading data or touch screen info via I2C

I bought it from dig-ole of canada a few months ago.  TFT indicates and description indicates touch screen... I figure if lacked a touch screen, the RDBAT and RDAUX would still respond.

Unfortunately, its rather permanently mounted so all I can see under the display is the 21/4/08 date code and Pb with a slash (no lead solder symbol).  Below is the cut & paste of the add title.

4.3" Serial:UART/I2C/SPI IPS TFT LCD 800x480 Module 2MB Flash Arduino/Teensy/ESP

I have a 2.4" OLED display with compatible commands and the 2.4" is described the same way with TFT.   I don't use it since its smaller.  The tiny 6 pitch font  on this is too small for me to read.

Both displays would have benefitted from a 24 to 32 pitch font selection vs. the 6.

 

 

 

 

 

RE:Digole 4.3inch display reading data or touch screen info via I2C

The title of the item you gave has no touch screen.

You can try to read the EEPROM or Flash memory on the screen module to see if the communication on I2C works or not.

WREP”-write data to EEPROM, “RDEP”-read data from EEPROM

RE:Digole 4.3inch display reading data or touch screen info via I2C

 ad described is vague.... so my belief is that it has a touch screen, but I don't know how much memory it has

RE:Digole 4.3inch display reading data or touch screen info via I2C

 OK I'll try the write and read a EEPROM location to see what is does Thursday....

RE:Digole 4.3inch display reading data or touch screen info via I2C

I am sending this specific string:

DIGOLE_EEPROM_WRITE  db   "WREP",0x00,0x12,0x00,0x04,0x31,0x41,0x59,0x26,0   ; 0 is a terminator on all other digole commands, the string is 13 bytes long

then I have the 18F97J60 wait 100mS to allow the OLED to process that message before asking for the eeprom read (I tried 20uS to 100mS delays).

 

Does this eeprom write and read go to a different memory IC or range in the digole display?    looks like no EEPROM at this address range.

Seems like there should be 900 bytes per the digole memory map spec.   But as a I stated in prior posting, the read I2C byte might be missing something.

I looked up in the MicroChip PIC18F97J60 CPU spec, it doesn't apper to support "SCLK stretching" as a MASTER/SLAVE synchronzing method for its I2C.

I could doctor up the code to read the SCLK when I have the I2C interface switch over from transmit to receive, but the CPU can't wait long, I think the I2C message 

time out period is around 50uS before the digole believes there is an erronious I2C message or message frame problem.

The PIC18F97J60 will monitor to SCLK in SPI mode (a different 3 wire serial interface method where data in and data out are separate signals).  

The 18F9760 might not be fully compliant to document UM10204_NXP_I2C_Spec_2021,pdf for I2C mode

when the 18F97J60 is the I2C Master or is message command source.

 

OK maybe the Digole OLED unit I have doesn't have extra memory or a touch sensitive screen.   What command can I send and get a

valid response to check to see if the read byte method is working correctly?   A Digole Part Number or internal software version number register?

 

NOTE  I had a photo to include showing the response was 0xFF to the read request, but the Digole server is disabled prevening me from uploading a photo...

 

RE:Digole 4.3inch display reading data or touch screen info via I2C

Refer to the following code for PIC chips:

unsigned i2c_readByte(void) {
    unsigned char read_byte;
    i2c_Start(); // send Start
    i2c_Address(I2CAddress, I2C_READ); // Send slave address - read operation
    read_byte = i2c_Read(0);
    i2c_Stop(); // send Stop
    return read_byte;
}
 
 
 
 
#include <htc.h>
#include "i2c_hardware.h"
 
//* for PIC16F1829, use I2C port 2
void i2c_Init(unsigned char adr) {
 
    TRISB|=0B10100000;  //PIN 7,5 are SCL and SDA
    SSP2CON1 = 0b00101000; // I2C enabled, Master mode
    SSP2CON2 = 0x00;
    // I2C Master mode, clock = FOSC/(4 * (SSPADD + 1)) 
    SSP2ADD = 0xff; // 100Khz @ 16Mhz Fosc
 
    SSP2STAT = 0b10000000; // Slew rate disabled
    I2CAddress = adr;
    SSP2IF = 0;
    SSP2IE = 0; //disable I2C interrupt
}
 
// i2c_Wait - wait for I2C transfer to finish
 
void i2c_Wait(void) {
    while ((SSP2CON2 & 0x1F) || (SSP2STAT & 0x04));
}
 
// i2c_Start - Start I2C communication
 
void i2c_Start(void) {
    SSP2CON2bits.SEN = 1;
    while(!SSP2IF);
    SSP2IF=0;
}
 
// i2c_Restart - Re-Start I2C communication
 
void i2c_Restart(void) {
    SSP2CON2bits.RSEN = 1;
    while(!SSP2IF);
    SSP2IF=0;
}
 
// i2c_Stop - Stop I2C communication
 
void i2c_Stop(void) {
    SSP2CON2bits.PEN = 1;
    while(!SSP2IF);
    SSP2IF=0;
}
 
// i2c_Write - Sends one byte of data
 
bit i2c_Write(unsigned char data) {
    SSP2BUF = data;
    while(!SSP2IF);
    SSP2IF=0;
    return(SSP2CON2bits.ACKSTAT);
}
 
// i2c_Address - Sends Slave Address and Read/Write mode
// mode is either I2C_WRITE or I2C_READ
 
bit i2c_Address(unsigned char address, unsigned char mode) {
    unsigned char l_address;
 
    l_address = address << 1;
    l_address += mode;
    return i2c_Write(l_address);
}
 
// i2c_Read - Reads a byte from Slave device
 
unsigned char i2c_Read(unsigned char ack) {
    // Read data from slave
    // ack should be 1 if there is going to be more data read
    // ack should be 0 if this is the last byte of data read
    unsigned char i2cReadData;
    SSP2CON2bits.RCEN = 1;
    while(!SSP2IF);
    SSP2IF=0;
    i2cReadData = SSP2BUF;
    if (ack) SSP2CON2bits.ACKDT = 0; // Ack
    else SSP2CON2bits.ACKDT = 1; // NAck
    SSP2CON2bits.ACKEN = 1; // send acknowledge sequence
     while(!SSP2IF);
    SSP2IF=0;
   return ( i2cReadData);
}
//*/end of hardware
void i2c_PutString(const unsigned char *s, int l) {
    int i = 0;
    i2c_Start();
    i2c_Address(I2CAddress, I2C_WRITE);
    while (l--)
        i2c_Write(s[i++]);
    i2c_Stop();
}
 
void i2c_GetString(unsigned char *str, unsigned char number) {
    unsigned char read_byte;
    i2c_Start(); // send Start
    i2c_Address(I2CAddress, I2C_READ); // Send slave address - read operation
    // Read one byte
    // If more than one byte to be read, (0) should
    // be on last byte only
    // e.g.3 bytes= i2c_Read(1); i2c_Read(1); i2c_Read(0);
 
    while (number) {
        if (number > 1)
            read_byte = i2c_Read(1);
        else
            read_byte = i2c_Read(0);
        *str = (unsigned char) read_byte;
        DelayMs(10);
        str++;
        number--;
    }
    i2c_Stop(); // send Stop
}
 
unsigned i2c_readByte(void) {
    unsigned char read_byte;
    i2c_Start(); // send Start
    i2c_Address(I2CAddress, I2C_READ); // Send slave address - read operation
    read_byte = i2c_Read(0);
    i2c_Stop(); // send Stop
    return read_byte;
}
 
void i2c_writeByte(unsigned c) {
    i2c_Start(); // send Start
    i2c_Address(I2CAddress, I2C_WRITE); // Send slave address - read operation
    i2c_Write(c);
    i2c_Stop(); // send Stop        
}
 

RE:Digole 4.3inch display reading data or touch screen info via I2C

Thanks for all the detail.   :)

 

Copyright Digole Digital Solutions/Digole Technologies Inc., 2008-2026. All rights reserved.
Powered by Digole