Volhout Guru
 Joined: 05/03/2018 Location: NetherlandsPosts: 4722 |
Posted: 06:03pm 04 Feb 2025 |
|
|
|
Hi Peter,
Saw your PM, and will do a bit of reading, although I have an idea how they use it from looking at the code, and knowing how video is made.
I am not certain how the C environment assembler works, but what I would do is:
1/ I think the code is fast enough, and there is plenty of room. I would re-write the code to avoid .wrap and .wrap target (replace .wrap with a JMP 16 (or JMP 20). That makes it independent of the assembler of the VGA code that uses WRAP for timing accuracy.
2/ simply paste the I2S mnemonics right after the VGA code. Do not configure anything yet. Assemble the stuff (compile a VGA project) and see if it runs. If it runs, the current implementation does not use any of the PIO memory or PIO0 after location 16. You can of coarse also use location 20...
If it does not run, stop the project. PIO is operating outside it's program area (maybe for timing, since locations 16..31 are default filled with 00 which is JMP 0).
3/ assuming all is well, This could then be part of your generic setup, in all VGA product. All VGA binaries would have I2S build in. Only when OPTION I2S is found it will assign GPIO pins (configure the state machine) and start the state machine.
Volhout
Oops..you cannot change .wrap in JMP since it violates the BCLK.. -> plan B Edited 2025-02-05 04:07 by Volhout |