Another AXE133Y OLED question - brightness control

edit: I meant AXE133Y but I can't change the subject line /edit

Does anyone know of a way to dim the display (not completely off, just dim). At night, on a bedside table the OLED display is very B-R-I-G-H-T!!

I was rather hoping to strobe the display at say 20-30hz with a short on duty time but I can't see any way to do this in the datasheet for the display.

Any suggestions considered (apart from a piece of dark glass) :)

Thanks,
Adrian
 

mrburnette

Senior Member
edit: I meant AXE133Y but I can't change the subject line /edit

Does anyone know of a way to dim the display (not completely off, just dim). At night, on a bedside table the OLED display is very B-R-I-G-H-T!!

I was rather hoping to strobe the display at say 20-30hz with a short on duty time but I can't see any way to do this in the datasheet for the display.

Any suggestions considered (apart from a piece of dark glass) :)

Thanks,
Adrian
254,1 Clear Display (must be followed by a ‘pause 30’ command)
254,8 Hide Display
254,12 Restore Display

254,14 Turn on Cursor
254,16 Move Cursor Left
254,20 Move Cursor Right
254,128 Move to line 1, position 1
254, y Move to line 1, position x (where y = 128 + x)
254,192 Move to line 2, position 1
254, y Move to line 2, position x (where y = 192 + x)
I suspect Hide/Restore is a kind of poorman's strobe capability...
 

KeithRB

Senior Member
You might try adjusting the 5 V supply a bit and see what that does. My search-foo wasn't too good, but someone posted a link to the Winstar data sheet for the module which may have a method.
 
Thanks mrburnette. I suspect that since this is a serial interface it will all be too slow for 20 hides and 20 restores per second, but I will give it a whirl!
 
@KeithRB: ahh. I rather wanted to do it under program control. You know, bright in the day and dim at night... that sort of thing. Thanks anyway :)
 

KeithRB

Senior Member
Once you find the handle, you can get the computer to turn it. The OLED draws so little current, it should be pretty easy to adjust the power supply electronically.
 

nick12ab

Senior Member
The OLED has an inductor and other components on the back of it to produce the driving voltage for the OLED so you might be able to hack it so that the PICAXE supplies the pulses into it instead of the module.
 

srnet

Senior Member
I dont recall the OLED dimming much when the voltage is reduced, although there was a point at which the serial interface gave errors.

Mind you I was running the OLED at 38400 baud, so you might be able to write to it fast enough for all the hides and restores.
 

hippy

Ex-Staff (retired)
When I measured the current drawn for an OLED it seemed completely the same from 5V down to 3V3 so would guess it's got some sort of constant current generator within itself.

As the OLED display seems entirely multiplexed it would seem unlikely you could modulate its power without risking the controller resetting but could be worth a try.

Best option would seem to be display on and off commands at a fast rate and they'd be best added within the AXE133Y driver rather than sent over serial. Either that or a grey screen, or wear sunglasses in bed -- they'll probably go well with 'Cool Dude' pyjamas :)
 

Paix

Senior Member
Sense that it's dark and then just pulse the display occasionally and read the time directly from the latent image on your retinas :)
 

Technical

Technical Support
Staff member
There are a few spare inputs on the AXE133 board so it wouldn't take much effort to add a touch sensor (could even just be a bit of wire) to switch the OLED 'display on' and 'display off' manually by touch as with many bedside lamps etc.
 
@hippy, I think this sounds the most likely option (on/off from within the driver). Thank you!

...and how did you guess about the Cool Dude pyjamas!?!?!
 
There are a few spare inputs on the AXE133 board so it wouldn't take much effort to add a touch sensor (could even just be a bit of wire) to switch the OLED 'display on' and 'display off' manually by touch as with many bedside lamps etc.
I think this will have to be the fallback if hippy's solution doesn't work. :)
 

nick12ab

Senior Member
The module itself also has place(s) for surface mount potentiometers which just have resistors there instead - maybe a digital pot there could adjust the brightness.
 

hippy

Ex-Staff (retired)
I think this will have to be the fallback if hippy's solution doesn't work. :)
My idea sort of worked but not brilliantly. Add the following in the AXE133Y driver after putting up the welcome message -

Code:
Pause 20000
Low rs
Do
  pinsB = %00001100 : Pulsout enable, 1 : Pause 30 ' On
  pinsB = %00001000 : Pulsout enable, 1 : Pause 50 ' Off
Loop
After five seconds the display message dims, but not very well; the top row of pixels is brighter than the rest.

If the on pause is reduced then the display is only partly shown. If the off pause is increased the flicker becomes very noticeable.

I think the display refresh restarts when the display is turned on so it might be possible to tweak the timing so only one refresh is done before it's blanked again but you'd have to experiment.
 

g6ejd

Senior Member
This is an interesting problem, because PURE DAB radios use OLED display units and they look standard to units to me, but they are able to apply two levels of of display brightness from the setup menu, either normal or dim for night-time use. Now I'm wondering how they have done it. Perhaps they have intercepted the LED driver circuit. Clearly it's easy because most new TV's are OLED technology and brighness has to be changed for a TV image.
 

eclectic

Moderator
@Adrian

I've just been playing with the AXE133Y.

This is nowhere near perfect, but it does dim the display.

Code:
#picaxe 08m2
setfreq m16

serout 1, N2400_16,(254,1)
pause 1000

Main:
serout 1,N2400_16,(254,128,"Hello World,test")
serout 1,N2400_16,(254,192 ,"Hello World, 2")
pause 2000

for w0 = 1 to 100

serout 1, N2400_16,(254,8) ;blank display
pause 30 ; Play with values

serout 1, N2400_16,(254,12) ; enable display
pause 1

next

goto main
e
 

g6ejd

Senior Member
@eclectic, well done, some good experimentation.

I'm wondering if you could assign this routine to a second process that displays data and dims the display and then you communicate with the process through assigned and shared RAM addresses for e.g. Hrs, Min, Sec, Date, Day and dim values. That way you can leave the background process to display your data and your foreground process can do the time, date calcs, or whatever.
 

eclectic

Moderator
@eclectic, well done, some good experimentation.

I'm wondering if you could assign this routine to a second process that displays data and dims the display and then you communicate with the process through assigned and shared RAM addresses for e.g. Hrs, Min, Sec, Date, Day and dim values. That way you can leave the background process to display your data and your foreground process can do the time, date calcs, or whatever.
I shall leave those tasks to the
Grown-ups, the great and the good and G6EJD.

Goodnight. :)

e
 
This is an interesting problem, because PURE DAB radios use OLED display units and they look standard to units to me, but they are able to apply two levels of of display brightness from the setup menu, either normal or dim for night-time use.
My Pure DAb radio seems to have a similar 20 character OLED display that has several levels of brightness.
 
@eclectic
Thanks for doing the tests. I haven't had the opportunity to try the same for myself yet. Did you get the same effect as hippy with the first line of dots being brighter?
 

eclectic

Moderator
@eclectic
Thanks for doing the tests. I haven't had the opportunity to try the same for myself yet.
Did you get the same effect as hippy with the first line of dots being brighter?

No, the whole screen shifts between "normal" bright
then dimmer.

Have a play. If it's not right, well you haven't lost anything.

e
 

mrburnette

Senior Member
@Adrian

I've just been playing with the AXE133Y. This is nowhere near perfect, but it does dim the display.
<...>
e
Yep, kind of a poorman's strobe; on/off. Kind of what I was thinking in my post... since we are working with the AXE133Y and have the source, it would be nice to just implement this behavior in the 18M2... create a new instruction for dimming and pass a single BYTE value to represent the looping value that would control the on/off time: giving 254 values. As your testing found 100 to be a reasonable value, this is perfect for a 254 step capability... about midway.

Update: 18M2 source changes would require hardware background serial receive which is not supported via the M2 chips. Currently, the code is simply a tight loop with a blocking SERIN command.
 
Last edited:

eclectic

Moderator
Yep, kind of a poorman's strobe; on/off. Kind of what I was thinking in my post... since we are working with the AXE133Y and have the source, it would be nice to just implement this behavior in the 18M2... create a new instruction for dimming and pass a single BYTE value to represent the looping value that would control the on/off time: giving 254 values. As your testing found 100 to be a reasonable value, this is perfect for a 254 step capability... about midway.

- Ray

Thought: If we as a forum start to implement new functionality into the AXE133Y basic driver, maybe a forum thread should be created to keep track of these new capabilities so that others can implement and expand without stepping all over someone else! eclectic, since you took the idea to demo code, do you want to do this, or shall I?

When I was playing with the program, certain values caused a nasty flicker.
The M16 speed and the pause values I posted are a compromise.

It needs a little more "scientific" investigation,
but I can't do that at the moment.

Any Forumite with an AXE133Y ould contribute.

e
 
I started looking at changing the source to create a new instruction yesterday. Looking at it, it seems to stress speed and minimal processing between characters receved. I don't know whether this is just because the programmer wanted to keep things fast or whether it was a requirement for working with the display. I think I am right that the R/WB signal is hard wired to 0 so this means the reading of the busy flag is not possible and wonder whether the speed the programmer wanted was due to the fact there is no handshake available.

The code changes to implement strobing would have to take account of the state of the cursor and character flashing (since these are controlled with the same control instruction as the display on/off). The new code would have to intercept the command that specifies all three states (display on/off, cursor on/off and blinking char) and remember the state sso that they can be reinstated when the display is strobed on.

Whilst not a lot of code, it does represent quite a lot more than there is now in the character receive/send loop and I worry that it might throw the timings out.
 

mrburnette

Senior Member
<...>

Whilst not a lot of code, it does represent quite a lot more than there is now in the character receive/send loop and I worry that it might throw the timings out.
I agree. Limited testing this morning with my OLED and the 18M2 suggests that significant changes would be required to implement an "agreeable" methodology for dimming the OLEDs. As the M2 multitasking drops the thread frequency significantly (16MHz to 4MHz approx) this is not a good workaround and since background receive is only enabled on X2 parts, buffering to the scratchpad is not possible.

For sanity sake, perhaps TechSupplies should sell the OLEDs with optional sleep-blinders!

- Ray

Note: I've edited my earlier post to remove any thoughts of immediately creating an API for dimming OLEDs... Much more information and consideration is required. Until someone comes up with a creative way of handling this (or until WinStar implements a hardware solution), applications should implement some form of eclectic's on/off loop or simply discard the notion of dimming.
 

nick12ab

Senior Member
Has anyone tried replacing the resistors VR1 and VR2 with potentiometers to see if that adjusts the brightness yet?
 

nick12ab

Senior Member
I'm going to wait until I buy one from Techsupplies as I have a large character version from Rapid and I don't want to blow my 'investment' of £24 accidentally and the smaller ones at Techsupplies are half that with the serial driver board.

Maybe I should write to Winstar.
 

mrburnette

Senior Member
Ref: POST# 20
@Adrian

I've just been playing with the AXE133Y.

This is nowhere near perfect, but it does dim the display.

e
I modified the code inside the 18M2 to reflect a similar implementation but flexibility is restricted by expected timing issues. First, the SERIN command must be configured with a timeout/jump-address since it would normally be a blocking command. Then the subroutine that implements eclectics' code is modified since we are within the driver routine. Blinking is simply unacceptable. Attempts to lengthen the delay (increases of 40mS or more) will cause character loss. Attempting to lengthen the timeout value in SERIN causes a weird brightness spike... probably an optical illusion, but I'm just guessing.

<...original code...>
main:

serin [150,DIM_disp], RX,baud,b1 ; wait for the next byte
<... more original code ...>

; Dim OLED by off/on
DIM_disp:
low rs
let pinsB = 8 ; command OLED hide display
pulsout enable,1 ; pulse the enable pin to send data
'high rs
pause 80
'low rs
let pinsB = 12
pulsout enable,1 ; pulse the enable pin to send data
high rs
goto main
As you can see in the code snippet, I added one subroutine to Hide/Restore the display. Flashing is most annoying. However, I ran the modified code for 15 or so minutes using test input from another PICAXE and the unit did not skip any characters or exhibit any obnoxious behavior.

- Ray
 
Top