Menu

PIC DMA, and Array storage location in the PIC

Jim Henson
2021-07-13
2021-07-16
<< < 1 2 (Page 2 of 2)
  • Jim Henson

    Jim Henson - 2021-07-15

    Thanks!

     
    • Anobium

      Anobium - 2021-07-15

      Saves a lot of RAM using the Table approach.

      But, you could use the the Sin() table to load an Array which could be updated via some maths function.

      So, there are two options and they both have merits.

       

      Last edit: Anobium 2021-07-15
  • Jim Henson

    Jim Henson - 2021-07-15

    When transferring data from the table to memory, what points the destination to program flash vs GPR Ram?

     
    • Anobium

      Anobium - 2021-07-15

      Table data is Progmem reference data. So, it cannot go direct to RAM. Table data can be told to create the reference data in eeprom.

      To load into RAM. You read the table, and copy into RAM. Like you did using an array.

       
  • Jim Henson

    Jim Henson - 2021-07-15

    I believe that is how the DAC references the data.

    I'm asking what points this process to the program flash vs GPR Ram:
    'Load table
    Dim TableLoad, WaveTableSize as word
    TableLoad = 0 'The address to return the size of the table
    readtable Wave, TableLoad, WaveTableSize 'Need to read table to ensure compiler load into PROGMEM

    Thanks, Jim

     
    • Anobium

      Anobium - 2021-07-15

      I believe that is how the DAC references the data.

      What are you referring to ?

      I'm asking what points this process to the program flash vs GPR Ram:

      The compiler. And, as I said the options are 'Program Flash or EEProm' not 'Program Flash vs GPR Ram'.

      But, as your said 'program flash vs GPR Ram' I feel that I am not understanding the question. Please be explicit as this post https://sourceforge.net/p/gcbasic/discussion/579125/thread/aa536679df/#e131/556a/8aab/60ff explains how to set the Source Memory Region bit within DMAnCONx and I did not answer the question in that post.

       
  • Jim Henson

    Jim Henson - 2021-07-15

    Hey Evan,

    Thanks for the note:
    Memory Allocation - discusses the allocation of variables to RAM ( GPR, SRAM etc).

    Is that note in the GCB docs or help pages? I hadn't seen it before.

    Thanks, Jim

     
  • stan cartwright

    stan cartwright - 2021-07-15

    Very good. I doubt it works with uno 328 or lg328. I hate pics.

     
    • Anobium

      Anobium - 2021-07-16

      Stan - works exactly the same on AVR or LGT. :-)

      The big difference... some of the 18F's have a lot of RAM. :-)

       
  • Jim Henson

    Jim Henson - 2021-07-16

    Sorry for being unclear. I'm not asking about the DMA operation.

    In the Load Table process, what tells this code (below) to store the data, read from the table, into program flash PROGMEM instead of ram?

    'Load table
    Dim TableLoad, WaveTableSize as word
    TableLoad = 0 'The address to return the size of the table
    readtable Wave, TableLoad, WaveTableSize 'Need to read table to ensure compiler load into PROGMEM

    Thanks, Jim

     
    • Anobium

      Anobium - 2021-07-16

      The compiler. To be explicit the pre-processor.

      The options (as shown in the Help) are PROGMEM or EEPROM. RAM is not an option.

      Evan


      This shows the Data parameter to instruct the compiler to load into EEPROM.

      PROGMEM

      Table TestDataSource Store
      12
      24
      36
      48
      60
      72
      End Table

      EEPROM

      Table TestDataSource Store Data
      12
      24
      36
      48
      60
      72
      End Table

       
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.