It may be useful to step through the picozx81 code at https://github.com/ikjordan/picozx81/bl ... usound.cpp
A PIO state machine writes data to the I2S
A DMA writes sound data from a memory buffer to the PIO FIFO
When the DMA completes an interrupt occurs
In the DMA interrupt handler the address of a new memory buffer is written and the DMA restarted
The code uses two memory buffers. When the contents of one buffer is being read from the DMA and written to the PIO FIFO, the other is populated with the next group of sound bytes, generated by the ay8910 emulation. The buffers are switched when the DMA complete ISR fires
All of the code to do this can be found in picozx81 within emusound.cpp (I2S is defined)
PIO initialisation line: 291
Initialisation of I2S GPIO pins: line 324
Setting the PIO state machine clock frequency: line 331
Creation of the DMA: line 339
Code to start DMA transfer: line 139
DMA complete ISR handler: line 150
If you follow the instructions for download of picozx81 https://github.com/ikjordan/picozx81?ta ... e#building you will be able to build and upload the uf2 onto you Pimoroni VGA board. You can then step through the initialisation code.
A PIO state machine writes data to the I2S
A DMA writes sound data from a memory buffer to the PIO FIFO
When the DMA completes an interrupt occurs
In the DMA interrupt handler the address of a new memory buffer is written and the DMA restarted
The code uses two memory buffers. When the contents of one buffer is being read from the DMA and written to the PIO FIFO, the other is populated with the next group of sound bytes, generated by the ay8910 emulation. The buffers are switched when the DMA complete ISR fires
All of the code to do this can be found in picozx81 within emusound.cpp (I2S is defined)
PIO initialisation line: 291
Initialisation of I2S GPIO pins: line 324
Setting the PIO state machine clock frequency: line 331
Creation of the DMA: line 339
Code to start DMA transfer: line 139
DMA complete ISR handler: line 150
If you follow the instructions for download of picozx81 https://github.com/ikjordan/picozx81?ta ... e#building you will be able to build and upload the uf2 onto you Pimoroni VGA board. You can then step through the initialisation code.
Statistics: Posted by exiles — Fri Oct 25, 2024 10:44 am