:-)
DMA would be faster as this uses no clock cycles. Set up the source as the progmem area and the destination as RAM.
DMA would be faster as this uses no clock cycles. Set up the source as the progmem area and the destination as RAM.
@Ralf. I have just taken your first post and put into AI. See https://github.com/GreatCowBASIC/Demonstration_Sources/tree/main/Time_Based_Task_Switcher_Solutions/Thallium%20-%20an%20AVR%20%20preemptiv%20%C2%B5RTOS Download the .MD ( it is a .MD format not .ADOC ) and edit this. AI recommended you add the following. ;-) a Getting Started section a Quick Example showing how to define tasks in GCBASI
I have updated the example code with point #6.
Any faster? I have documented the changes in the code. Sub MyISR If shoot1 = 1 then PORTE.1=1 // Replace Programread (@Pluck+Voice1pointer, DAC1DATL) by taking code from system.h - removes call // Remove sampleout Dim ProgmemAddress As Word alias TBLPTRH, TBLPTRL NVMCON1 = 0; Read operations ProgmemAddress = @Pluck+Voice1pointer TBLRD*+ // I am not sure what part you need... the high or low DAC1DATL = TABLAT TBLRD* DAC1DATL = TABLAT Voice1speedchanger=Voice1speedchanger + 256 Voice1pointer = voice1pointer...
DMA reads from progmem to RAM. That would be faster. I have another idea but I need to write some code that compiles.
Great news. Makes the bare metal solutions even easier!