Page 1 of 1

Issue with Displaying Custom Characters on LCD

Posted: Sat Aug 24, 2024 12:35 pm
by bazkhf
Dear Flowcode Community,

I am experiencing an issue with storing and displaying custom characters on a 16x2 LCD using Flowcode. I attempted to use the RAMWrite function to store a character in index 1 and display it using PrintAscii(1), but the characters never appear.

Details of RAMWrite:
Modifies the internal memory of the LCD to allow for up to 8 custom characters to be created and stored in the device memory.

Parameters:

BYTE Index: Values from 0 to 7
BYTE d0 to BYTE d7
Return value: This function does not return a value.

Could you please provide a simplified example or a project file demonstrating how to correctly store and display custom characters using RAMWrite?

Thank you very much for your assistance!

Best regards,

Re: Issue with Displaying Custom Characters on LCD

Posted: Sun Aug 25, 2024 10:42 pm
by BenR
Hello,

You first need to define your custom character. For example.

BYTE Index: 0
BYTE d0 to BYTE d7: 0xFF,0xAA,0x55,0x00,0xFF,0xAA,0x55,0x00

Change the d0-d7 bytes as required for your custom character.

Next use the PrintASCII function with a parameter of 0 to print your custom character. The custom character remains in RAM and you can print it as often as you like using the PrintASCII function.

Other custom characters are doen the same way but with index 1-7 instead of index 0.

Re: Issue with Displaying Custom Characters on LCD

Posted: Tue Aug 27, 2024 6:16 am
by bazkhf
Hi Ben,

Thank you very much for your response and for explaining the steps to store and display custom characters. I followed the method you mentioned exactly, but unfortunately, it didn’t work for me.

I’ve attached the test file with this message for your review. When I ran the code, an error message appeared, but I couldn’t identify the cause. When I clicked on the error message, no error text was displayed.

I would appreciate it if you could help me figure out the issue and how to resolve it.

Thanks again for your continued support.

Best regards

Re: Issue with Displaying Custom Characters on LCD

Posted: Fri Aug 30, 2024 11:22 am
by BenR
Hello,

Looks like that should work ok. You don't need the RamWrite macro call inside the loop as you only need to specify your custom character once.

The custom characters may not simulate at the moment, I'll investigate this. but it should work ok on the hardware.

I didn't get an error so interested as to what that might be related to.

Have you tried on hardware at all?

Re: Issue with Displaying Custom Characters on LCD

Posted: Sat Aug 31, 2024 10:30 am
by bazkhf
Hi Ben,

Thank you for your advice and for clarifying the issue. I tested the code on the actual hardware, and I'm pleased to report that it worked perfectly!

It seems that the problem was indeed related to the simulation, as you mentioned. Removing the RAMWrite call from inside the loop also helped in improving the code.

I greatly appreciate your support and guidance. If I encounter any further issues in the future, I'll make sure to reach out to you. Thanks again for your help!

Best regards