Menu

Data block etc in GCBASIC documentation

2026-01-29
2026-01-29
  • Roger Jönsson

    Roger Jönsson - 2026-01-29

    Wouldn't it be nice to have info on Data Blocks in the documentation?
    Since Data Blocks with the right chipsupports storing 16bit/word data, it would be helpful if the pages on ProgramRead, ProgramWrite and ProgramErase (if applicable) were updated with this info too?
    And that the Data Blocks info page linked to ProgramRead etc?

     

    Last edit: Roger Jönsson 2026-01-29
    • Anobium

      Anobium - 2026-01-29

      The Data Blocks are in the latest help, see https://gcbasic.sourceforge.io/help/data.html If more is needed - can you provide me some words/example to add? I can do the editing here.

      but, do you want links from ProgramRead, ProgramWrite and ProgramErase or examples?

      and, do you want link from Data Blocks to ProgramRead?

      Should be

       
  • Roger Jönsson

    Roger Jönsson - 2026-01-29

    "An error has been encountered in accessing this page"
    Did you mean this?: https://gcbasic.sourceforge.io/help/_data.html
    If does not mention the term Data Block, which I figured was there for not the same as Data.

    The link to ProgramRead in ..._data.html points back to ..._data.html

    The Programread page can be found by searching. It says that Programread is limited to storing up to 14bit vlues, which is not always true anymore, right?

     
  • Anobium

    Anobium - 2026-01-29

    Did you mean this?: https://gcbasic.sourceforge.io/help/data.html Yes.

    Data Block is my nickname for it. it is really a DATA dataset.

    I will sort the link.

    Re the max value. It is dependent on the selected device. I can add this quick summary.


    Family Instruction Word Size Program Memory Word Width Maximum Value per Word (unsigned decimal) Hex Range Can store full 16-bit value (0–65535) in one word?
    PIC10 12-bit 12 bits 4095 0x000 – 0xFFF No
    PIC12 (baseline) 12-bit 12 bits 4095 0x000 – 0xFFF No
    PIC12 (enhanced mid-range) 14-bit 14 bits 16383 0x0000 – 0x3FFF No
    PIC14 14-bit 14 bits 16383 0x0000 – 0x3FFF No
    PIC16 (mid-range) 14-bit 14 bits 16383 0x0000 – 0x3FFF No
    PIC16 (enhanced mid-range) 14-bit 14 bits 16383 0x0000 – 0x3FFF No
    PIC18 16-bit 16 bits 65535 0x0000 – 0xFFFF Yes

    Quick Summary Table (most common cases)

    Family group Typical word size Max value you can store in one program memory word Equivalent to storing a full 16-bit number?
    PIC10 / baseline PIC12 12 bits 4095 (0xFFF) No
    PIC14 / PIC16 / enhanced PIC12 14 bits 16383 (0x3FFF) No
    PIC18 16 bits 65535 (0xFFFF) Yes

    Important Notes

    • PIC18 is the only 8-bit PIC family where you can directly store any 16-bit value (0–0xFFFF) in a single program memory word location.
    • On all earlier families (PIC10, PIC12 baseline, PIC14, PIC16, enhanced mid-range), you must split any value > 0x3FFF (16383) across two words if you need the full 16-bit range.
    • The values above apply when storing constants, lookup table entries, retlw literals, data/db directives, etc. — i.e., the largest number that fits in one program memory word.
     
  • Roger Jönsson

    Roger Jönsson - 2026-01-29

    Since you use the nickname, it would be good if searching for it leads to the Data page? I have been wondering about: -Why Data Block and not DataBlock??? Now: -Ahh. -Yes, of course. :)
    //
    This is what I meant:
    https://gcbasic.sourceforge.io/help/data.html
    "An error has been encountered in accessing this page." ...4. Error type: 404
    This works:
    https://gcbasic.sourceforge.io/help/_data.html

     
  • Anobium

    Anobium - 2026-01-29

    i will to try and add reference to DataBlocks.

    The naming of webpages is part a mega tool that I just use to ceate all the different formats of the Help. So, i cannot change the page URL.

     
  • Roger Jönsson

    Roger Jönsson - 2026-01-29

    I just wanted to make sure that we were talking about the same page.

     
  • Roger Jönsson

    Roger Jönsson - 2026-01-29

    BTW. Is there a problem using the 16bit data block to store 8bit data side by side? Say I have two 8-bit pictures. Can I put then separately in the program code, with one in high byte and the other in low byte (efficient use of the 16 bits)? Or should I combine them into words? Even if I would test this and find it working, it may still not be correct, so that's why I'm asking.

     
    • Anobium

      Anobium - 2026-01-29

      either way would work, I would think the picture after picture would be fastest. But, do test to validate performance.

       
      👍
      1
  • Anobium

    Anobium - 2026-01-29

    I have updated the Help check the online version tomorrow.

    :-)

     
  • Roger Jönsson

    Roger Jönsson - 2026-01-29

    Already updated! Great stuff! -More than I asked for!

     
    👍
    1

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.