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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks!
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
When transferring data from the table to memory, what points the destination to program flash vs GPR Ram?
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.
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
What are you referring to ?
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 - see https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/DMA_Solutions/18F27Q43_NCO_TABLE_DMA_DAC.gcb
This is the edited DEMO - a great example ! Thank you.
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
It is in the Help now ! An updated version. Anyone can edit/improve now. :-)
http://gcbasic.sourceforge.net/help/_variable_memory_allocation.html
Very good. I doubt it works with uno 328 or lg328. I hate pics.
Stan - works exactly the same on AVR or LGT. :-)
The big difference... some of the 18F's have a lot of RAM. :-)
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
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