* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ![]() * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ![]() * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY ![]() * this software without specific prior written permission. * contributors may be used to endorse or promote products derived from Neither the name of the copyright holders nor the names of its * documentation and/or other materials provided with the distribution. * notice, this list of conditions and the following disclaimer in the Redistributions in binary form must reproduce the above copyright * this list of conditions and the following disclaimer. Redistributions of source code must retain the above copyright notice, * modification, are permitted provided that the following conditions are met: * Redistribution and use in source and binary forms, with or without * Copyright (c) 2017-2019 by Tom Honaker. * Copyright (c) 2015-2017 by Newhaven Display International, Inc. * Software License Agreement (BSD License) * to NOT send a 0x00 unless displaying character #0 is the desired result! When sending text to the display, remember * C/C++ strings end in nulls (0x00), but to a LCD or OLED display, character * although some unused functions might need to be cut if memory space is at * with few changes with any Newhaven slim OLED module and any STM32 MCU, * OLED display module connected to a Nucleo-F070RB. * The driver was designed and tested against a Newhaven NHD-0420CW-AB3 slim Variables are mainly declared inside functions so memory use is far * In order to save on precious memory, the library uses very little global * Check the datasheet for your display to wire it to the MCU in SPI mode. ![]() * so there's no requirement to use hardware SPI support. The interface being used is SPI, but it's bit-banged on any two pins * displays from just about any STM32 MCU with enough free pins to connect to * This is a comprehensive driver for running Newhaven's slim OLED character * Modifications and extensions by Tom Honaker. * Base SPI Code by Saurabh Baxi, Applications Engineer at Newhaven Display The code was ported in Atollic TrueSTUDIO 9.3 - minimal changes may be required if using another IDE. The code tested successfully on a Nucleo-F070R dev board (STM32F070R), but thanks to using the HAL it should work on pretty much any STM32 MCU. Also, an include in the header will need to be edited as well. The driver will automatically configure the pins for its use as part of its init process. To use, select two pins and edit four lines in the header file to define the lines. Again, only two lines are required from the MCU and they don't need to be SPI - the driver bit-bangs SPI well enough that the display I'm using (NHD-0420CW) fired right up on the first try. So I ported my library to STM32/HAL, and here's the first version if anyone else wants to have a go at it. My current project has moved from "doable on an 8-bit MCU" to "needing more program space" to "an 8-bit MCU with enough flash memory costs more than a 32-bit ARM Cortex M0 with more than enough flash." And along with it, I need to drive a Newhaven slim OLED character display. It works beautifully and only needs two lines from the Arduino to the display. Thanks to some help from Saurabh Baxi at Newhaven, I was able to create a fully functional Arduino library for the slim OLED character display line.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |