- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I got a SSD1306 OLED display from eBay to work using some code contributed by a community member. The code is based on an Adafruit library. See the attached project. I cannot, however seem to get a bitmap to display. I am using this program to convert a .bmp to a char array, but it comes up on the display as garbage, though it seems there is some hint of the image there.
Library:
https://github.com/adafruit/Adafruit-GFX-Library
Converter tool:
http://en.radzio.dxp.pl/bitmap_converter/
Any ideas?
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Never mind, the code works fine, I just had to use horizontal byte orientation instead of vertical in the converting software. These OLEDs are beautiful and cheap on eBay. No excuse not to have one on a project.
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
One other question. Is there a simple way to store initial data in flash besides using the EM_EEPROM? Arduino has a PROGMEM designator, is there something similar in PSOC?
I am trying to store bitmap data for an OLED display, and it does not work in just a standard array. Why can't the processor recall this array after power off? It seems to recall other arrays and variables that I set up as constants.
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You may declare an array as
static const uint8 MyArray[YourSize] = {0x01,0x02,... and so on.
"const" and the initialization are absolutely requred to have that "variable" located in flash.
Structs are allocated in flash similarly.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your program is straightforward and I cannot see an uninitialized variable. So a chance might be that there is a timing issue when toggling power. Does a reset show the same problem?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
A reset preserves the data (and animation) and a power off does not.
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
then I would suggest to put a delay (0.1 to 0.5s) before initializing the display.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right on! 100ms seems to be a good minimum for what I have.
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are always welcome, Tom!
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not to rain on your parade, but would it not be prudent to figure
out approximately where the delays are coming from and their cause,
size ? Just to be sure one device to another you have predictable behaviour
and can be assured that the delays you currently are implementing are not
masking a more serious problem that may bite you in the great divide at
a later time.
Just a thought.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry to once again appear quite ignorant, but how would I go about this? It is a fairly simple piece of code right now, how would I tackle it?
Thank you,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I did not go deep into the specs of your OLED display, but as most devices there is a time needed before it is able to react to commands after power is supplied.When the PSoC is ready first and starts sending commands that would go amiss.
A review of the datasheet concerning power on sequence shows a delay of 100ms after initialization.
Additionally I would monitor the power supply when switching on, there could be some unwanted glitching or a ramp too slow.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
These are the requirements for power up and down -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tom,
On the link you listed from Adafruit i do not see any down loads for PSoC adjusted code. Were did you get the adjusted code for PSoC version for SSD1306?
Scott