mbed lcd display made in china
You also have to get access to pin 36 for the dc signal. Cut the GND connection. You can use the level converter used for the LCD_LED signal. Mosfet Q1 can be driven with a logic signal without converter. Watterott will change this in a future revision.
To print characters to a graphic screen we need a font. To code a font by paper is ok for a small lcd, but for a 320*240 pixel display we need bigger fonts. A 12*12 pixel font is readable, but a lot of work to construct.
Load from mbed flash. It consume a lot of flash memory. To construct a bitmap array we can use gimp. http://www.gimp.org/ Load a image (edit and resize) and export it as BMP. You have to select the option 16 bit R5 G6 B5 !
simply copy test.bmp to the mbed usb drive or the SD-card. The bmp has to be saved with the options 16 bit R5 G6 B5 ! You can use the program gimp to convert pictures into the 16 bit bmp format.
The contrast VO pin seems to have different behaviour on different displays, so you may need to experiment for your display to see anything. I think I"ve seen some work tied to 0V, some to 3.3V, or with a different resistor.
Some displays need a negative voltage at VO. One side of the trimpot is connected to the negative voltage instead of GND in that case. F.i. a Maxim MAX1044 can be used to generate the negative voltage.
The underlying HD44780 chip is a driver used in many LCD character displays. It might sometimes be referred to as Hitachi HD44780U. There are also several compatible clones of this chip in use (eg Samsung KS0066).
With flexibility comes options, and the ability to get things wrong. As with the mbed NXP LPC1768 itself, every Apps Board owner has the same piece of hardware in front of them, so users can share code and be confident that results can be replicated.
Its particularly good for workshop and class environments, maybe where the flexibility and final design isn"t the focus. The board has been designed to fit as closely as possible with the mbed Textbook by Rob Toulson and Tim Wilmshurst, and it also fits in with the associated Course Notes.
With flexibility comes options, and the ability to get things wrong. As with the mbed NXP LPC1768 itself, every Apps Board owner has the same piece of hardware in front of them, so users can share code and be confident that results can be replicated.
Its particularly good for workshop and class environments, maybe where the flexibility and final design isn"t the focus. The board has been designed to fit as closely as possible with the [[http://mbed.org/cookbook/Textbook|mbed Textbook]] by Rob Toulson and Tim Wilmshurst, and it also fits in with the associated [[http://mbed.org/cookbook/Course-Notes|Course Notes]].
The uLCD-144-G2 from 4D Systems is a low-cost ($25 qty. 100) smart color LCD display board with a serial interface. They are also available from Sparkfun. It looks like a nice alternative to the now hard to find Nokia 6100 LCD breakout boards. It has a TTL level serial interface and a reset pin. An optional uSD card inserted in the display module"s socket can be used to load fonts, images, and play videos in response to serial commands.
In the drawing above, the pins are labeled from the uLCDs perspective with TX and RX pins. Mbed RX goes to uLCD TX and mbed TX goes to uLCD RX. So mbed TX goes to the middle pin on the connector which is the uLCD"s RX pin. The included cable seen below is plugged into the bottom row of pins and plugged into a breadboard using the male header pins for hookup. Note that on the cable silkscreen seen in the image below RX and TX have been swapped to indicate the connections needed to the microprocessor pins.
As an alternative, a two row 10-pin M/F header socket with long PCB leads can be used to make a breadboard adapter by cutting off one row of pins. The header socket plugs into the breadboard and the module plugs into the header socket. The second row of pins could also be cutoff on the LCD module itself, but this would preclude later use of the board’s GPIO pins and 3.3V supply for other projects. For more stable mounting, there are 2mm screw holes at the corners that could be used, but the header socket alone holds it rather well given the small size and weight.
The real problem on a breadboard is shorting the 3.3V pin to the reset pin. The board needs a 5V input, but it outputs 3.3V in case it is needed for external devices when it is used in standalone mode. Shorting the other 4 pins does not impede normal serial slave mode operation. Without a reset, the board typically locks up whenever mbed is reset. If the 3.3V pin is carefully bent down 90 degrees towards the center of the board and away from the reset pin, it will plug directly into a breadboard and work as seen in the photo below. The 3.3V pin could be bent back later if it is ever needed, but don’t count on this working more than once or twice before it breaks off. It would be a good idea to just leave it bent over and use a F/M flexible jumper wire to connect to it, if 3.3V from the display module is ever needed later in other projects. This might be the best solution for most users that want to plug it directly into a breadboard, avoid cutting off pins and avoid hooking it up through another connector.
If you are using an mbed plugged into an application board or other baseboard, use the cable provided with the display and stick short jumper wires in one end of the display"s cable connector and the other end of the jumper wires into the mbed header pin sockets that are found on most of these boards.
Initially, it would seem that the existing mbed cookbook 4DGL library would work with this module. It turns out that it has a different processor, Goldelox, and a different but similar command set than the earlier 4D Systems displays supported by the 4DGL mbed library. So a fork of 4DGL was required with quite a few changes in #defines for command values and baud rate divisors. Some functions are not available and some now have 16-bit arguments instead of 8. The basic features used in the demo code below work correctly and some additional work on the new library code could add other features. Support was also added for the use of printf by using the Stream base class and providing _putc and _getc virtual functions. With some minor changes (#defines for number of x and y pixels) the library should also work with the other small LCD displays from 4D systems that use the Goldelox processor. The large LCD modules and modules with touch use a different processor.
Video of demo code. A micro SD card on the LCD module is required for images and videos. The display is actually a bit more colorful and clearer than it appears in the video. Demos include text using printfs, basic graphics commands, a simple bouncing ball animation, computing the Mandelbrot set pixel by pixel, a Plasma wave BLIT, a JPEG image, and a *.wmv video clip.
The more complex Mandelbrot and Plasma wave demo code is not listed here for brevity but can be found after the code seen above in main.cpp in the uLCD144G2_demo program with the download link below.
Fork of 4DGL lib for uLCD-144-G2. Different command values needed. See https://mbed.org/users/4180_1/notebook/ulcd-144-g2-128-by-128-color-lcd/ for instructions and demo code.
The Goldelox Serial Command Manual explains the command set used in serial slave mode. It works in serial slave mode out of the box. Mbed can send it data too fast at higher baud rates and some small time delays (<=1ms) between characters in the library code are needed to avoid dropping characters when sending out some of the longer commands such as text string (perhaps a display UART buffer overflow?). Each complete command sent gets back an acknowledge character and the library code waits for it for synchronization.
After some experimentation with delays, the driver library now works up to the LCD"s maximum supported baud rate of 600,000. For extreme overclockers, the undocumented baud rates of 750,000, 1,000,000, 1,500,000 and 3,000,000 are running this demo successfully on the mbed LPC1768 with the current delay setup. On other mbed platforms, it will depend on the processor"s baud rate clock and divisor hardware. The quickest way to find out is likely to be through experimentation. The mbed serial API computes the closest possible baud rate match. The demo starts out with 9600 baud which should work on any platform. After the first demo screen, the baud rate is changed on the display and mbed with uLCD.baudrate(value). If it hangs in the demo with the message, "Change baudrate", that baud rate is not working on the platform. For fast transfers and more bandwidth, most applications should use the highest baud rate that works.
The Free 4D Workshop IDE (click "download" icon on that page and again on the next page for download) contains tools to translate fonts, images, and videos on a PC into formats used on the module’s micro SD card in response to serial display commands. This data is then stored on an unformatted uSD card mounted on the PC. Most laptops have an SD reader slot and many uSD cards come with a larger SD adapter, if not there are low cost USB to SD adapters that can be used on a PC. After writing the files, the uSD card is then removed from the PC and inserted in the display module. Serial commands from mbed can then load the fonts, images, and play video clips. For speed, the unformatted uSD card uses disk sector addresses in the serial commands and not filenames in a directory to locate this data, and files are stored in a contiguous RAW format. The procedure to create these files with the IDE tools is described in more detail in two application notes:
The module now comes with the serial mode firmware preinstalled, so it is not necessary to reprogram the module"s firmware to use these features as shown in the manuals with the special programming cable. When starting a new project in the IDE tool, be sure to select the correct LCD module and "Serial". This means that the display"s special IDE tools only need to be used to convert font, image, and video files and write them to the uSD card. The optional programming cable is not needed to write to the uSD card from the PC.
Using the 4D Workshop IDE, a Windows True Type Font was converted to RAW format and written on the unformatted uSD card. The initial steps are not intuitive, so be sure to read the font application note. The new font from the uSD card was selected and a double size "hello world" message was printed out to the display as seen in the image above. The serial commands sent from mbed are shown in the code below . The disk sector address varies depending on what files are already on the uSD card. In this case, nothing else was on the uSD card (i.e., 0,0). In addition to the new IDE tools, there is also an older free True Type Font conversion tool that can be used to generate font files for the uSD card or even C include files with font data.
Paint.net was used to resize the original jpeg image to 128 by 128. The IDEs disk partition tool, RMPet, was used to create two partitions on the uSD card, one FAT and one unformatted (50/50 on a 2G uSD) . The graphics composer tool (tool in IDE) converted the image file and created the new image file on the unformatted partition on the SD card. Windows will not be able to read files on a RAW SD card.This tool can also resize images and *.wmv videos for the display by selecting the file and clicking the "edit" button. It reported which sector address to use for the image (listed in project"s *.GC file).
JPEG, BMP, and other encoded image files could also be stored on a filesystem on mbed such as the SD card, local filesystem, or a USB flash drive. It could be read, decoded, and sent to the display using the BLIT (BLock Image Transfer) command. A fairly complex program is required to decode image files and the RAM buffers needed for decoding use most of the available RAM on mbed, so not much is left for any other purpose such as networking or the RTOS. Information on a student project that ported simple open source JPEG and BMP file decoders to mbed for use on an earlier LCD display is available on the project’s notebook page.
It takes a bit less than 1MB/sec for full screen videos and a couple minutes on a PC to initially render the video into the RAW binary format to write it to the unformatted SD card. The original video clip used in the demo was 900 frames with a play time of 30 seconds. The module"s uSD card video player will be able to support higher video frame rates than sending video data over the serial connection from mbed using the BLIT command.
This is working in the beta version of the driver that I will update in a few days after some more testing - (i.e., flush_media and write_byte needed to read in a two byte return error code from the display).
If the LCD display functions are used in multiple threads, or in a main program and an interrupt routine or callback additional steps are needed to insure mutual exclusion when accessing the LCD"s IO hardware. In general, the use of LCD commands in interrupt routines and callbacks should be avoided and all LCD commands should be placed in main. Global variables can be set in interrupt routines that code in main could check to send out any needed LCD commands.
With the RTOS, a mutex synchronization lock from the RTOS should be used to control access to the display in the case of multiple threads. In such cases, I/O devices typically need mutual exclusion locks to avoid problems. For example, one thread could be in the middle of a long LCD display command just at the point when execution switches to another thread (or interrupt routine) using the display. The display could wind up in the wrong state when a new command is sent before the first one is completed. In general, printf also contains non re-entrant code. An mbed RTOS LCD mutex lock code example (demo4) is available using a different LCD with several threads that display data in different areas of the display. If the RTOS is not being used, it is also possible to implement a mutex lock by disabling and enabling interrupts on a processor with one core.
With the 4D IDE tool it is possible to create high quality images of various instrument gauges. Each frame in the video clip stored on the uSD card shows a different gauge setting, and the display frame command can be used to select the correct frame needed for the desired gauge setting. It is possible to achieve a high update rate (higher than using graphics to redraw the gauge). There is a components page and video demoing this feature with mbed.
The module"s firmware can also be changed to work as a standalone module and a development tool IDE that supports and programs it is also available. The IDE needs a special programming cable available separately to download to the module"s flash. It might be possible to setup a serial bridge program on mbed to use in place of the special programing cable.
Not every single possible serial command is included in the library and more commands could be added. The existing commands are likely the most useful ones, but the remaining ones could be added at the expense of a bit more code memory. To aid debugging of new features, messages can be sent out on the mbed USB serial port at 115200. To enable these debug messages, change DEBUGMODE in the *.h file.
It should be possible to add support for a file system driver on the display"s SD card using the serial commands. The FATFILESYSTEM library needs a couple virtual functions to read and write disk sectors and initialize the disk to provide support for new media. It is about the same as the SD card file system driver, but it is using serial and not SPI for transfers. Might even work for an SD card with two partitions, one formatted for files and another unformatted for fonts, images, and videos.
Student projects using the LCD are shown above. They include a Pac Man game using an accelerometer, an IoT Alarm Clock with networking, an iPod-like music & video player, a Nest-like thermostat using a temperature sensor, and a Missile Command game using pushbuttons.
This Internet of Things example uses mbed"s networking features to display live RSS news feeds on the LCD. It is based on earlier networking examples from the cookbook that read a web page and the Text LCD library to display characters on a text LCD. CNN Technology news is used for the live RSS feed.
If you still get the net error message, make sure that DHCP service is enabled for your mbed. On some networks, you need to add the module"s MAC address to enable the DHCP server to give it an IP address. It times out with an error, if no IP address is returned in about fifteen seconds. If the news does not display on the LCD after seeing "net OK", you may have DNS problems or a very slow network.
Where N/C is not connected and the top left pin of the TextLCD’s header is GND and the right most pin is D7 in the LCD orientation shown in the images above. The resistor sets the contrast and some LCDs may need a different value or a contrast adjust potentiometer. See Text LCD for additional help, if needed.
(*) Note: some older LCDs may use 5V, but 3.3V is more common on current LCDs. If you cannot find a data sheet to confirm this, try 3.3V first and if the display is still blank (after double checking all other connections and code) it might need 5V. To save jumper wires, this setup uses the four bit interface to transfer ASCII characters to the LCD.
A small portion of the RSS news feed web page containing XML is seen below. The data displayed on the LCD is the title. The format is "
In the video above, mbed is powered up and obtains an IP address from the DHCP server. Net OK appears on the LCD. It then opens and reads a portion of the web page, searches for news items displaying them as they are found on the LCD and reads through the rest of the web page. When it reaches the end of the web page, "Read Complete" is displayed.
7. Use a Google RSS news feed. Google also has several RSS news feeds and news can be searched to generate a new RSS feed. Here is an example https://news.google.com/news/feeds?q=mbed&output=rss.
hello, trying to get the onboard button on an mbed application board to allow me to clear the screen and put new info, the button currently does nothing, i am getting the first 4 parts of info on the screen however this does not change when the button is pressed, i need help to try to make this work
NXP offers a variety of evaluation and prototyping platforms that are enabled through the popular, easy to use, web-based Arm mbed development platform. With an online software development kit, free software libraries, hardware designs and online tools, it is the fastest way to create products based on Arm microcontrollers.
SOUTH KOREAN DISPLAY GIANT LG DISPLAY (LGD) POSTED STRONG financial results for the third quarter (Q3) of 2020, riding increased OLED production capabilities and a turnaround in LCD panel prices to turn a profit after seven straight losing quarters.
The company says the strong results were driven by a rise in IT panel shipments, an uptick in mobile displays supplied to key customers, strong TV sales, and the ramp‐up of production at its new OLED fabrication plant in Guangzhou, China.
LGD emphasized the growth in the IT display sector, which is somewhat attributable to increased home schooling and remote work during the COVID‐19 pandemic, and progress in its OLED business on its earnings call. But probably the biggest reason for the company"s change in fortunes was the dramatic increase in LCD panel prices during 2020 after hitting an all‐time low just prior, says Eric Virey, senior analyst at Yole Devéloppement.
In November 2019, commodity 32‐inch LCD panels were selling for $30, Virey says, while now the price has doubled and they are $60 per panel. And prices for 55‐inch LCD panels for TVs are up some 65 percent over the same period, rising from $100 in November 2019 to around $167.
Virey notes that LGD initially planned to shut down manufacturing of LCD panels for TVs in South Korea in light of the competitive pressures brought by Chinese fabrication plants, but has now put those plans on hold. Like its rival Samsung, LGD had already shifted some of its LCD capacity toward making higher‐margin IT displays such as desktop monitors and laptop displays heading into 2020. That business received a boost from the COVID‐19 pandemic in Q2, and Virey now sees strong demand for IT displays holding through early 2021.
In other LGD news, the company has rolled its transparent OLED display technology across two major subway systems in China. The 55‐inch displays with touchscreen capability have been installed on Line 6 in Beijing and Line 10 in Shenzhen, where they are being used to show real‐time information about subway schedules, routes, and status as well as news and weather reports. LGD says it hopes to bring them to other subway lines in China in the future.
While Samsung first showed transparent OLED displays at the 2012 Consumer Electronics Show (CES), LGD"s subway installation in China is by far the biggest deployment of the technology to date, Virey says. He says he doesn"t see transparent OLED taking off as a mainstream product, but thinks it may find favor for some high‐end retail or public display applications. At the very least, the subway application is a nice showcase for the technology.
Embedded and Internet of Things (IoT) development teams are under pressure to finish and ship their design as quickly as possible. To move fast, they need to use proven components and software frameworks that have a strong ecosystem around them. They also need to look at how their systems will be maintained and scaled in the future, which means that solutions also need to be portable and able to work across multiple hardware platforms if need be.
Considering these requirements, this article will introduce the Arm Mbed platform and operating system. It will show how developers can leverage the Mbed ecosystem to accelerate their embedded product development and use it to scale beyond the microcontroller vendor’s ecosystem.
Mbed is an online collaboration headed by Arm for developers interested in building IoT devices1. Mbed provides developers with a wide selection of resources designed to accelerate development, ranging from the Mbed OS and Mbed TLS all the way through development boards and individual hardware components that are supported by the Mbed libraries.
The premise behind Mbed is to enable developers to leverage a large ecosystem supported by 200,000 developers in online communities along with major microcontroller vendors such as Cypress Semiconductor, NXP Semiconductors, and STMicroelectronics to accelerate their development by using existing components, development tools, and libraries. There are many advantages to using the Mbed ecosystem:
Access to the Mbed online and offline compiler along with the Mbed command line interface (CLI), which makes developing software tests easy (and is even included in many examples and libraries).
The general architectural model for Mbed makes it extremely flexible and scalable for embedded developers. For example, the architectural model is generally broken up into three separate layers (Figure 1):
While Mbed provides a great software foundation, it offers more than just the software and the tools needed to develop that software. The quickest way that a team can develop a product is to also leverage the Mbed hardware ecosystem, which comprises three distinct areas:
Mbed boards are essentially development boards for different microcontroller families that are all supported by Mbed. Each development board has unique features and capabilities that are provided by the microcontroller vendor. For example, a developer interested in working with a board that supports Bluetooth Low Energy (BLE) might be interested in Cypress Semiconductor’s CY8CKIT-062-BLE (Figure 3).
The CY8CKIT is unique in that it features a multi-core PSoC 62 secure microcontroller. One core is an Arm® Cortex®-M4 processor while the second core is a low-power Arm Cortex-M0+. This allows developers to either partition their application code, such as having one processor handle the BLE communication, or lock down the application by using the Cortex-M0+ core as a security processor. All the I/O expansion available on the boards makes it a lot easier for developers to prototype their system by connecting Mbed components to them.
An Mbed component is a hardware component that has Mbed supported libraries and middleware associated with it that act as building blocks for creating a product. For example, a developer working on an IoT project may decide that they want to include a temperature sensor. A developer can search Mbed components for supported temperature sensors and they would come across, for example, Maxim Integrated’s MAX31723PMB1, which comes in a peripheral module that can be used for rapid prototyping (Figure 4).
What’s great about such Mbed components is that they nearly always come as a development board with schematics available. This allows a developer to not only see the hardware configuration required to make the sensor work, but have the software library available to get the sensor up and running.
Simple sensors like those measuring temperature and humidity aren’t the only types of sensors that are available through Mbed. For example, developers working on a medical device will find that the Maxim Integrated MAXREFDES220# module provides them with a reference design for a finger-based heart rate and SpO2 blood oxygen sensor (Figure 5).
Once a developer has selected their development board and components, they can start developing with Mbed by creating a “Hello World” LEDBlinky application to test that they can program their board successfully and blink an LED.
There are several different ways to develop an Mbed application: through the online compiler; the offline compiler; or by using the command line interface (CLI) tool. Personal experience suggests using the CLI because it provides more control over the development process and makes it easier to integrate into development processes, such as test harnesses and continuous integration servers.
The CLI provides command line interface capabilities so a developer working on Windows can use the command prompt to compile their code. The first step in creating the LEDBlinky application is to use the pre-made example provided with Mbed. This can be done by entering the following command into the command prompt:
It will take a few minutes to download the example as this also brings in supporting Mbed OS and other components that may be used in the application. Once the download is complete, a developer can navigate to the mbed-os-example-blinky folder where they will find a main.cpp file. This module can be opened in a developer’s favorite editor and will look something like the following:
Compiling the project for the first time can take several minutes since the toolchain will have to build all the associated files that automatically come into an Mbed application. Once the compilation cycle is completed, the result should look something like Figure 7 below.
Getting started with Mbed is straight forward, but there can be challenges for developers. Below are a few “tips and tricks” for starting to develop a product using Mbed:
Avoid using the online compiler. This is fine for hobbyists, but for professionals, having source code on someone else’s servers can be a problem. Also, the back and forth to the cloud can slow down debugging. A local compiler such as the Mbed IDE or the Mbed CLI are better options.
Embedded and IoT developers need a well-supported ecosystem that provides them with modern tools, processes, and software to help them accelerate their development efforts and minimize development costs. As shown, the Mbed platform and OS is one potential option that developers can leverage.
Mbed provides a scalable and flexible software architecture with many components that have already been integrated and tested together. The large support for various hardware modules, boards, and components makes it easy for developers to create a product prototype that can then be scaled into a production solution.
This article explains in detail how to use and debug SSD1306 displays. In this article, I use the Segger emWin library and MBEDOS, but for all practical purposes this discussion applies to all other interfaces to the board including Arduino, Raspberry Pi, Adafruit, etc. I will say from the outset that I spent far far too much time digging into the inner workings of an 11 year old graphics driver. Oh well, hopefully someone will get some benefit.
A year ago (or so) I designed a user interface board called the CY8CKIT-032 to go with my Cypress WICED WiFi book and class. This board uses a PSoC 4 Analog co-processor which can do a bunch of cool stuff. I have a series of articles planned about that board, but that will be for another day. One of the things that I did was put a 0.96″ I2C OLED Display based on a SSD1306 driver on the board. These displays are widely available from Alibaba and eBay for <$2. I think that the displays are being used in inexpensive cells phones in China so there are tons of them and they are CHEAP! The bad news is that if you google “ssd1306 problems” you will find an absolute rogues gallery of unpleasantness. It seems that tons of people struggle to get these things working.
This whole thing started last week as Cypress released and update to our MBED OS implementation. This update included releasing a complete set of the Segger emWin drivers. I had been wanting to step up to a more robust graphics library than the Adafruit library that I used in this article. I was pleased to see that our release included the emWin SPAGE driver which knows how to talk to a bunch of different page based displays including the SSD1306.
But, as always, I had to wrestle with the display a little bit before I got everything working. This time I wrote down what I did/learned. So, for this article I will describe
There is not a lot to know about the electrical interface. The data sheet specifies that the device can use I2C, SPI, 6800 and 8080. I have not seen either the 6800 or 8080 interface put onto any of these OLED displays. Like all driver chips, the SSD1306 has an absolute boatload of pins, in fact, 281. The chip is long and skinny and was made to be mounted either on the display under the glass or on the flex connector. Of the 281 pins, 128+64=196 are connected to the segments and commons in the display. The rest of the pins are either capacitors, no-connects, power/ground or data signals. The data signals are
One thing you should be careful about is the I2C connections. I looked around on eBay and Alibaba to find a few pictures of the I2C displays. You should notice that all three of these displays are I2C, but all three of them have a different position and ORDER of VCC/GND/SCL/SDL When we ordered displays from China to go onto the CY8CKIT-032 we found displays in the same BATCH that had different orders of the VCC/GND.
The first part is the command interface. Inside of the chip there are a bunch of logic circuits which which configure the charge pumps, sequence COMs and SEGs, charge and discharge capacitors etc. All of these things are configurable to allow for different configurations of screens e.g. different x-y sizes, configuration of what wires are connected to what places on the glass etc. Before you can get the display to work correctly you must initialize all of these values by sending commands. All the commands are 1-byte followed by 0 or more command parameters.
The second part is the data interface. Inside of the SSD1306 chip there is a Graphics Display DRAM – GDDRAM which has 1 bit for every pixel on the screen. The state machine inside of the chip called the Display Controller will loop through the bits one by one and display them on the correct place on the screen. This means that your MCU does not need to do anything to keep the display up to date. When you want a pixel lit up on the screen you just need to write the correct location in the GDDRAM.
As to the fundamental commands. I tried a bunch of different contrast settings on my screens and could not tell the difference between them. I tried from 0x10 to 0xFF and they all looked the same to me. The best course of action is to use the default 0x7F. I don’t really know why there is a command 0xA5 “Entire Display ON ignore RAM”. The data sheet says “A5h command forces the entire display to be “ON”, regardless of the contents of the display data RAM”. I can’t think of a single use case for this. I suppose that if you issue 0xAE the screen will be all black… and if you issue 0xA5 the screen will be all white? But why?
In the next section of the command table are the “Scrolling” commands. It appears that this graphics chip was setup to display text that is 8-pixels high. The scrolling commands will let you move the screen up/down and left/right to scroll automatically without having to update the the frame buffer. In other words it can efficiently scroll the screen without a bunch of load on your MCU CPU or on the data bus between them. The Adafruit graphics library provides the scrolling commands. However, I am not using them with the Segger Library.
The hardware configuration registers allow the LED display maker to hookup the common and segment signals in an order that makes sense for the placement of the chip on the OLED glass. For a 128×64 display there are at least 196 wires, so the routing of these wires may be a total pain in the ass depending on the location of the chip. For instance the left and right might be swapped… or half the wires might come out on one side and the other half on the other side. These registers allow the board designer flexibility in making these connections. Commands 0xA0, 0xA1, 0xA8, 0xC0, 0xC8, 0xD3, 0xDa will all be fixed based on the layout. You have no control and they need to be set correctly or something crazy will come out.
These displays require a high voltage to program the liquid crystal in the display. That voltage can either be supplied by an external pin or by an internal charge pump. All the displays that I have seen use an internal charge pump.
In order to actually get data to display on the screen you need to write 1’s and 0’s into the Graphics Data RAM that represents your image. The memory is actually organized into 8 pages that are each 128 bits wide and 8 bits tall. This means that if you write 0b10101010 to location (0,0) you will get the first 8 pixels in a column on the screen to be on,off,on,off,on,off,on,off. Notice that I said vertical column and not row. Here is a picture from the data sheet. That shows the pages:
If you have the speckled screen this means that your screen is displaying an uninitialized frame buffer which the SSD people call the GDDRAM. These are basically the random 0 and 1s that are the startup values in the SSD1306. If this is happening then your graphic data is probably not being transferred between your MCU and the SSD1306. This almost certainly means you have a problem in your porting layer.
Micor:bit has variety of programming methods like mbed, micropython, typescript and other programming methods, as well as code online websites which are abundant.
Place the block before send display data. You can choose the position, color and size. For the screen, (1,1) is on top-left, and (160,128) is on bottom-right