My mistake
I does not work “out of the box”. See this post by madias http://www.stm32duino.com/viewtopic.php … =424#p3954 a bit further down, with my reply.
Seriously: I think we all have done a good job with the compatibility definitions the last months, because I know about 6 or 8 months before the library didn’t worked for me (for some circumstances I ported a slimmer one -> viewtopic.php?f=13&t=7 )
So: “snake” here we come again!
Edit: For all price hunters: Meanwhile the display costs about 2USD (free shipping) for 5pcs. So they are back on place #1 of the cheapest graphic display modules. But you can grab a 128×128 ILI9163C TFT for about 4.5USD (with superb DMA driver support thanks to victor)
http://www.aliexpress.com/item/5pcs-blu … 54889.html
Assuming you power them directly from 3v3 and don’t use the on board regulator that is usually included on these boards and don’t use a back light, they consume something in the order of 200uA.
They are also usable (just) without a backlight, or with the backlight set very low.. and a lot cheaper than e-ink displays.
You don’t get many pixels for your buck, so colour displays are better for pretty much every other application, and Mr Google suggests some of the 1.8″ OLED displays get within a similar order of magnitude when it comes to power consumption.
I have noticed that a lot of the cheap Nokia 5110 displays I have received recently were not new displays. They were on a new PCB, but the displays were almost certainly recycled from old mobile phones.
One had visible burn in of a smuggy logo (I could not make out what it was), another one had a scratch, other have dirt between the metal surround and the glass of the display
I complained and got a partial refund from an eBay vendor in one case – perhaps I should have demanded a full refund….
I’m fine with getting recycled items if I know they are recycled and in good condition.
I think I was being fair by paying half price for the ones with burn in and a scratch etc, in fact more than fair really, as I can only use them for testing, and not even for prototype items that I’d show commercially.
I’m fine with getting recycled items if I know they are recycled and in good condition.
I think I was being fair by paying half price for the ones with burn in and a scratch etc, in fact more than fair really, as I can only use them for testing, and not even for prototype items that I’d show commercially.
Post by madias » Sun Jul 12, 2015 5:46 pm
I think Ray (mrburnette) will love it ![]()
I seem to be a bit transparent …
Ray
Adafruit_PCD8544.h
Line 69
#define PCD8544_SPI_CLOCK_DIV SPI_CLOCK_DIV8Sorry for that mistake by me
. I did have the following in the .h file
typedef volatile uint32_t PortReg;
typedef uint32_t PortMask;
Strangely SPI_CLOCK_DIV4 wont function to me, maybe a other module? To keep on the safe side, try it first with SPI_CLOCK_DIV8 than you can speed up (as you can “speed up” a pcd8544….)
// For the STM32F1:
// MOSI - on pin PA7 (Maple Mini: also know as pin 4)
// SCK - on PA5 (Maple Mini: also know as pin 6)
//
//#if defined (__STM32F1__)
// Adafruit_PCD8544 display = Adafruit_PCD8544(PA2, PA3, PA4);
//#else
// Adafruit_PCD8544 display = Adafruit_PCD8544(5, 4, 3);
//#endif
Currently the dev-branch is the most up-to-date, I didn’t merge it yet because I didn’t test it properly. See https://github.com/WereCatf/Adafruit-PC … /README.md for the interesting stuff (or if the branch doesn’t exist anymore then I’ve merged it and it can be found at https://github.com/WereCatf/Adafruit-PC … /README.md instead)
In file included from src/main.cpp:3:0:
.piolibdeps/Adafruit GFX Library_ID13/Adafruit_GFX.h:77:18: error: conflicting return type specified for 'virtual void Adafruit_GFX::write(uint8_t)'
virtual void write(uint8_t);
^
In file included from /home/jazg/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/HardwareSerial.h:38:0,
from /home/jazg/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/wirish.h:69,
from /home/jazg/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/Arduino.h:30,
from src/main.cpp:1:
/home/jazg/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/Print.h:39:20: error: overriding 'virtual size_t Print::write(uint8)'
virtual size_t write(uint8 ch) = 0;
[DrBanana – Mon Apr 17, 2017 4:21 am] –
The ported library doesn’t work with HW SPI. While defining pins PA5 and PA7(software SPI), It works.
I made the changes in the post at the top, and it almost works with HW SPI. I get a bit of display corruption on one or two of the demo screens, but the rest works fine.
I don’t understand the DIV8 change.. what is being divided? If it is 72mhz, that would give spi clock of 9mhz, shouldn’t it be DIV16 instead? What is the final clock speed? It works with DIV2 so I’m not sure this change has much effect or what it is doing.
[seandepagnier – Wed Aug 15, 2018 10:45 pm] –
Has anyone found a solution to display corruption? I am getting this with software spi, but hardware spi so far is ok.I don’t understand the DIV8 change.. what is being divided? If it is 72mhz, that would give spi clock of 9mhz, shouldn’t it be DIV16 instead? What is the final clock speed? It works with DIV2 so I’m not sure this change has much effect or what it is doing.
Perhaps try mod spiWrite as follows:
for(uint8_t bit = 0x80; bit; bit >>= 1) {
*clkport &= ~clkpinmask;
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
if(d & bit) *mosiport |= mosipinmask;
else *mosiport &= ~mosipinmask;
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
*clkport |= clkpinmask;
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
asm ("nop");
}
- BluePill programmed via ST-Link
- Arduino 1.8.5 and PlatformIO/Atom 3.6.0/1.28.2
- macOS Sierra 10.12.6
Hardware SPI:
LCD pin BP pin
1 – RESET PB9
2 - CE PB8
3 - DC PB7
4 - DIN PA5
5 - CLK PA7


