Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Adafruit 1.8" TFT Shield V2 to STM32CubeL0 #1

Open
firmwareguru opened this issue Jan 12, 2021 · 1 comment
Open

Add support for Adafruit 1.8" TFT Shield V2 to STM32CubeL0 #1

firmwareguru opened this issue Jan 12, 2021 · 1 comment

Comments

@firmwareguru
Copy link

firmwareguru commented Jan 12, 2021

Support for the newer Adafruit 1.8" TFT Shield V2 is now available for the STM32CubeL0 firmware system in this branch. The examples previously only supported the older V1 board which is no longer available (plus the SD card driver was broken - see STMicroelectronics#13). The V2 board adds an I2C expander to access the joystick, buttons and LCD backlight and reset IO. The expander is called the seesaw and the driver has been ported from here into a separate component under Drivers\BSP\Components.

This shield is a useful addition to the Nucleo ecosystem for building prototypes where user interaction would be helpful.

Adafruit_shield_nucleo_fm_logo

Quickstart

Setup

Solder the Arduino shield headers as shown in the shield user guide. Don't solder the 6-pin dual-row header.

The Shield has a 6-pin dual-row header beside the SD card slot that requires 3 wires to be run to the appropriate digital I/O pins to route SPI from the Nucleo to the display and SD card. Connect them to the free holes marked D11,D12,D13 at the top as follows, looking down at the 6-pin dual-row header with the shield oriented with SD card slot to the right:

Func Pin Pin Func
MISO D12 N/C
SCK D13 D11 MOSI
N/C N/C

A FAT(32) formatted SD-card hosting 128w x 160h RGB565 BMP images is required. These images can be copied from Utilities\Media\Pictures\BMP_128x160. It is more difficult to create your own as most available tools generate C-arrays of raw RBG565 image data. However, this online tool is able to convert png or jpg to bmp files of the correct 16-bit RGB565 format. The image file names must be 11-character maximum and sit in the root directory.

Lastly, attach the shield to a NUCLEO-L073RZ.

Project

An STM32CubeIDE project has been created for NUCLEO-L073RZ\Demonstrations\Adafruit_LCD_1_8_SD_Joystick. Import this project into your STM32CubeIDE workspace, build and debug it. The display will show a menu requiring use of the joystick to select the picture mode.

Integrating into another project

  1. Add USE_ADAFRUIT_SHIELD_V2 to the IDE preprocessor defines.
  2. Add BSP/Components/adafruit_seesaw/adafruit_seesaw.c to the project.
  3. Ensure HAL_I2C_MODULE_ENABLED is set in stm32l0xx_hal_conf.h and that stm32l0xx_hal_i2c.c is part of the build.
@ku100-png
Copy link

ku100-png commented Apr 10, 2024

Thanks for this material. I also add support for Adafruit 1.8" TFT Shield V2 to NUCLEO-H745-ZI. But I also add support for buttons A,B,C on Adafruit 1.8" TFT Shield V2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants