I draw two lines with pset for 64 an 32 pixels.
Normally I expect the 32 pix will go over the whol height, but watch the picture.
The second point is, the Program does not restart with reset it do run after flash when both, pickit and external power is on. I can do a reset, when i diconnect the pickit and reconnet it.
Other programs are working normally, it seems something to do with my code or with the lib for the display
Last edit: Anobium 2017-08-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Picture.
I forgot, using the default font is unreadable, max. 4 pixel hight.
in whole the problem seems the displays behaves like 128x64 but has physically only 128x32
Is this strange?!
And, look at Help to prevent how to prevent glcd screen out of bounds writing. Either your program must ensure the screen parameters are not exceeded or use glcd protect.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is, what I tested first. Then there is nothing, but I will try it again with 0.98 Rc01
edit: Yes with #define GLCD_TYPE GLCD_TYPE_SSD1306_32
Nothing is doisplayed, no Reset action.
Yes I commented out everything with addresses >31
Last edit: bed 2017-08-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have just taken a new 128x32 OLED SDD1306 display from my post bag. Never used this 128x32 before.
Attached to microcontroller - four wires.
Used the test program - all worked very well.
I have updated the demo to support Low Memory Mode - see attached. I will include this demo in the formal release of v0.98.00
Note: I have no (nothing) attached to the I2C lines. My device has pullups fitted by manufactor. All my SDD1306's have pull-up fitted by the manufactor. Please remove the ones shown in your photo.
#define GLCD_TYPE GLCD_TYPE_SSD1306_32 'not #define GLCD_TYPE GLCD_TYPE_SSD1306
'Not sure why you are setting these...
' #define GLCD_WIDTH 128
' #define GLCD_HEIGHT 32 'this WAS 64!!
'Consider using
#define GLCD_PROTECTOVERRUN
line 0,10,10,63 'this exceeds Y pos limit of 31
line 0,0,127,63 'this exceeds Y pos limit of 31
circle(25,25,8) 'center 'this exceeds Y pos limit of 31
for ii = 0 to 63 'this exceeds Y pos limit of 31
pset 63,ii,1
next
If I change the GLCD type and remove the size, add protect overrun - all works as expected.
And, finally... not sure if release before the v0.98.00 RC1 support 128 * 32.... so, I am surprised it worked. :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With GLCD_TYPE GLCD_TYPE_SSD1306_32 No Function at all
with GLCD_TYPE GLCD_TYPE_SSD1306 it works, but Displayed text is aprox 4 pixel high, of course as I think.
The pullup Resistors are needed, because my StartPic18 does not have any on board.
I tried another one of Oled display, same result.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Any version prior to v0.98.00 does not support this device. Any version of the Linux distribution prior to v0.98.00 RC1 does not work or support this device.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Furthermore, I tried a new one never used display yesterday ... it does not work wether _32 or without :-)
Could it be, that my Displays are somewhat different or defect?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have SSD1306_32s working fine with a PIC18F2420. Might want to double check all your connections. On occasion I've had solder joints to resistors break and it caused me a lot of grief because I was checking for software issues instead of hardware issues.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi bed,I notice #define glcd_height 64 in your code. The ssd1306.h should work for a 128x32 if the screen display layout is the same just remember it's less pixels. You could change the buffer_alias to 512 in the include. There's been a lot of changes in glcd recently so probably sorted.
I've had the problem of the display initing on flash but not on reset but I seems to have resolved itself.
I'd be interested to know if they use the same display codes and it's "just" display size difference.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
DO NOT change the buffer. We know what we are doing.
We have changed the INIT. Look in the release note for this change.
It is NOT just display difference. We have extensively change the GLCD SH1106 and SDD1306 driver. Memory can be 0, 128, 512 or 1024 bytes.
Changing the library at this stage of root cause analysis is not the to find the core issue.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I played with glcd_height because of my trouble with the display, also tried some others.
Sometimes the brightness is far lower than normal, when powered with usb. So my claim "ITS RUNNING WITH USB POWER and PICKIT ONLY" is not correct
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've had also had the problem where the program doesn't restart if you turn the power off and then turn it back on shortly after. It will restart after it's been sitting a while. The reason is that the PIC draws very little power once the voltage drops low enough for the oscillator to stop. Therefore, the registers stay in whatever state they were in, and when you power it back up it often doesn't initialize because it hasn't really shut down completely. Solution is to short GND and Vcc after you turn the power off to ensure the voltage drops to zero. Or you can put something like a 10K resistor between GND and Vcc. This won't draw much power when the circuit is operating, but it will drain the voltage when the device is turned off.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like a good plan. In my dev Board there is an 100nF Capacistor to reset parallel which is not recommended by microchip IIRC, will tkae it out.
But I am short of time these days, so it could last a few days
Last edit: bed 2017-08-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Stan-The initialization routine is practically the same for both the SSD1306 and SSD1306_32 other than buffer size and a few parameters which tell the chip the display is 128x32 instead of 128x64.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well I hope bed gets it working.I was going to ask if he was using latest ssd1306 lib.
Joseph Realmuto, thanks for saying the init is much the same...ish.
I think you like these displays like I do. No harm in changing lib for own use but can't publish or it would like arduino... many libs for same device..each "improved". fnarr
Last edit: stan cartwright 2017-08-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
EDITED BY ANOBIUM.
This is caused by an error in the Linux version of the compiler. This error is not happening in the Windows version of the compiler.
Note: Only v0.98.00 support the 128*32 SD1306 OLED devices.
See https://sourceforge.net/p/gcbasic/discussion/579125/thread/9750951c/?limit=25&page=1#3480
**** END OF EDITS *****
My Display is an 128x32 pixel Oled Display.
But I have a strange bevaior with it
This is my Demo for showing the issue:
I draw two lines with pset for 64 an 32 pixels.
Normally I expect the 32 pix will go over the whol height, but watch the picture.
The second point is, the Program does not restart with reset it do run after flash when both, pickit and external power is on. I can do a reset, when i diconnect the pickit and reconnet it.
Other programs are working normally, it seems something to do with my code or with the lib for the display
Last edit: Anobium 2017-08-28
Picture.
I forgot, using the default font is unreadable, max. 4 pixel hight.
in whole the problem seems the displays behaves like 128x64 but has physically only 128x32
Is this strange?!
Last edit: bed 2017-08-27
Look in the Help.
You need to use the _32 define for that display.
And, look at Help to prevent how to prevent glcd screen out of bounds writing. Either your program must ensure the screen parameters are not exceeded or use glcd protect.
This is, what I tested first. Then there is nothing, but I will try it again with 0.98 Rc01
edit: Yes with #define GLCD_TYPE GLCD_TYPE_SSD1306_32
Nothing is doisplayed, no Reset action.
Yes I commented out everything with addresses >31
Last edit: bed 2017-08-27
I have just taken a new 128x32 OLED SDD1306 display from my post bag. Never used this 128x32 before.
Attached to microcontroller - four wires.
Used the test program - all worked very well.
I have updated the demo to support Low Memory Mode - see attached. I will include this demo in the formal release of v0.98.00
Note: I have no (nothing) attached to the I2C lines. My device has pullups fitted by manufactor. All my SDD1306's have pull-up fitted by the manufactor. Please remove the ones shown in your photo.
Tested using Great Cow BASIC v0.9.00 RC 1
Last edit: Anobium 2017-08-27
Specific analysis your code
You need to review the following:
If I change the GLCD type and remove the size, add protect overrun - all works as expected.
And, finally... not sure if release before the v0.98.00 RC1 support 128 * 32.... so, I am surprised it worked. :-)
I used this as well:
With GLCD_TYPE GLCD_TYPE_SSD1306_32 No Function at all
with GLCD_TYPE GLCD_TYPE_SSD1306 it works, but Displayed text is aprox 4 pixel high, of course as I think.
The pullup Resistors are needed, because my StartPic18 does not have any on board.
I tried another one of Oled display, same result.
Link to the display:
http://www.ebay.de/itm/Blue-IIC-I2C-0-91-128x32-OLED-LCD-Display-DIY-Module-3-3V-5V-For-PIC-Arduino/332048200050?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
What of version of Great Cow BASIC?
Any version prior to v0.98.00 does not support this device. Any version of the Linux distribution prior to v0.98.00 RC1 does not work or support this device.
Post your ASM and the HEX file from your project, as a ZIP.
Will do, today in the late evening
Odd.... Must be chip related.
I have 18f's working here in hardware and software i2c to the OLED display. If you want them demos I can send.
Meanwhile, try this....
Furthermore, I tried a new one never used display yesterday ... it does not work wether _32 or without :-)
Could it be, that my Displays are somewhat different or defect?
I have SSD1306_32s working fine with a PIC18F2420. Might want to double check all your connections. On occasion I've had solder joints to resistors break and it caused me a lot of grief because I was checking for software issues instead of hardware issues.
And, try this HEX. Produced by the Windows compiler.
Hi bed,I notice #define glcd_height 64 in your code. The ssd1306.h should work for a 128x32 if the screen display layout is the same just remember it's less pixels. You could change the buffer_alias to 512 in the include. There's been a lot of changes in glcd recently so probably sorted.
I've had the problem of the display initing on flash but not on reset but I seems to have resolved itself.
I'd be interested to know if they use the same display codes and it's "just" display size difference.
@Stan. Please read the release notes.
DO NOT change the buffer. We know what we are doing.
We have changed the INIT. Look in the release note for this change.
It is NOT just display difference. We have extensively change the GLCD SH1106 and SDD1306 driver. Memory can be 0, 128, 512 or 1024 bytes.
Changing the library at this stage of root cause analysis is not the to find the core issue.
I played with glcd_height because of my trouble with the display, also tried some others.
Sometimes the brightness is far lower than normal, when powered with usb. So my claim "ITS RUNNING WITH USB POWER and PICKIT ONLY" is not correct
I've had also had the problem where the program doesn't restart if you turn the power off and then turn it back on shortly after. It will restart after it's been sitting a while. The reason is that the PIC draws very little power once the voltage drops low enough for the oscillator to stop. Therefore, the registers stay in whatever state they were in, and when you power it back up it often doesn't initialize because it hasn't really shut down completely. Solution is to short GND and Vcc after you turn the power off to ensure the voltage drops to zero. Or you can put something like a 10K resistor between GND and Vcc. This won't draw much power when the circuit is operating, but it will drain the voltage when the device is turned off.
Looks like a good plan. In my dev Board there is an 100nF Capacistor to reset parallel which is not recommended by microchip IIRC, will tkae it out.
But I am short of time these days, so it could last a few days
Last edit: bed 2017-08-28
@Stan-The initialization routine is practically the same for both the SSD1306 and SSD1306_32 other than buffer size and a few parameters which tell the chip the display is 128x32 instead of 128x64.
In all cases. Do not change the buffer without asking Joe or me. We will advise whether the change is recommened.
Well I hope bed gets it working.I was going to ask if he was using latest ssd1306 lib.
Joseph Realmuto, thanks for saying the init is much the same...ish.
I think you like these displays like I do. No harm in changing lib for own use but can't publish or it would like arduino... many libs for same device..each "improved". fnarr
Last edit: stan cartwright 2017-08-27
For those following along... @Bed is testing an additional constant in the user program. Awaiting result of tests.