BRT Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the Bridgetek Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ Bridgetek Support

Please refer to our website for detailed information on all our products - Bridgetek - Bridging Technology

Author Topic: Bitmap handles for ROM fonts  (Read 7246 times)

kolyur

  • Newbie
  • *
  • Posts: 1
    • View Profile
Bitmap handles for ROM fonts
« on: December 27, 2023, 07:14:05 PM »

We're using a Newhaven 5" display (800x480) with the FT812. Host MCU is Parallax Propeller 2 with custom library. We are encountering situations where a certain area of text (displayed with CMD_TEXT) will appear garbled. That is, just pixelated junk on the screen where the text should be. Most of the time everything works fine. For a particular combination of MCU board and display, the problem might occur on 1 out of 10 power cycles, and it's always on one particular area of text. On a different MCU/display, the problem might show up elsewhere.

After some investigation I figured out that the problem has to do with the bitmap handles assigned to the ROM fonts. We are only using the built-in fonts in this application. The manual states that bitmap handles 16-31 are by default assigned to the corresponding ROM fonts, and this is how we address them in CMD_TEXT. When we see the garbled text problem, I determined that the font for that text command seems to have "lost" its handle. If I change the font for that text command, the problem goes away. Similarly, if I change a different (working) text command to use the problematic handle, then the symptoms start showing up on that object.

I found that if I run a display list at startup with the following:
Code: [Select]
repeat idx from 16 to 31
  CMD_ROMFONT(idx, idx)

which basically redefines all the font handles, then the problem is completed eliminated. I'm glad to have figured out a solution, but I don't understand this behavior since handles 16-31 should already be assigned. Elsewhere in the program I am using bitmap handle 0 to display a single image, and assigning one of the larger fonts to handle 1; other than that I am not touching the handles.

Any ideas on what I could be missing here?
Logged