RA8875 SPI LCD Demo

08 Dec 2015

Hi, I imported this demo, but cant compile...

running on STM32F072, I get an error 289 here;

RA8875 lcd(PB_5, PB_4, PB_3, NC, "tft"); MOSI, MISO, SCK, /ChipSelect, /reset, name SPI1 port

either SPI1 or SPI2 both have the same error

error 289

Error: No instance of constructor "RA8875::RA8875" matches the argument list in "main.cpp", Line: 20, Col: 19

08 Dec 2015

I fixed it, it was a typo in the original file. :)

RA8875 lcd(PB_5, PB_4, PB_3, NC, "tft"); MOSI, MISO, SCK, /ChipSelect, /reset, name SPI1 port

was not complete, check the comment.

adjusted to:

RA8875 lcd(PB_5, PB_4, PB_3, NC, NC, "tft"); MOSI, MISO, SCK, /ChipSelect, /reset, name SPI1 port

... it now compiles but does not run :(

12 Dec 2015

Hi Nick,

I just downloaded the original (for the LPC1768 since I don't have an STM32F072). It compiles and runs. I guess your issue is mapping it to the STM part and the revised pin names.

To make sure the conversation is not damaged, if you surround your chucks of code with <<code>> and <</code>>, it will appear as you see here. (Put one on the line ahead of your code and one on the line after your code).

    RA8875 lcd(p5, p6, p7, p12, NC, "tft");    // MOSI, MISO, SCK, /ChipSelect, /reset, name

I was able to add the ST part to my build environment (even though I don't have one). Then I think I spotted the issue - the Chip Select pin is required for the RA8875. I think the transition from not-selected to selected is what sets its internal state machine to accept a command.

So, you need to have one more pin that can be a digital out, and place it in the /ChipSelect position of the constructor (and wire it to the display of course).

RA8875 lcd(PB_5, PB_4, PB_3, PB_10, NC, "tft");    // MOSI, MISO, SCK, /ChipSelect, /reset, name
13 Dec 2015

Hi David,

<< Thanks for the response >>

I have used your Display code successfully now, it all seems good.

but to get a larger font I had to import a TTF and remove the first byte, this all works now Arial 39x40, however, it take a huge amount for Flash.

did you try to access the Character flash on the display module ?

I got my display from China, the manufacturer has no idea how to use it, but the flash chip is install on my unit.

If you could have a look and check your display, I would love to know how to use this external character map, freeing up over 40K of my limited 128k Flash, also I think the characters will write faster without us waiting around, freeing up the cpu.

Also, I tried another demo of yours, but could not implement the local file system.

I would love to have the USB file system run on my STM32F072, but it does not seem to be supported. :( I have a serial flash chip on my board, where can I find code to run this ?

Thanks David.

13 Dec 2015

Hi Nick,

Fantastic that it is now working on your micro!

Now, on to the new issues -

Large Font

  1. I need to look into your note about removing the first byte to use the soft font. I haven't actually used that since my first derivative integration of that work, but I'd like it to not have "special handling". Is that by chance in a repo you could share, so I don't have to start from scratch?
  2. External Font Chip work has been done by others, and they claim success. I do not have the extra font chip on my display module. See the section "Fonts" on the RA8875-Based-Display page. Your needs probably exceed the built-in fonts, even when applying the font scaling?

File System

  • The LPC1768 mbed is rather handy with that built-in local file system. But if you have an SD adapter, it should be relatively easy to use that instead. The display module has an optional SD card slot. A few extra wires to connect, but this should be all that you need.

Serial Flash

  • Beneath the various file system interfaces is commonly the FatFs drivers from elm-chan.org. If you visit that site, scroll toward the bottom, and check the FatFs module application note, you'll see how flexible that SW is. I would be surprised if somebody hasn't already created a port for your module to use the serial flash as a file system.
14 Dec 2015

Hi David,

I am a severe NewBee, so please be patient.

I found a TTF set on MBED so I loaded the file. I think it is https://developer.mbed.org/users/dreschpe/code/TFT_fonts/ with some notes on larger fonts here https://developer.mbed.org/questions/5046/Font-with-more-than-255-bytes-character/

then I copied various fonts into your folder, but nothing worked. I looked inside to find there is a single byte '00' in the front which is not in your file. One larger font had an 04 in front., I just removed that first byte.

'is that by chance in a repo ?' I am not sure what a repo is :(

my work is quite busy, not sure if you would want to work with it anyhow, with some specific code for my target board.

I will check into the Large font link, than you, and the serial flash link too.

I am sure I will struggle. You code was really easy to work with, less than a day to get the large font and everything running, thanks for that excellent work.

I hope we can keep in contact.

which city are you in ? I am in Brisbane... Nick.

14 Dec 2015

Hi Nick.

Sorry - "repo" is short for repository, meaning your code repository / project. Often, a persons project grows a bit too big to easily troubleshoot just a piece of it. If that is the case and you want more eyeballs to be able to look at it, you might create a small demonstrator - a new project as small as possible that still shows the issue. Then you can set that project to be publicly accessible and share the link to it.

I see from your profile that you're in the mid-Atlantic, not Brisbane ;). I'm in Waterloo Iowa, in the US.

I spent a little time yesterday working over the process of including custom fonts. I think I'm about to make a breaking change (meaning that it won't be backward compatible). But it might be easier to work through - by incorporating a font file more directly from the GLCD tool. This will mean that you cannot easily leverage the fonts that others have shared, but it looks like it will be more memory efficient. Stay tuned for this as I've a few more days work ahead to proof the changes.

- David

15 Dec 2015

Hi David,

this is the second time I have replied, the last reply must have evaporated in cyber space... :(

I was reading your profile, we must be a similar age.

my problem was in 1987ish, in 'C' I had a very poor success. Buggy and crappy as a summary. So I moved to Intel assembler.

I never really moved from ASM until about 3 years ago.

I am still finding my feet in C.

The syntax of C is my biggest issue these days. The convoluted syntax is flattening my learning curve.

Anyhow, I have made many boards over the years, so, not a hobbyist :)

Now, I have this new project everything is running well up until yesterday when I fried the board. Now I have replaced the whole power supply section and the processor, but we are not stable now. When it falls over, it results in errant data sent to the LCD.

Since I blew up the processor, ' Bubbles on top ' you can say, since the LCD is directly connected, maybe it was damaged too. I have new LCDs coming today :)

Somehow just before it crashes, the LCD is sent rubbish and the background and foreground processes all fail. This is indicating that the LCD driver software is not accessing the correct font location. I guess we have some ram corruption issue, where your font link is being overwritten.

Since I am extremely new to MBED, I have not found any kind of debug

I thought it was related to the LCD but I found eventually the internal RAM of the processor was intermittent.

When I replaced it yesterday, I did overheat it with the braid :(

anyhow, replaced it again today, being a little more careful, and we are back... all good.

You display code is excellent, good work Dave,

I hope we can work together, I still have significant hurdles to clear on this design...

Nick

06 Mar 2016

hi Nick,

I haven't heard from you in a while - I wonder where you're at, and if you're still making good progress now?

If you have been tracking my changes to the RA8875 driver, you'll see that there have been a number of them since this last note. Including font support. regards, David