Sunday, December 30, 2018

0.96" I2C 128X64 Blue OLED Display Module

I ordered a 0.96" I2C 128X64 Blue OLED Display Module from eBay for $2.85 (shipping included).   It claims: voltage 3-5V,  power consumption of full lit screen 80mW, SSD1306 driver IC, compatible with Arduino.  When it arrived about three weeks later, the circuit on the back looked a little different from the product pictures on eBay.

Notably there is no regulator IC that would generate 3.3V from 5V.   It also lacks the level shifters  that are on the similar product by adafruit.   I'm a little skeptical that it can run on 5V..  So we'll start with 3.3V supply.  The two I2C signals are pulled up with 10K resistors.

We will test it using esp32-pico-kit with Arduino on Linux.  The CP210x UART Bridge is mapped to /dev/ttyUSB0.  Adafruit SSD1306 library (along with GFX library) claims to be compatible with ESP32.  We will try the example sketch ssd1306_128x64_i2c.   We need to know the default I2C pins.  It took a while to poke around the ESP32 code to find the pin definition: SDA=21 and SCL=22.   We compile and upload the code.  We open the serial monitor (9600 baud) and see some output, but there is nothing on the display.

We'll try a different library, "ESP8266 and ESP32 Oled Driver for SSD1306 display".  After modifying the I2C pins, the example SSD1306SimpleDemo works nicely.  The current for the module is 4 - 12mA as the program runs through different screen drawings.


Sketch uses 166885 bytes (12%) of program storage space. Maximum is 1310720 bytes.
Global variables use 11444 bytes (3%) of dynamic memory, leaving 283468 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.1
Connecting........__
Chip is unknown ESP32 (revision 1)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 7540.8 kbit/s)...
Hash of data verified.
Compressed 14128 bytes to 9213...

Writing at 0x00001000... (100 %)
Wrote 14128 bytes (9213 compressed) at 0x00001000 in 0.1 seconds (effective 818.5 kbit/s)...
Hash of data verified.
Compressed 168032 bytes to 92899...

Writing at 0x00010000... (16 %)
Writing at 0x00014000... (33 %)
Writing at 0x00018000... (50 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (83 %)
Writing at 0x00024000... (100 %)
Wrote 168032 bytes (92899 compressed) at 0x00010000 in 1.6 seconds (effective 861.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 122...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (122 compressed) at 0x00008000 in 0.0 seconds (effective 4691.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...
ets Jun  8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0




Tuesday, December 4, 2018

LCR-T4 Transistor Tester Display Upgrade

I ended up with a  transistor tester lcr t4 with a damaged LCD display.  We'll try to replace the display with a 1.8" 128x160 TFT color LCD (which can be purchased for about $4).  We used a version of the display previously.  This version has a different (better) pinouts that separates out the SD card connections.  The display uses ST7735S controller chip that is supported by the tester software.

The first issue is the supply voltage.  The tester uses 5V and the display uses 3V.  The display has a regulator to generate 3V from 5V, but the I/Os have to be compatible.  There is no evidence that the input signals to the display are 5V tolerant.  So we'll insert 1-2K resistors in series to limit the current to about 1mA.  Then these is the issue of the backlight.  The display has the cathode grounded, incompatible with the tester connections.  The backlight LED has a forward voltage about 3V@20mA; the tester circuit seems to operate at about 5mA (2.6V).  We'll drive it with a 330-Ohm current limiting resistor from 5V.  The tester is turned on with a push of a button, but kept on with the current through the backlight LED.  So we'll insert a 4.7K resistor at the original LED connection, which would provide about 1mA base current.

We traced the tester's LCD pads,
  • SCK - PD2
  • SDA - PD3
  • A0 - PD1
  • RESET - PD0
  • CS - GND
1.8" TFT 128x160 LCD Module
LCR-T4 with 1.8" LCD
We updated the firmware.  The Flash is very close to full.  It might be hard to add any new features.
AVR Memory Usage
----------------
Device: atmega328p
Program:   32060 bytes (97.8% Full)
(.text + .data + .bootloader)
Data:        202 bytes (9.9% Full)
(.data + .bss + .noinit)
EEPROM:      882 bytes (86.1% Full)
(.eeprom)
When operating, the tester draws about 23mA.  It works to about 7V.