Fat fingers?

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Next time I see three 128x64 OLED (I2C driven) on Amazon for just £7 I should probably get a better idea of exactly what 0.96" will really mean! 

 

I know I have fat fingers but they are not THAT big. It's just the display is minute (but also kind of cute!) 

 

 

My test picture is Amelia (as always). I found an easy to use lcd-image-converter on SourceForge 

Last Edited: Mon. Apr 4, 2022 - 09:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow,

 

So nice when it all works!

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I made the same mistake some time ago and ordered based on the 128x64 and when I got them...well let's just say it's not what I expected.

Happy Trails,

Mike

JaxCoder.com => PartsBin - An Electronics Component Organizer

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was going to put a post with that LCD yesterday.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The 0.96 inch measurement is done diagonally which tricks us into thinking the size is big but in reality its small.

“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” - Brian W. Kernighan
“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint-Exupery

Last Edited: Mon. Apr 4, 2022 - 10:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff,

 

1.3 inch displays are much more readable.  SSD1315 or SH1106

SSD1309 comes in 1.5 inch as well as the bigger sizes like 2.7 inch 2.42 inch.

 

There are minor differences for SSD1315 and SSD1309 compared to SSD1306 regarding scrolling.

SH1106 does not support any scrolling.

 

However all three controllers will do regular text and graphics.   i.e. most applications.

 

David.

 

 

 

Last Edited: Tue. Apr 5, 2022 - 06:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A good search term for usable sized OLED displays is "2.42 inch" such as these: https://www.ebay.co.uk/itm/23323...

 

Lovely displays, but they ain't cheap! They cost more than the rest of the project put together, including pcb, processor, and bluetooth module.

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yup, I already had touch 2.8" LCD (SPI with ILI9341) that works nicely but I was looking for the "punch" of OLED. I see the 1.3" options but rather than £7 for 3 (£2.33 each) you are already looking at £7+ for one with just that small step up from 0.96 to 1.3.

 

Admittedly this is just looking at Amazon for fast delivery of (expensive!) protoytping parts. I guess I should be looking at AliExpress, Banngood, AliBaba to see the "real" price of such displays.

 

EDIT: Wow those 2.42" ones are up at the £25 mark! surprise (though a more acceptable £9.50 on Aliexpress)

Last Edited: Tue. Apr 5, 2022 - 08:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I bought twenty of them last time round and i think I got a discount on the advertised seventeen euros.

 

But if you recall my building a widget video I posted recently, you will understand why the display goes on last!

 

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I bought an I2C display like that, just arrived, but I don't have software to test it. Is the software used in the OP open source? If so where can I find it?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
Is the software used in the OP open source? If so where can I find it?

There is this one I used in the past.

 

https://github.com/efthymios-ks/AVR-SSD1306

 

On arduino platform the following one is popular.

 

https://github.com/adafruit/Adafruit_SSD1306

 

“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” - Brian W. Kernighan
“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint-Exupery

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
you are already looking at £7+ for one with just that small step up from 0.96 to 1.3.

and that only increases the screen size but the resolution stays the same. 128x64

“Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” - Brian W. Kernighan
“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint-Exupery

Last Edited: Tue. Apr 5, 2022 - 01:02 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
SH1106 does not support any scrolling.
SH1107 has vertical scrolling.

 

SH1107 (datasheet)

Sino Wealth | OLED-Info

all due to a search on OLED at gallery · olikraus/u8g2 Wiki · GitHub

 


Search results for: 'sh1107' (Seeed Technology)

Raspberry Pi Pico OLED module is out of stocksad

Raspberry Pi is now a microcontroller | AVR Freaks

 

Graphical u8glib editor using library primitives | AVR Freaks

u8g2setupcpp · olikraus/u8g2 Wiki · GitHub

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

 

 

El Tangas wrote:
I bought an I2C display like that, just arrived, but I don't have software to test it. Is the software used in the OP open source? If so where can I find it?
Well I just started (as every video on YouTube talking about these SSD1306 I2C displays does) with using

 

 

which derives from:

 

 

If you try to install the first you see:

 

 

so let it "Install all" here.

 

When those are installed the Adafruit example for ssd1306_128x64_i2c is the thing that will drive one of these displays..

 

 

https://github.com/adafruit/Adaf...

 

In reality I actually started with Arduino's "i2c_scanner" which confirmed, as videos suggested, that the I2C was 0x3C not 0x3D:

 

 

But then I just cut out most of the example stuff in my own copy of the sketch and also went to:

 

https://sourceforge.net/projects...

 

and got that utility which can down-sample multicolor JPG/PNG to diffused mono pixel images and then generates a C array of the data.

 

 

I put that into the example code just to get my picture of Amelia shown. 

 

I haven't pushed anything into Github yet as I'm just "playing" but I can get my other laptop and post what I have here if it helps...?

 

 

 

Last Edited: Tue. Apr 5, 2022 - 01:39 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Thamks clawson and Heisen yes

 

 

edit:

clawson wrote:
I haven't pushed anything into Github yet as I'm just "playing" but I can get my other laptop and post what I have here if it helps...?

 

It's fine, I'll surely manage with your detailed explanation smiley

Last Edited: Tue. Apr 5, 2022 - 02:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's working. Time to leave that positive feedback to the seller yes

 

The mess of wires is because I'm using a level shifter, IDK if the data lines are 5V tolerant, so better not risk it.

I don't have a cute cat, so the freaks logo will have to do...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I didn't do anything about level conversion (one of the joys of knowing nothing about electronics!). All I did was power its Vcc from the 3.3V rail out of the Arduino but now you mention it I guess the SDA/SCL lines were presumably up at 5V. Seemed OK. It even worked without 4K7..10K pull ups on the I2C lines but I guess that was a "no-no" too? ;-)

 

Chief Bodger & Bottle Washer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah, better shift the data lines to 3.3V also or there might be damage. I'm not sure, I didn't read the datasheet of the display controller chip - I don't even know which chip it is.

About the pull ups I forgot them too and it worked so... Maybe the module has built in pull ups.

 

Edit: anyway, I don't have much experience with I2C either. Maybe forgetting the pull ups is actually good and the level shifter is not needed. If you don't connect a pull up to 5V, then there is no 5V overvoltage I suppose.

Last Edited: Tue. Apr 5, 2022 - 07:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've been watching videos on YouTube about these displays and almost no one seems to have bothered with pull ups. In fact I began to wonder if Uno already had them on the board seeing as no one was using them. But I pulled the schematic and it doesn't. Only in one video did someone make the point that the display might lock up sometimes if you poked SDA/SCL with a finger and there were no pull ups. 

 

By the way I notice a lot of people (cough, cough) haven't removed the protective plastic from the display when first using it. So they may not get the full impact of the display's brightness. (I actually also see this in a lot of synthesizer reviews I watch too - people use the new equipment without removing the film there either) 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
I notice a lot of people (cough, cough) haven't removed the protective plastic from the display when first using it.

 

Ooops cheeky

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your UNO will not have pull ups, unless you enable the internal port pull ups, but a lot of Arduino modules with I2C have them, look at your display.  

I would think the level convert would have them! 

 

jim

 

 

FF = PI > S.E.T

 

Last Edited: Tue. Apr 5, 2022 - 07:46 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just tested. My multimeter says my display module doesn't have pull ups. But Cliff's is not exactly the same...

 

edit: I found a suspicious mosfet in the display module, so I decided to test again, but with power applied to the module. Sure enough, now the multimeter reads 10k pull ups wink

They are enabled by the mosfet when power is applied.

 

edit2: In this case, it's ok to connect to the Arduino directly, because the pull ups pull to 3.3V, which is safe. This is also enough to be interpreted as HIGH on the 5V side therefore the level shifter is probably not needed.

In other words, the correct connection is as shown in the OP cheeky

Last Edited: Tue. Apr 5, 2022 - 08:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The part I suggested is SPI, not I2C - something I much prefer - and I rolled my own interface. This is for an STM ARM chip, using their HAL code to initialise the SPI interface.

 

There's a 1k buffer used to which I draw; this code takes that buffer and sends it to the display. There's also an array of characters making up the font which I can supply if people want.

 

/*
 * ssd1309.c
 *
 *  Created on: Dec 19, 2020
 *      Author: barnacle
 *      many hints taken from https://github.com/afiskon/stm32-ssd1306/tree/master/ssd1306
 */

#include "ssd1309.h"
#include <stdio.h>
#include <string.h>

extern SPI_HandleTypeDef hspi1;		// the previously defined handle for the oled spi

void ssd1309_init (void)
{
	// initialise the display for further use
	ssd1309_CS_HI						// deselect oled
	ssd1309_RES_LO						// reset
	HAL_Delay (10);						// hold
	ssd1309_RES_HI
	HAL_Delay (100);					// wait for screen to boot

	ssd1309_write_command (0xae);		// display off

    ssd1309_write_command (0x20); 		// Set Memory Addressing Mode
    ssd1309_write_command (0x02); 		// 00b,Horizontal Addressing Mode; 01b,Vertical Addressing Mode;
                                		// 10b,Page Addressing Mode (RESET); 11b,Invalid

    ssd1309_write_command (0xB0); 		// Set Page Start Address for Page Addressing Mode,0-7

    ssd1309_write_command (0xC8); 		// Set COM Output Scan Direction

    //ssd1309_write_command (0x2e);		// disable horizontal scroll

    ssd1309_write_command (0xa0);

    ssd1309_write_command (0x02); 		// ---set low column address
    ssd1309_write_command (0x10); 		// ---set high column address (low nibbles so 0x00)

	ssd1309_write_command (0x40); 		// --set start line address - CHECK

    ssd1309_write_command (0x81);
    ssd1309_write_command (0xff);		// contrast max

    ssd1309_write_command (0xA1); 		//--set segment re-map 0 to 127 - CHECK

    ssd1309_write_command (0xA6); 		//--set normal color

    ssd1309_write_command (0xA8); 		//--set multiplex ratio(1 to 64) - CHECK
    ssd1309_write_command (0x3F); 		//

    ssd1309_write_command (0xA4); 		// 0xa4,Output follows RAM content;0xa5,Output ignores RAM content

    ssd1309_write_command (0xD3); 		// -set display offset - CHECK
    ssd1309_write_command (0x00); 		// -not offset

    ssd1309_write_command (0xD5); 		// --set display clock divide ratio/oscillator frequency
    ssd1309_write_command (0xF0); 		// --set divide ratio

    ssd1309_write_command (0xD9); 		// --set pre-charge period
    ssd1309_write_command (0x22); 		//

    ssd1309_write_command (0xDA); 		// --set com pins hardware configuration - CHECK
    ssd1309_write_command (0x12);

    ssd1309_write_command (0xDB); 		// --set vcomh
	ssd1309_write_command (0x20); 		// 0x20,0.77xVcc

    ssd1309_write_command (0x8D); 		// --set DC-DC enable
    ssd1309_write_command (0x14); 		//

    ssd1309_write_command (0xaf);		// and turn display on
}

void ssd1309_write_command (uint8_t command)
{
	// send a single byte to the command register
	ssd1309_CS_LO
	ssd1309_DC_COMM
	HAL_SPI_Transmit (&hspi1, &command, 1, 100);
	ssd1309_CS_HI
}

void ssd1309_write_data (uint8_t * data, uint8_t count)
{
	ssd1309_CS_LO
	ssd1309_DC_DATA
	HAL_SPI_Transmit (&hspi1, data, count, 100);
	ssd1309_CS_HI
}

void ssd1309_write_page (uint8_t * video)
{
	// dump the video ram to the display in one hit
	// assumes page mode
	// for reasons best known to the designer, the pixels appear to be in order
	// 64-128, 0-63 so we draw each line in two chunks
	for (uint8_t y = 0; y < 8; y++)
	{
		ssd1309_write_command (0xb0 + y);
		ssd1309_write_command (0x00);
		ssd1309_write_command (0x10);
		ssd1309_write_data (&video[(y * 128)], 128);
	}
}

void ssd1309_image_to_video (uint8_t * image, uint8_t * video)
{
	// we receive a pointer to the first byte of the image data
	// images are 120 vertical slices of 32 pixels each.
	// It's a long story... but I'm not changing them now.

	for (int q=0; q<120; q++)
	{
		// odd offset to centre the image horizontally and vertically
		video [648 + q] = image[0 + (q * 4)];
		video [520 + q] = image[1 + (q * 4)];
		video [392 + q] = image[2 + (q * 4)];
		video [264 + q] = image[3 + (q * 4)];
	}
}

void ssd1309_cls (uint8_t * video)
{
	// clears the video space but does *not* update the display
	for (int q = 0; q < 1024; q++)
	{
		video[q] = 0;
	}
}

void ssd1309_print_char (uint8_t * video, uint8_t ch, int * col, int * row)
{
	// print the specified char at row and column in the video ram, updating col but not row
	// row is 0-3 from the top downwards using pages 0-1, 2-3, 4-5, and 6-7 of the video
	// does not update the screen directly, just the display buffer 'video'

	extern uint8_t fonts[960];
	int font_ptr;
	int video_ptr;

	if (*col > 20)
	{
		return;		// trying to write past the end of the memory
	}

	// find the offset for the character
	font_ptr = (ch - 0x20) * 10;				// ten font bytes per character
	video_ptr = (*row * 256) + (*col * 6);
	for (int q = 0; q < 5; q++)
	{
		video[video_ptr + q] = fonts[font_ptr + (q * 2) + 1];
	}
	video[video_ptr + 5] = 0;					// top row done

	video_ptr += 128;							// one line down and six slots left
	for (int q = 0; q < 5; q ++)
	{
		video[video_ptr + q] = fonts[font_ptr + (q * 2)];
	}
	video[video_ptr + 5] = 0;					// bottom row done

	(*col)++;
}

void ssd1309_print_str (uint8_t * video, const char * str, int * col, int * row)
{
	// print a zero terminated string to the screen
	const char * ptr = str;
	while (*ptr != '\0')
	{
		ssd1309_print_char (video, *ptr, col, row);
		ptr++;
	}
}

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

www.tokopedia.com/madagang .Buy and Donated cheap electronics and manuscripts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks but I don't intend to use Python.