Giter Site home page Giter Site logo

using ili9488 about bb_spi_lcd HOT 5 OPEN

Skywalkerf34 avatar Skywalkerf34 commented on September 12, 2024
using ili9488

from bb_spi_lcd.

Comments (5)

bitbank2 avatar bitbank2 commented on September 12, 2024

There are a large list of reasons why this may not work:

  • SPI speed too high for the display and/or wiring
  • Incorrect connections
    Based on the GPIO numbers it looks like you're using an older ESP32 (original). That MCU doesn't have a GPIO 39. This could cause an internal exception and prevent the code from running. Have you checked the debug messages coming out of the serial port?

from bb_spi_lcd.

Skywalkerf34 avatar Skywalkerf34 commented on September 12, 2024

Hi Larry,

Thanks for your answer,

I am using ESP32 WROOM module and use this one for many year already, I confirm with exactly same setup for IO with other library and it works

SPI speed is given in the other library (TFT_eSPI library) to 27000000
I alredy try with that with no more success

I should have that ILI9341 in some old stock, I will check with your original code to confirm tmr

from bb_spi_lcd.

Skywalkerf34 avatar Skywalkerf34 commented on September 12, 2024

Hi Larry,

Today I get a fresh new ILI9341 from my stock and test it with the other library on same board to confirm all pin setup

I just change those in your original example but only succeed to light the screen
I just change pin and add TFT_BL and TFT_MISO compare to your original

Here is my MOD
//
// ZIP library example sketch
//
// Written by Larry Bank
// June 9, 2021
//
// This example shows how to do the following:
// - Step through all of the files in a ZIP archive
// - Display the name of each file
// - Allocate a buffer for the uncompressed file size
// - Read (decompress) the data into the buffer
// - Display the results (in this case a BMP file) on the SPI LCD
//
#include <unzipLIB.h>
#include <bb_spi_lcd.h>
// Set these to the appropriate values for your SPI LCD display
// -1 means the pin is not connected
// The CLK and MOSI pins might be -1 for your board if it has a default SPI setup
#define TFT_CS 4
#define TFT_RST -1
#define TFT_DC 25
#define TFT_CLK 18
#define TFT_MOSI 23
#define TFT_MISO 19
#define TFT_BL 13

// Use a zip file in memory for this test
#include "bmp_icons.h"
UNZIP zip; // Statically allocate the 41K UNZIP class/structure
SPILCD lcd; // my display library

void setup() {
Serial.begin(115200);
delay(1000); // give Serial a little time to start
spilcdInit(&lcd, LCD_ILI9341, FLAGS_NONE, 40000000, TFT_CS, TFT_DC, TFT_RST, TFT_BL, TFT_MISO, TFT_MOSI, TFT_CLK);
spilcdSetOrientation(&lcd, LCD_ORIENTATION_90); // for the ILI9341 it's nice to use it in 320x240 orientation
}

void loop() {
int rc, x, y;
char szComment[256], szName[256];
unz_file_info fi;
uint8_t *ucBitmap; // temp storage for each icon bitmap

spilcdFill(&lcd, 0, DRAW_TO_LCD); // Erase the display to black
spilcdWriteString(&lcd, 0, 0, (char *)"Unzip BMP Files Test", 0xffff, 0, FONT_12x16, DRAW_TO_LCD); // white text on a black background
x = 0; y = 24; // starting point to draw bitmaps
rc = zip.openZIP((uint8_t *)bmp_icons, sizeof(bmp_icons));
if (rc == UNZ_OK) {
rc = zip.getGlobalComment(szComment, sizeof(szComment));
Serial.print("Global comment: ");
Serial.println(szComment);
zip.gotoFirstFile();
rc = UNZ_OK;
while (rc == UNZ_OK) { // Display all files contained in the archive
rc = zip.getFileInfo(&fi, szName, sizeof(szName), NULL, 0, szComment, sizeof(szComment));
if (rc == UNZ_OK) {
ucBitmap = (uint8_t *)malloc(fi.uncompressed_size); // allocate enough to hold the bitmap
if (ucBitmap != NULL) { // malloc succeeded (it should, these bitmaps are only 2K bytes each)
zip.openCurrentFile(); // if you don't open it explicitly, readCurrentFile will fail with UNZ_PARAMERROR
spilcdWriteString(&lcd, 0, 224, " ", 0xff1f, 0, FONT_12x16, DRAW_TO_LCD); // erase old name
spilcdWriteString(&lcd, 0, 224, szName, 0xff1f, 0, FONT_12x16, DRAW_TO_LCD); // display current file name at the bottom
rc = zip.readCurrentFile(ucBitmap, fi.uncompressed_size); // we know the uncompressed size of these BMP images
if (rc != fi.uncompressed_size) {
Serial.print("Read error, rc=");
Serial.println(rc, DEC);
}
spilcdDrawBMP(&lcd, ucBitmap, x, y, 1, -1, DRAW_TO_LCD); // Display the BMP file stretched 2X starting at (x,y)
x += 64; // Draw them across the display from left to right
if (x >= 256) { // move down for the next row
x = 0;
y += 64;
}
free(ucBitmap); // finished with this bitmap
}
delay(1000); // Allow time to see it happen, otherwise it will zip by too quickly
}
rc = zip.gotoNextFile();
}
zip.closeZIP();
}
// while (1) {};
}

Serial give : Global comment: 32x32 icon collection in Windows BMP format

from bb_spi_lcd.

bitbank2 avatar bitbank2 commented on September 12, 2024

What other library are you testing with? Can you show that demo code? Can you share a photo of your display and setuup?

Start simpler - get rid of everything except the display initialization. Clear it to a specific color and draw some text.

from bb_spi_lcd.

Skywalkerf34 avatar Skywalkerf34 commented on September 12, 2024

Hello Larry,

I finally succed to run your sketch on ILI9341 giving all the pin like this

//
// ZIP library example sketch
//
// Written by Larry Bank
// June 9, 2021
//
// This example shows how to do the following:
// - Step through all of the files in a ZIP archive
// - Display the name of each file
// - Allocate a buffer for the uncompressed file size
// - Read (decompress) the data into the buffer
// - Display the results (in this case a BMP file) on the SPI LCD
//
#include <unzipLIB.h>
#include <bb_spi_lcd.h>
// Set these to the appropriate values for your SPI LCD display
// -1 means the pin is not connected
// The CLK and MOSI pins might be -1 for your board if it has a default SPI setup
#define TFT_CS 4
#define TFT_RST 26
#define TFT_DC 25
#define TFT_CLK 18
#define TFT_MOSI 23
#define TFT_MISO 19
#define TFT_BL 13

// Use a zip file in memory for this test
#include "bmp_icons.h"
UNZIP zip; // Statically allocate the 41K UNZIP class/structure
SPILCD lcd; // my display library

void setup() {
Serial.begin(115200);
delay(1000); // give Serial a little time to start
spilcdInit(&lcd, LCD_ILI9341, FLAGS_NONE, 40000000, TFT_CS, TFT_DC, TFT_RST, TFT_BL, TFT_MISO, TFT_MOSI, TFT_CLK);
spilcdSetOrientation(&lcd, LCD_ORIENTATION_270); // for the ILI9341 it's nice to use it in 320x240 orientation
}

void loop() {
int rc, x, y;
char szComment[256], szName[256];
unz_file_info fi;
uint8_t *ucBitmap; // temp storage for each icon bitmap

spilcdFill(&lcd, 0, DRAW_TO_LCD); // Erase the display to black
spilcdWriteString(&lcd, 0, 0, (char *)"Unzip BMP Files Test", 0xffff, 0, FONT_12x16, DRAW_TO_LCD); // white text on a black background
x = 0; y = 24; // starting point to draw bitmaps
rc = zip.openZIP((uint8_t *)bmp_icons, sizeof(bmp_icons));
if (rc == UNZ_OK) {
rc = zip.getGlobalComment(szComment, sizeof(szComment));
Serial.print("Global comment: ");
Serial.println(szComment);
zip.gotoFirstFile();
rc = UNZ_OK;
while (rc == UNZ_OK) { // Display all files contained in the archive
rc = zip.getFileInfo(&fi, szName, sizeof(szName), NULL, 0, szComment, sizeof(szComment));
if (rc == UNZ_OK) {
ucBitmap = (uint8_t *)malloc(fi.uncompressed_size); // allocate enough to hold the bitmap
if (ucBitmap != NULL) { // malloc succeeded (it should, these bitmaps are only 2K bytes each)
zip.openCurrentFile(); // if you don't open it explicitly, readCurrentFile will fail with UNZ_PARAMERROR
spilcdWriteString(&lcd, 0, 224, " ", 0xff1f, 0, FONT_12x16, DRAW_TO_LCD); // erase old name
spilcdWriteString(&lcd, 0, 224, szName, 0xff1f, 0, FONT_12x16, DRAW_TO_LCD); // display current file name at the bottom
rc = zip.readCurrentFile(ucBitmap, fi.uncompressed_size); // we know the uncompressed size of these BMP images
if (rc != fi.uncompressed_size) {
Serial.print("Read error, rc=");
Serial.println(rc, DEC);
}
spilcdDrawBMP(&lcd, ucBitmap, x, y, 1, -1, DRAW_TO_LCD); // Display the BMP file stretched 2X starting at (x,y)
x += 64; // Draw them across the display from left to right
if (x >= 256) { // move down for the next row
x = 0;
y += 64;
}
free(ucBitmap); // finished with this bitmap
}
delay(1000); // Allow time to see it happen, otherwise it will zip by too quickly
}
rc = zip.gotoNextFile();
}
zip.closeZIP();
}
// while (1) {};
}

BUT if I change to ILI9488

spilcdInit(&lcd, LCD_ILI9488, FLAGS_NONE, 40000000, TFT_CS, TFT_DC, TFT_RST, TFT_BL, TFT_MISO, TFT_MOSI, TFT_CLK);

it just start illuminate background but didn't display anything

from bb_spi_lcd.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.