Closed dflag1514 closed 1 year ago
Hi @dflag1514
Interesting to hear that you have the Adafruit feather display 4650 working work both circuitpython and MicroPython. I have one of these displays but haven’t tried running it with this driver.
The default parameters for this driver work with 128x128 pixel displays. However the parameters would generally need some tweaks to get the driver properly working with 128x64 displays such as this one. It would be good to know about your experience and whether you found you needed to change any parameter values.
This driver calls the contrast method when the display is initialised with a value of zero. The circuit python SH1107 driver initialises with a higher contrast value (appears to be 0x4f) in the latest version. Maybe you could try amending the contrast value in the initialisation routine? Any value between 0 and 255 is possible.
I'd really need more information to advise further like perhaps sight of the MicroPython code you're using.
Hope this helps.
Hi Peter-I5--
Background info -- I am a retired EE with no formal software education, all of my software education is self taught. Most of my software experience has been with standard ANSI C. I have just started down the path of learning Python. I am very experienced in circuit design. I have a lab setup in a room that has scopes, meters, and power supplies and play there 3 to 4 hours a day. I have basically turned my work experiences into a hobby in retirement. I do this to help keep my mind active at 76. I have a couple of projects in development whereby I incorporate these small micro and sensor boards along with unique circuits that I design. When I was a front line working engineer I was one of the 1st to incorporate micros into fighter jets. This was in 1982 when the Falklands war was happening. As I have aged my skills have diminished some but I come with many years of experience doing real world jobs. With all of that, the software is my least experience, so I have the most to learn and the highest frustration in that area. Any help you can provide in that area is appreciated.
Immediate problem -- I have standardized on the Adafruit Feather series. In my research that series seems to be the best to use as it provides a modular flexibility that supports my projects. I used CircuitPython starting with version 3.0 up thru today, version 8. It was a good starting point to learn Python for these small machines. I have had many frustrations with CircuitPython but have put up with them. That has ended with my purchase of the FeatherRP2040. I then learned that in addition to not having interrupts it has NO way of using the 2nd core. That caused me to be motivated to start using Micropython. So I am in the process of crossing over to Micropython. At this moment I have 3 boards running on my bench, 2 with CircuitPython and 1 with Micropython. Eventually I will cross everything I have over to Micropython. I perceive it to be more mature with more features implemented. BUT the challenge is to get the Feather hardware working with Micropython. I figure, if I could linkup with a good software engineer that can help me I can do it.
Specific details of problem -- Regards the 4650 and the sh1107 driver. Initially I had trouble figuring out which FeatherRP2040 core and pins the I2C where working on. I got past that issue. The I had to deal with getting the memory map aligned with the display, then I had trouble getting the pixels that litup at power on turned off as I could not find any clear memory command. I managed to get some code to do that. Once thru all that I seem to be down to getting the display brightness(what they call contrast) up. Keep in mind I am sitting here with the same FeatherRP2040 running the 4650 with a nice level of brightness. I can see that some of the brightness issue is the font. The font used by the CircuitPython uses all pixels while the font on the MPyton looks rasterized which, by design, is going to be less bright. BUT what I am finding is the real issue, The display.contrast() command has no effect. In addition, many of the other commands, not all, don't seem to have any affect either. Makes be wonder if I am missing something in implementing the driver. Since that is on the software side, I am less able to figure it out. My Pyton, in general, is not so good. I still tend to think in "C".
Going Forward -- It would be great to work with a software person to further improve what I have. My feeling is that I am NOT implementing the driver properly. WHY? Seems like there should be a clear or reset. When I make changes to the values in the constants area they are NOT getting written to the associated registers in the sh1107 chip. These may seem like obvious things to some, BUT not to me. If I could get some clarification in these areas I might be able to make it work as intended.
Available info --
This is my code to clear the display;
display = sh1107.SH1107_I2C(128, 128, i2c, address= 0x3C, rotate = 0, external_vcc = True) display.fill(0) display = sh1107.SH1107_I2C(64, 128, i2c, address= 0x3C, external_vcc = True, rotate = 90) display.fill(0)
The following commands seem to work;
display.text(str(days), 40,25,1)
display.text(':', 50,25,1)
display.text(str(hours), 60,25,1)
display.text(':', 70,25,1)
display.text(str(minutes), 80,25,1)
display.show()
I have tried putting in many different values in place of the original constants. They seem to have no affect. I see there is a register routine, do I need to do a display.register to save the constants into the sh1107 registers?
-- Del
On Tue, Mar 28, 2023 at 5:09 PM peter-l5 @.***> wrote:
Hi @dflag1514 https://github.com/dflag1514
Interesting to hear that you have the Adafruit feather display 4650 https://www.adafruit.com/product/4650 working work both circuitpython and MicroPython. I have one of these displays but haven’t tried running it with this driver.
The default parameters for this driver work with 128x128 pixel displays. However the parameters would generally need some tweaks to get the driver properly working with 128x64 displays such as this one. It would be good to know about your experience and whether you found you needed to change any parameter values.
This driver calls the contrast method when the display is initialised with a value of zero. The circuit python SH1107 driver https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 initialises with a higher contrast value (appears to be 0x4f) in the latest version. Maybe you could try amending the contrast value in the initialisation routine? Any value between 0 and 255 is possible.
I'd really need more information to advise further like perhaps sight of the MicroPython code you're using.
Hope this helps.
— Reply to this email directly, view it on GitHub https://github.com/peter-l5/SH1107/issues/3#issuecomment-1487764824, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZDO2AGQ2YWR2REPLDTD6TW6N4TDANCNFSM6AAAAAAWJWREKM . You are receiving this because you were mentioned.Message ID: @.***>
Peter --
UPDATE -- I have managed to see that the display.contrast(nnn) command does work. I had to look closely at the brightness change to see it. I have since put may settings into the constant code area and not seen the brightness get any higher. After putting many hours into it, I am moving on to try a different display. Just wanted to give you an update.
I have managed to get the 2nd thread running BUT could not get both the 2nd thread and the interrupts working at the same time. I have the neopixels running on a routine that uses the PIO hardware, that seems to work well once I figured it out.
-- Happy Trails, dflag1514
On Wed, Mar 29, 2023 at 8:58 AM Del Flagg @.***> wrote:
Hi Peter-I5--
Background info -- I am a retired EE with no formal software education, all of my software education is self taught. Most of my software experience has been with standard ANSI C. I have just started down the path of learning Python. I am very experienced in circuit design. I have a lab setup in a room that has scopes, meters, and power supplies and play there 3 to 4 hours a day. I have basically turned my work experiences into a hobby in retirement. I do this to help keep my mind active at 76. I have a couple of projects in development whereby I incorporate these small micro and sensor boards along with unique circuits that I design. When I was a front line working engineer I was one of the 1st to incorporate micros into fighter jets. This was in 1982 when the Falklands war was happening. As I have aged my skills have diminished some but I come with many years of experience doing real world jobs. With all of that, the software is my least experience, so I have the most to learn and the highest frustration in that area. Any help you can provide in that area is appreciated.
Immediate problem -- I have standardized on the Adafruit Feather series. In my research that series seems to be the best to use as it provides a modular flexibility that supports my projects. I used CircuitPython starting with version 3.0 up thru today, version 8. It was a good starting point to learn Python for these small machines. I have had many frustrations with CircuitPython but have put up with them. That has ended with my purchase of the FeatherRP2040. I then learned that in addition to not having interrupts it has NO way of using the 2nd core. That caused me to be motivated to start using Micropython. So I am in the process of crossing over to Micropython. At this moment I have 3 boards running on my bench, 2 with CircuitPython and 1 with Micropython. Eventually I will cross everything I have over to Micropython. I perceive it to be more mature with more features implemented. BUT the challenge is to get the Feather hardware working with Micropython. I figure, if I could linkup with a good software engineer that can help me I can do it.
Specific details of problem -- Regards the 4650 and the sh1107 driver. Initially I had trouble figuring out which FeatherRP2040 core and pins the I2C where working on. I got past that issue. The I had to deal with getting the memory map aligned with the display, then I had trouble getting the pixels that litup at power on turned off as I could not find any clear memory command. I managed to get some code to do that. Once thru all that I seem to be down to getting the display brightness(what they call contrast) up. Keep in mind I am sitting here with the same FeatherRP2040 running the 4650 with a nice level of brightness. I can see that some of the brightness issue is the font. The font used by the CircuitPython uses all pixels while the font on the MPyton looks rasterized which, by design, is going to be less bright. BUT what I am finding is the real issue, The display.contrast() command has no effect. In addition, many of the other commands, not all, don't seem to have any affect either. Makes be wonder if I am missing something in implementing the driver. Since that is on the software side, I am less able to figure it out. My Pyton, in general, is not so good. I still tend to think in "C".
Going Forward -- It would be great to work with a software person to further improve what I have. My feeling is that I am NOT implementing the driver properly. WHY? Seems like there should be a clear or reset. When I make changes to the values in the constants area they are NOT getting written to the associated registers in the sh1107 chip. These may seem like obvious things to some, BUT not to me. If I could get some clarification in these areas I might be able to make it work as intended.
Available info --
This is my code to clear the display;
CLEAR the display
display = sh1107.SH1107_I2C(128, 128, i2c, address= 0x3C, rotate = 0, external_vcc = True) display.fill(0) display = sh1107.SH1107_I2C(64, 128, i2c, address= 0x3C, external_vcc = True, rotate = 90) display.fill(0)
The following commands seem to work;
display.text(str(days), 40,25,1) display.text(':', 50,25,1) display.text(str(hours), 60,25,1) display.text(':', 70,25,1) display.text(str(minutes), 80,25,1) display.show()
I have tried putting in many different values in place of the original constants. They seem to have no affect. I see there is a register routine, do I need to do a display.register to save the constants into the sh1107 registers?
-- Del
On Tue, Mar 28, 2023 at 5:09 PM peter-l5 @.***> wrote:
Hi @dflag1514 https://github.com/dflag1514
Interesting to hear that you have the Adafruit feather display 4650 https://www.adafruit.com/product/4650 working work both circuitpython and MicroPython. I have one of these displays but haven’t tried running it with this driver.
The default parameters for this driver work with 128x128 pixel displays. However the parameters would generally need some tweaks to get the driver properly working with 128x64 displays such as this one. It would be good to know about your experience and whether you found you needed to change any parameter values.
This driver calls the contrast method when the display is initialised with a value of zero. The circuit python SH1107 driver https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 initialises with a higher contrast value (appears to be 0x4f) in the latest version. Maybe you could try amending the contrast value in the initialisation routine? Any value between 0 and 255 is possible.
I'd really need more information to advise further like perhaps sight of the MicroPython code you're using.
Hope this helps.
— Reply to this email directly, view it on GitHub https://github.com/peter-l5/SH1107/issues/3#issuecomment-1487764824, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZDO2AGQ2YWR2REPLDTD6TW6N4TDANCNFSM6AAAAAAWJWREKM . You are receiving this because you were mentioned.Message ID: @.***>
Peter --
see attached picture. [image: 20230330_151703.jpg]
-- Del
On Thu, Mar 30, 2023 at 3:07 PM Del Flagg @.***> wrote:
Peter --
UPDATE -- I have managed to see that the display.contrast(nnn) command does work. I had to look closely at the brightness change to see it. I have since put may settings into the constant code area and not seen the brightness get any higher. After putting many hours into it, I am moving on to try a different display. Just wanted to give you an update.
I have managed to get the 2nd thread running BUT could not get both the 2nd thread and the interrupts working at the same time. I have the neopixels running on a routine that uses the PIO hardware, that seems to work well once I figured it out.
-- Happy Trails, dflag1514
On Wed, Mar 29, 2023 at 8:58 AM Del Flagg @.***> wrote:
Hi Peter-I5--
Background info -- I am a retired EE with no formal software education, all of my software education is self taught. Most of my software experience has been with standard ANSI C. I have just started down the path of learning Python. I am very experienced in circuit design. I have a lab setup in a room that has scopes, meters, and power supplies and play there 3 to 4 hours a day. I have basically turned my work experiences into a hobby in retirement. I do this to help keep my mind active at 76. I have a couple of projects in development whereby I incorporate these small micro and sensor boards along with unique circuits that I design. When I was a front line working engineer I was one of the 1st to incorporate micros into fighter jets. This was in 1982 when the Falklands war was happening. As I have aged my skills have diminished some but I come with many years of experience doing real world jobs. With all of that, the software is my least experience, so I have the most to learn and the highest frustration in that area. Any help you can provide in that area is appreciated.
Immediate problem -- I have standardized on the Adafruit Feather series. In my research that series seems to be the best to use as it provides a modular flexibility that supports my projects. I used CircuitPython starting with version 3.0 up thru today, version 8. It was a good starting point to learn Python for these small machines. I have had many frustrations with CircuitPython but have put up with them. That has ended with my purchase of the FeatherRP2040. I then learned that in addition to not having interrupts it has NO way of using the 2nd core. That caused me to be motivated to start using Micropython. So I am in the process of crossing over to Micropython. At this moment I have 3 boards running on my bench, 2 with CircuitPython and 1 with Micropython. Eventually I will cross everything I have over to Micropython. I perceive it to be more mature with more features implemented. BUT the challenge is to get the Feather hardware working with Micropython. I figure, if I could linkup with a good software engineer that can help me I can do it.
Specific details of problem -- Regards the 4650 and the sh1107 driver. Initially I had trouble figuring out which FeatherRP2040 core and pins the I2C where working on. I got past that issue. The I had to deal with getting the memory map aligned with the display, then I had trouble getting the pixels that litup at power on turned off as I could not find any clear memory command. I managed to get some code to do that. Once thru all that I seem to be down to getting the display brightness(what they call contrast) up. Keep in mind I am sitting here with the same FeatherRP2040 running the 4650 with a nice level of brightness. I can see that some of the brightness issue is the font. The font used by the CircuitPython uses all pixels while the font on the MPyton looks rasterized which, by design, is going to be less bright. BUT what I am finding is the real issue, The display.contrast() command has no effect. In addition, many of the other commands, not all, don't seem to have any affect either. Makes be wonder if I am missing something in implementing the driver. Since that is on the software side, I am less able to figure it out. My Pyton, in general, is not so good. I still tend to think in "C".
Going Forward -- It would be great to work with a software person to further improve what I have. My feeling is that I am NOT implementing the driver properly. WHY? Seems like there should be a clear or reset. When I make changes to the values in the constants area they are NOT getting written to the associated registers in the sh1107 chip. These may seem like obvious things to some, BUT not to me. If I could get some clarification in these areas I might be able to make it work as intended.
Available info --
This is my code to clear the display;
CLEAR the display
display = sh1107.SH1107_I2C(128, 128, i2c, address= 0x3C, rotate = 0, external_vcc = True) display.fill(0) display = sh1107.SH1107_I2C(64, 128, i2c, address= 0x3C, external_vcc = True, rotate = 90) display.fill(0)
The following commands seem to work;
display.text(str(days), 40,25,1) display.text(':', 50,25,1) display.text(str(hours), 60,25,1) display.text(':', 70,25,1) display.text(str(minutes), 80,25,1) display.show()
I have tried putting in many different values in place of the original constants. They seem to have no affect. I see there is a register routine, do I need to do a display.register to save the constants into the sh1107 registers?
-- Del
On Tue, Mar 28, 2023 at 5:09 PM peter-l5 @.***> wrote:
Hi @dflag1514 https://github.com/dflag1514
Interesting to hear that you have the Adafruit feather display 4650 https://www.adafruit.com/product/4650 working work both circuitpython and MicroPython. I have one of these displays but haven’t tried running it with this driver.
The default parameters for this driver work with 128x128 pixel displays. However the parameters would generally need some tweaks to get the driver properly working with 128x64 displays such as this one. It would be good to know about your experience and whether you found you needed to change any parameter values.
This driver calls the contrast method when the display is initialised with a value of zero. The circuit python SH1107 driver https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 initialises with a higher contrast value (appears to be 0x4f) in the latest version. Maybe you could try amending the contrast value in the initialisation routine? Any value between 0 and 255 is possible.
I'd really need more information to advise further like perhaps sight of the MicroPython code you're using.
Hope this helps.
— Reply to this email directly, view it on GitHub https://github.com/peter-l5/SH1107/issues/3#issuecomment-1487764824, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZDO2AGQ2YWR2REPLDTD6TW6N4TDANCNFSM6AAAAAAWJWREKM . You are receiving this because you were mentioned.Message ID: @.***>
Hi Del, I was about to reply when your message came through…. Sounds like you have a great background and wealth of experience for experimenting with electronics and microcontrollers! I’m envious to hear of your set up and the time you have available. I opted for MicroPython over circuitpython as it seemed like a better option in terms of having a spin-off towards learning Python itself. Although this may not be true I felt it was more transparent in what the language was doing. In terms of the issue you’re experiencing I did wonder if there might be some vestiges / remnants of circuitpython on your board that might be causing unexpected behaviours, although this seems fairly unlikely. Might be worth trying.:
Import sys
print('version ',sys.implementation)
Which should report the version of MicroPython you have installed.
Nothing jumps out at me in terms of the code you shared. … Glad to hear that you got the contrast working even if not much effect seen. On the Adafruit 128x128 display I have it is definitely visible. That’s probably the nicest looking of the 4 or so displays I’ve tried out.
You asked about thoughts on learning python. I like visual QuickStart python by Toby Donaldson. It covers a lot in a fairly thin book. I’ve tried a few more advanced ones as well.
You’re brave tackling the 2nd core! I haven’t found the limitations of one core have been an obstacle for me, so after looking into how it would work didn’t take it any further.
Peter --
Thanks for your effort. My motivation for using the 2nd core is driven by how long it takes to update the display. I use a time slicer that divides a second up into 10 millisec slices. If any task takes more than 10 millisec it prevents me from using the next time lice to do semi-realtime tasks. So by off loading the display update into a 2nd core it just gives me options to keep my time slicer avail for what I may need to do. It just provides a more general solution going forward.
YEA, it is nice being retired. I worked for over 45 years in the aerospace industry, mostly on weapon systems. I have also done industrial and commercial designs. At one time I worked for Sonicare and did the charger base for the tooth brush. I find working with these tiny micros is entertaining and allows me to use the equipment I accumulated over the years. My present project is to design a plant irrigation system. I have been designing a soil sensor for that last couple of years. The sensor I am working with and interfacing to the RP2040 measures soild moisture to 5 decimal places. I can literally see the moisture evaporate from the soil and many other interesting effects.
FUN STUFF.
Again, thanks for what you do. I find it very helpful.
-- Del
On Thu, Mar 30, 2023 at 3:40 PM peter-l5 @.***> wrote:
Hi Del, I was about to reply when your message came through…. Sounds like you have a great background and wealth of experience for experimenting with electronics and microcontrollers! I’m envious to hear of your set up and the time you have available. I opted for MicroPython over circuitpython as it seemed like a better option in terms of having a spin-off towards learning Python itself. Although this may not be true I felt it was more transparent in what the language was doing. In terms of the issue you’re experiencing I did wonder if there might be some vestiges / remnants of circuitpython on your board that might be causing unexpected behaviours, although this seems fairly unlikely. Might be worth trying.:
Import sys print('version ',sys.implementation)
Which should report the version of MicroPython you have installed.
Nothing jumps out at me in terms of the code you shared. … Glad to hear that you got the contrast working even if not much effect seen. On the Adafruit 128x128 display I have it is definitely visible. That’s probably the nicest looking of the 4 or so displays I’ve tried out.
You asked about thoughts on learning python. I like visual QuickStart python by Toby Donaldson. It covers a lot in a fairly thin book. I’ve tried a few more advanced ones as well.
You’re brave tackling the 2nd core! I haven’t found the limitations of one core have been an obstacle for me, so after looking into how it would work didn’t take it any further.
— Reply to this email directly, view it on GitHub https://github.com/peter-l5/SH1107/issues/3#issuecomment-1491056284, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZDO2CSXPNMLBCDWZO54BLW6YDUVANCNFSM6AAAAAAWJWREKM . You are receiving this because you were mentioned.Message ID: @.***>
Peter --
Checking in, Don't' know if you have an interest BUT I now have the included display working on the FeatherRP2040. It is a much smaller form factor. It is available from Amazon for $3 each. It works with ssd1306big. The normal font is too small for me to see. This gives you 3 lines at 8 characters per line. The ssd1306big code is a bit clunky. It needs some work to make[image: 20230402_101059.jpg] it better. I did have a hard time figuring out the syntax to get it working but I usually do. I'm still struggling with how objects and classes work. If I don't get good examples and have to back engineer the code, it takes me a while.
-- Del
On Tue, Mar 28, 2023 at 5:09 PM peter-l5 @.***> wrote:
Hi @dflag1514 https://github.com/dflag1514
Interesting to hear that you have the Adafruit feather display 4650 https://www.adafruit.com/product/4650 working work both circuitpython and MicroPython. I have one of these displays but haven’t tried running it with this driver.
The default parameters for this driver work with 128x128 pixel displays. However the parameters would generally need some tweaks to get the driver properly working with 128x64 displays such as this one. It would be good to know about your experience and whether you found you needed to change any parameter values.
This driver calls the contrast method when the display is initialised with a value of zero. The circuit python SH1107 driver https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 initialises with a higher contrast value (appears to be 0x4f) in the latest version. Maybe you could try amending the contrast value in the initialisation routine? Any value between 0 and 255 is possible.
I'd really need more information to advise further like perhaps sight of the MicroPython code you're using.
Hope this helps.
— Reply to this email directly, view it on GitHub https://github.com/peter-l5/SH1107/issues/3#issuecomment-1487764824, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6ZDO2AGQ2YWR2REPLDTD6TW6N4TDANCNFSM6AAAAAAWJWREKM . You are receiving this because you were mentioned.Message ID: @.***>
Hi Del (@dflag1514),
Apologies for the extended silence. Great news that you were able to get a display working. I've not had time to look further at getting this driver fully working with 128x64 displays yet but will investigate if I get the time.
Your project sounds interesting and very sophisticated: awesome that you are using a the second core to update the display. I considered attempting that but haven't tried it out yet. Do you think you might post it to github? I'd be interested to see if you do and will follow your profile so i get a notification accordingly.
By the way the images you posted to this issue didn't come through - perhaps due to sending in via email rather than posting on the web interface (where you can drag and drop images onto posts).
best Peter
closing issue as resolved
Hi, I thought I'd mention that after a bit of experimentation with the setup parameters this driver is working with 128x64 pixel displays such as the Adafruit FeatherWing OLED - 128x64 OLED (product 4650)
I have the adafruit 4650 OLED display working on the RP2040 using circuitpython along side one working on an RP2040 using Micropython, each using its prospective driver. Both work nicely with the exception that the one using the circuitpython driver is about x2 brighter. PLUS the display.contrast(nn) command on the Micropython unit has no effect. I have spent a bit of time trying to figure out why. Any help you can provide is appreciated. It is usable as is BUT would be better if the brightness(contrast) that is achieved on the circuitpython could be had.