Component: LCD SPI (MiniClick) (Alphanumeric)

Post and discuss new components that you have created.
r_teixeir
Posts: 13
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 1:45 pm
Has thanked: 1 time

Re: Component: LCD SPI (MiniClick) (Alphanumeric)

Post by r_teixeir »

Hi Ben,Thank you for the component update! Looking at the newly generated C code from this version, I can confirm that the hardcoded parallel PORTB bit-banging conflict from the base LCD library is now completely gone. The new RawSend routine correctly routes everything through the expander logic via the SendPinsToExpander macro.However, the physical hardware is still not displaying any characters because of an IOCON register addressing mismatch inside the component's WritePort macro.In the updated C output (pages 43-44), the component is hardcoded to write to registers 0x14 and 0x15:

if (FCL_PORT == 1) {
FCD_0c261_LCDMiniClick1__WriteRegister(1, ~FCL_MASK);
FCD_0c261_LCDMiniClick1__WriteRegister(0x15, FCL_VALUE); // Hardcoded to 0x15
}

This configuration implies that the MCP23S17 expander is operating in BANK = 1 mode. However, standard MCP23S17 silicons (including the ones populated on MikroE's official LCD Mini Click boards) always boot up in BANK = 0 by default after a hardware reset.To prove this context, the official working example library from MikroElektronika (mikroC PRO) uses the standard SPI_Lcd_Config(0) routine. Under the hood, MikroE communicates with the MCP23S17 using BANK = 0, which targets register 0x12 for PORTA and 0x13 for PORTB.Since the current Flowcode compilation generates hardcoded writes to 0x14 and 0x15 (which are BANK 1 output latch addresses), the expander completely misinterprets the initialization sequence when it is in its native BANK 0 state, causing the display to remain blank.Could you please update the component's Start macro to explicitly force IOCON = 0x80 at the very beginning to configure the device into BANK 1 address mapping? Alternatively, updating the macro to target the standard native BANK 0 addresses (0x12 and 0x13) should resolve this hardware incompatibility instantly.I have attached this latest generated .c file along with my updated .fcfx project file for your review.

Best regards

Rod
Attachments
LCD_Mini_V11.fcfx
(13.09 KiB) Downloaded 35 times

r_teixeir
Posts: 13
Joined: Thu Dec 10, 2020 1:45 pm
Has thanked: 1 time

Re: Component: LCD SPI (MiniClick) (Alphanumeric)

Post by r_teixeir »

Hi Ben and team,
I hope you are well.
I am writing to ask for a little help with this component, as I am currently stuck on this issue and unable to get a simple "Hello World" to display on my hardware after flashing the HEX file.
I’m using Flowcode v11 (Professional Version) and trying to get the LCD Mini Click to work. Based on the generated C code, it looks like there might be a register address mismatch (BANK 0 vs BANK 1) for the MCP23517 expander, which prevents the characters from showing up on the physical screen.
Could you please help me understand what might be causing this compatibility issue or how I can bypass it? If anyone has a working workaround or could take a look at the attached .fcfx file, I would truly appreciate it.
Thank you so much for your time and continuous support!
Best regards,
Rod

BenR
Matrix Staff
Posts: 2232
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 615 times
Been thanked: 807 times

Re: Component: LCD SPI (MiniClick) (Alphanumeric)

Post by BenR »

Hi Rod,

Thanks for the details analysis and explanation and also bearing with us. I'm looking into it now and hopefully will have a solution for you ASAP.

Just so you're aware the component source files are available in the wiki so if you ever need to make a change to a component you can do so but obviously we also need to know about problems so we can do an official fix for everyone. Any changes you do make can simply be reverted if required by using the library updates.

Looking at the problem it appears that we are correctly addressing for Bank0 already, 14 and 15 are the output latch registers used to write values to Port A and B. Writes to the GPIO registers 12 and 13 forward the write to the LAT register so it's effectively the same thing.
Screenshot 2026-06-18 095336.png
Screenshot 2026-06-18 095336.png (77.99 KiB) Viewed 122 times
I'll have a dig and see if I have one of these displays somewhere to do some testing.

BenR
Matrix Staff
Posts: 2232
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 615 times
Been thanked: 807 times

Re: Component: LCD SPI (MiniClick) (Alphanumeric)

Post by BenR »

Looking at your project you have a C code icon near the top of your program, this is not required and could be causing issues.

You could also maybe try disabling the call to the other SPI while you are debugging the screen to see if that can help as it's sharing pins with the display component.

I've compared the display SPI settings with the IO expander component settings and they seem to match up and so should be working fine but if you like you can try altering these and see if that helps.

To do this click on View -> Component Debugger and check the Expose full component tree option.

Using the drop down menu at the top of the properties window, In the LCD display find the cal_spi component as shown here.
Screenshot 2026-06-18 100735.png
Screenshot 2026-06-18 100735.png (10.09 KiB) Viewed 117 times
Then try adjusting the properties in the Options section.

Maybe try Clock Phase -> Leading edge

Idle low for the clock already looks to be correct and sample point is for read back.

Let us know if this makes a difference and if it does I'll update the components so this is the default.

Post Reply