No announcement yet.

Storing data from the display

  • Filter
  • Time
  • Show
Clear All
new posts

  • Storing data from the display


    I'm unsure if this is the correct subforum to ask the question, please excuse me if it should have gone in the Software section. We've recently acquired a pair of PixxiLCD-13P2-CTP-CLB for testing, so far pretty happy with the result. We require now to read and write data with the Pixxi, and as far as I can tell we can't use the methods we were using with the Gen4-uLCD70DT to read / write data (into the uSD card or one of the unused Flashbanks).

    Checking the application notes, 4D-AN-00280 shows how to store text files in the Flash File Systems, but I can't see anywhere that anything text-based can be written directly from running code.

    Long story short: Is there any way to store data within the stock PixxiLCD-13P2-CTP-CLB through code? Or we'll need an external device?

    Thank you for your time

  • #2
    Since Flash looks more like a uSD without a file system with the additional need to erase before you rewrite, you can use the media commands to read and write to flash. So, I imagine you'd be using media_WrSector() and media_RdSector() to read and write strings.

    Note that on Page 12 of the datasheet you mentioned you can see constants generated by workshop that let you know where the unused parts of Flash begin.


    • #3

      Somehow I skipped over the media write functions. I'll give a spin and see if it works.

      Thanks for the quick reply.


      • #4
        Just a quick update, using the media functions I was able to write to and read data from the built-in flash.

        Thanks again for your help.


        • #5
          Hello again,

          Small question: How do I reuse a sector? While as per my previous comment I was able to store and retrieve data from the 11th sector of the inbuilt Flash chip, but writing again onto the same sector caused garbage data to appear. I'm using the media_SetSector, media_WrSector and media_RdSector functions, and I didn't use the media_Flush command, in case it was needed.

          Do I have to erase a sector before reusing it? How would I do that?

          Thank you for your time.

          EDIT: Hello yet again,

          After trying a few things, it seems that using (in my case, using sector 11)
          media_SetSector(0, 10);
          // Set sector again
          media_SetSector(0, 10);
          // Write to sector
          allows to successfully write new data into that sector. Unsure if that is how it's meant to be done, so confirmation would be appreciated.

          Thanks again.
          Last edited by BlauLas; 25 January 2021, 09:35 PM.


          • #6
            With Flash you have to erase a sector before you can reuse it.

            So for a sector erase, you'd use flash_Sector4Erase(). Note that sectors are erased in 4KB units, so if you tried to erase the 11th sector, you'd erase sectors 8 to 11


            • #7

              Thank you for the confirmation and extra info.