SPI/I2C OLED display


#201

Hi, i'm back form a short vacation

The 0x78/0x7a are actually the same addresses as 0x3c/0x3d (there is an implicit 0 low bit 0x78 <-> 0x3c).


The OLED thread is low priority compared to audio (flickers on the OLED are OK, clicks on the audio are not OK).
In my experience two OLEDs work well. But when a patch is heavy on the CPU, it will start to flicker: my code is aimed to scopes and tries to have a permanent refresh.


I did not experimented with these multiplexers yet. They would need some more coding.
If the goal is to display parameters, the refresh could be "on demand"... that would be a new - and optimized for that purpose - design.

But I think that the best solution for more advanced designs is to use an arduino due or a teensy so that you can use the extensive set of drivers and color displays and communicate with the axoloti by midi or uart.


#202

Hi all, thanks for sharing all the knowledge on oled wiring and coding.
I'm trying to wire up my first oled and am coming across some strange results and would be grateful to hear if someone has tips on how to debug the issue.

My setup

  • an adafruit Monochrome 1.3" 128x64 OLED graphic display with the sj1 and sj2 bridges soldered to toggle ic2 mode
  • wiring:
    • pb8 -> Clk (scl)
    • pb9 -> Data (sda)
    • VDD -> Vin
    • GND -> GND
  • Loading tiar / hw / bar (or any of tiar's oled patches) and tried all ic2 addresses and types

I get unmoving salt and pepper on my screen

I'm not using any resistors in the setup because I read that the adafruit oled has them internally.

Any ideas?


#203

Did you set your display to I2C mode (as opposed to SPI mode) ?

as described here:


#204

yes, I soldered the two jumpers closed to convert from spi to ic2


#205

I did not used this specific OLED display.

Maybe somebody else has used this one.

I had to deal with a reset pin on another OLED display. Maybe you have the same kind of issue ?


#206

I had the same problem as @philomates using sane adafruit oleds in I2C mode. My oleds worked for a while and then started showing those unmoving salt and peperi static. at first i was able to restart the oleds and axo to get rid of the problems but later the static came back and never went away. That was a year ago and since then i gave up using the oled object with axo and instead i used an arduino to drive them. I am also interested to know if anybody was able to solve this issue. Maybe it's because of that specific type of OLED.


#207

@philomates @Sharco
Unlike these cheap chinese OLED modules, the one from Adafruit doesn't reset itself on startup automatically.

The "Rst" pin must be set "low" for a short period after power on, you can achieve this with a capacitor from "Rst" to "Gnd" (e.g. ~1uF [+ to "Rst"]) and a resistor from "Rst" to "Vin" (e.g. ~100k) or in software with an additional wire, i haven't looked into it and i don't own an Axoloti, just wanted to help because i had problems with a few Adafruit OLEDs in the past. ^^

Edit: @SmashedTransistors also mentioned the use of an RC circuit like this in his last post.


Help advise a total and complete beginner on how to build my enclosure!
#208

Thank you @time-lord and @SmashedTransistors. This solved my issue! :+1:


#209

That's good news :smiley:


#210

beautiful, this also helped me get it working! Thanks so much for the tip!

now I'm playing around with the code to draw binary format numbers :slight_smile:


#211

Hi all.

I was looking through the HW objects and there are two that I'm not sure what they do:
tiar/HW/scopeForOLED
and
tiar/HW/scopeOLED_4

How do these work? What do they do?


#212

Hi @Ke10g,

For a comprehensive example of OLED you can have a look at menu bar Help->Library->community->tiar->HW->OLED128x64nice.axh

  • The gpio/i2c/config is mandatory and should be put in the top left corner, it initializes the I2C.
  • The OLED128x64nice does the main job by taking information from a scope object. This scope object can be a standard library scope.

tiar/HW/scopeForOLED is a simplified model of my tiar/disp/scope that does not send the waveform on the host computer.

I have added tiar/HW/scopeOLED_4 a few weeks ago. I designed it specifically for OLED displays.

  • the time scale is /4 downsampled, (in most cases it allows to see the whole waveform)
  • there is an automatic vertical rescaling (x2 x4 x8)
  • the vertical rescaling is indicated as an output text ("x2" "x4" "x8")
  • the pitch input controls an internal synch oscillator

You can test it with example
menu bar Help->Library->community->tiar->HW->scopeOLED_4.axh


#213

Thanks a lot @SmashedTransistors for all your Oled objects, i have been playing with it this pas month.
I just added a 128x32 display to second my 128x64 display.
I understand your double Oled object is made for two 128x64 displays so I thought I would just add a second Oled object (OLED128x32_2lines). It seems to work but this object does not want to draw bars from your bar object.

Going through this thread i noticed @lokki managed to draw bars on a 128x32 display.

Would you guys care to explain how I could make it work?

thanks!


#214

Hi @Paulus,

I did not experimented with 128x32 OLEDs at all.
I hope @lokki will help you as he modified the OLED objects.


#215

@Paulus
oled.axo (15.5 KB)
save that file and rename to oled.zip and unpack. put it into your axo objects folder (in a folder named HW for example)

i am not sure in what state the objects are, i have not used them in a very long time and i have no axoloti with OLED here to test.


#216

Awesome! Thanks a lot, that will get me started, I'll try to study the code so I can maybe personalize it!


#217

coming back to this, i have OLEDs controlled by extra teensys in my synth build now, and still one ssd1306 on an axoloti. do you have any idea how i could go about getting the scope waveforms over to the teensy? i assume sending the scope graphic data/array (didn't look at the scope objects ever) through i2c would be fast enough since thats how you drive the OLEDs, but that would mean i have to write my own protocol on both axo and teensy side right?


#218

As you suspect, the OLED takes its information directly from the scope objects. It is the data you want to transmit to the offboard device. It is a simple table of 128 signed bytes.

 int8_t t[128];

#219

yeaeh thanks i read into it a bunch by now. that should do the trick!

one more question on controlling the OLEDs from axolloti directly, i looked at your OLEDnice objects and the rendering methods, would love to try work on this but as soon as i embed it fails to compile afterwards. not with one of the usual errors becausee of includes but rather just halts at "chaning directory"...

is there any chance you could make one more OLED object that has a objref attribute like the scope one, but instead needs to be pointed to a 8kbit table that represents a 128x64 display buffer? that would give me (and others) the option to try an write some more graphics stuff without going all too low level.


#220

I think that it will work if your "scope" object has an int8_t t[128];