Can I do this?
Kye
Posts: 2,200
I need to do very high speed 8 bit parallel input.
I want to do (wrbyte ina, phsa)... and have phsa increment in tune to a clock.
However, I believe I cannot use ina as a destination. So what will happen?
I want to do (wrbyte ina, phsa)... and have phsa increment in tune to a clock.
However, I believe I cannot use ina as a destination. So what will happen?
Comments
Depends on how you have your parallel inputs. I have done it this way before.....
The instruction (if compilable) would probably write the ina "shadow register" value to the address.
Aren't the phsa and phsb counters directly readable and writable from each cog? It appears so to me, according to page 285 of the manual. I have no experience with those counters, so tell me if I am just being ignorant.
Yes, they are and can be used as an index for wrbyte data, phsa for example and Kye is probably doing something like that.
You can set up something like this code fragment to read pins and send data to a buffer.
There are optimizations for short bursts or specific behaviors on P0-8.
Cheers.
--Steve
BIG Caveat! I knew there was a problem but forgot what it was:) As a good friend reminds me, this would write a byte to every fourth address because PHSA increments every clock tick regardless of FRQA. So any data read would use 4x memory space and would have to be reassembled into a contiguous stream.
What is the source of the video that you are trying to capture? I worked on a project a few months ago where I was capturing from a 640x480x60Hz VGA signal. I couldn't capture the whole signal because of RAM issues and the 496 long limitation but if I recall correctly, I could capture three sections of video per scan line totaling about 80 pixels per line. My application required that each scan line could have a different capturable area so that took up a lot of code space but if you had an always defined region, you could capture more pixels.
I needed to capture every pixel in the regions that I was capturing so what I ended up doing was making two chunks of code. The first grabbed the pixels and stored them in COG RAM in successive locations. I'm already fuzzy on the pneumonics of parallax assembly after not using it for a few months but that code looked roughly like this:
mov storeLocation+0,ina
mov storeLocation+1,ina
mov storeLocation+2,ina
...
The other chunk of code wrote them to HUB RAM in the proper location:
wrword hubLocation, storeLocation+0
add hubLocaion, #2
wrword hubLocation, storeLocation+1
add hubLocation, #2
..
The main flow of the program was made possible through self-modifying code so I would be backing up the mov instruction from the first section and replacing it with a jump back to the main routine at the point that I needed to stop capturing. The instruction would then be restored. The second routine would simply have the add instruction replaced with the new hub address that was needed. At the end of the scan line, it would restore that location too.
Linus Akesson used 8 IO-Ports for fast intercog-communication in the turbulence demo.
I did not analyse this in detail. But maybe his code gives some new ideas.
best regards
Stefan
Quote from the manual
"After boot up, any I/O pins can be used by any cogs at any time since I/O pins are one of the common resources. It is up to the application developer to ensure that no two cogs try to use the same I/O pin for conflicting purposes during run-time."
What about using good old 4c4007 (data sheet it). 1Meg x 4 dram.
I would make an entire prop be a dram controller.
Using two of these dram chips would give you a 8 bit bus. After the first dram chip, the addressing/read/write is parallel-able.
8 bit bus 1 meg. using 2 chips from a edo 72 pin simm.
Is this the reason the font characters are interleaved in the ROMs memory?
See attached pdf schematic.