Using a OLED Display: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
No edit summary
Line 24: Line 24:
In addition a STM32 module with a F103T8, F103C8, or F103CB micro-controller is required. This can be anything available which provides access to the UART1, I2C pins, and the programming pins (BOOT0, or SWDCLK, SWDIO). Many development boards exist at low cost; they are however relatively bulky. Also the CC3D atom can be used, which is potentially the smallest commercially available option. The NT Logger hardware or NT breakout module could be used, and of course any home-made solution. Lastly, also the NT Display v1.3 print board is available, which is specifically designed for the purpose (https://github.com/olliw42/storm32bgc/tree/master/storm32-nt/storm32-nt-display-v13).
In addition a STM32 module with a F103T8, F103C8, or F103CB micro-controller is required. This can be anything available which provides access to the UART1, I2C pins, and the programming pins (BOOT0, or SWDCLK, SWDIO). Many development boards exist at low cost; they are however relatively bulky. Also the CC3D atom can be used, which is potentially the smallest commercially available option. The NT Logger hardware or NT breakout module could be used, and of course any home-made solution. Lastly, also the NT Display v1.3 print board is available, which is specifically designed for the purpose (https://github.com/olliw42/storm32bgc/tree/master/storm32-nt/storm32-nt-display-v13).


:[[File:Oled-display-module-v13.jpg|680px]]


Finally the hardware for flashing the STM32 micro-controller is required, usually a USB-TTL adapter or a ST-Link, depending on the STM32 module. This article [[How_to_flash_NT_Modules#First-Time_Flashing|How to flash NT Modules: First-Time Flashing]] provides information.
Finally the hardware for flashing the STM32 micro-controller is required, usually a USB-TTL adapter or a ST-Link, depending on the STM32 module. This article [[How_to_flash_NT_Modules#First-Time_Flashing|How to flash NT Modules: First-Time Flashing]] provides information.
:[[File:Storm32 oled.jpg|240px]]


== Firmware ==
== Firmware ==

Revision as of 18:53, 1 June 2018

The information on this page refers to firmware v2.31e and higher.

Since firmware version v2.31e, the STorM32 supports OLED displays. It allows to graphically present various information, such as the battery voltage and charge level, the gimbal status, and the currently selected pan mode.

Unfortunately, the OLED display cannot be directly connected to the STorM32 main board. This is so because otherwise only v3.x boards could have been supported, but not the abundant v1.x boards. Also, the firmware is close to exhausting the RAM on the F103RC micro-controller, and supporting the OLED display directly would have compromised future features. Thus, the STorM32's OLED support involves a bridge module, which is connected in between the STorM32 and the OLED display. On the positive side, this approach potentially allows users to customize the displayed information to their specific needs.

Currently, firmware is provided only for bridge modules which use a STM32 F103T8, F103C8, or F103CB chip. This covers many of the available STM32 development boards, as well as the CC3D atom.

Call for contribution: A 32-bit micro-controller is not required; 8-bit controllers such as the ATmega should also do it. That is, it would be possible to create a OLED bridge module using Arduino compatible hardware, and Arduino for programming. The firmware author has no intent to do that himself, but would strongly support any effort in this direction. If, e.g., someone would identify suitable hardware and establish a basic framework Arduino code, which implements an UART at 115200 baud and the OLED drivers (e.g. using the [AdafruitGFX] library), then the firmware author would be happy to add the communication code to make it functional.

Hardware

Things to have at minimum:

  • 128x64 OLED display with SSD1306 controller and I2C
  • STM32 module with F103T8, F103C8, or F103CB micro-controller, e.g. a NT Display v1.3 pcb
  • something to flash the micro-controller (USB-TTL adapter or ST-Link)

The OLED display is available for few bucks at many places. However, a large variety exist, with different display controllers (SSD1306, SH1106, ...), different sizes (0.96´´, 1.3´´, ...), different resolution (128x64, 128x32,...), and different pins (I2C, SPI, I2C&SPI, ...). It is important to get a suitable OLED module; the specs are given in the list.

In addition a STM32 module with a F103T8, F103C8, or F103CB micro-controller is required. This can be anything available which provides access to the UART1, I2C pins, and the programming pins (BOOT0, or SWDCLK, SWDIO). Many development boards exist at low cost; they are however relatively bulky. Also the CC3D atom can be used, which is potentially the smallest commercially available option. The NT Logger hardware or NT breakout module could be used, and of course any home-made solution. Lastly, also the NT Display v1.3 print board is available, which is specifically designed for the purpose (https://github.com/olliw42/storm32bgc/tree/master/storm32-nt/storm32-nt-display-v13).

Oled-display-module-v13.jpg

Finally the hardware for flashing the STM32 micro-controller is required, usually a USB-TTL adapter or a ST-Link, depending on the STM32 module. This article How to flash NT Modules: First-Time Flashing provides information.

Firmware

The firmware is located in the o323BgcExtraFirmwareFiles subdirectory in the main folder. It can be accessed and flashed using the GUI.

Setup

The connections are as follows:

Oled-scheme.jpg


The I2C pins SCL, SDA of the OLED display need to be connected to either the I2C1 or I2C2 pins of STM32 micro-controller (the firmware auto-detects which I2C unit is being used). On the CC3D atom these can be accessed:

  • I2C1 (SCL = PB6, SDA = PB7): pin S1out goes to SCL, and pin S3out goes to SDA
  • I2C2 (SCL = PB10, SDA = PB11): they are found on the Flexi port, pin 3 = Tx goes to SCL, and pin 4 = Rx goes to SDA

On the other side the Rx pin of UART1 needs to be connected to the RC1 pin of the RC port on the STorM32 controller. On the CC3D atom the UART1-Rx pin can be accessed:

  • UART1-Rx (Rx = PA10): it is found on the Main port, pin 4 = Rx goes to RC1

The powering of the OLED is relatively uncritical, it can be powered by both a 3.3 V or a 5 V source. It draws ca. 20 mA. The 3.3 V pin on the v1.31 STorM32 board might be too weak, the 3.3 V on the v1.3 STorM32 board should be fine (depending on what else is connected of course).

Finally, the OLED display support needs to be enabled in the GUI by setting Uart1 Tx Configuration to “oled display”.

Storm32-wiki-oled-gui-configuration-1.jpg