[Solved] Stuck while trying to pass a buffer from spin to pasm and set rdfast to read from it.
pik33
Posts: 2,366
(First post deleted)
What I want is:
I have a buffer in Spin
byte line_buf[960]
I want to set rdfast to make a streamer to read from (first 64 bytes of) this buffer in a separate cog's PASM code
What I achieved so far is: the streamer reads something (and displays it) , but this is not my buffer.
To be continued tomorrow.
Comments
If you are wanting something like displaying a screen buffer as in VGA for example, then look at Chip's VGA example because the pasm code in cog does this without any "fluff".
This code doesn't care what the buffer is, but of course it has to manipulate it using a font. But you can use this concept for anything else. Just strip the extra blanks lines and sync code out - it's only a few lines.
Read to what? if you read to cog registers or LUT ram, you don't need the streamer. You can just use: (pass the address of the buffer as 3. parameter in coginit)
Or you setup the fast read with RDFAST and then read the longs with RFLONG, but this also does not use the streamer, only the FIFO.
The streamer is only needed if you want to stream the buffer to pins or DACs with a certain frequency.
Andy
I used Chip's code for HDMI spiral as a starting point but this is pure PASM thing. I wanted to declare and fill the (small, at the beginning) buffer in Spin, and then pass its address to Pasm code, starting from 64 bytes as it is the smallest chunk available for rdfast, and then display id (as a repeating pattern) on the screen
Now it displays 64 bit pattern as expected: vertical lines on the screen. I made it 1024 pixels wide and the streamer is set to 1-bit LUT so the pattern is 2-colors and repeats twice every line (64byte=512 pixels). This works. The problem is: it is not my buffer.
Now the plan is: to make the code as simple as possible and find an error, else post all the code here if error not found.
It works now. The conclusion: dont program a Propeller late at night. I still don't know what was wrong yesterday.
This is a working piece of code: