Using the Video Generator to Generate an Arbitrary Bitstream
Brian Fairchild
Posts: 549
in Propeller 1
I want to use the video generator to generate an arbitrary bitstream. I *think* I can do this by configuring the generator thus...
Vmode = VGA
Cmode = 0 (two colour, 32 bits/pixels)
Vgroup = (for example) 0
Vpins = (for example) 0000_0001 = P0 is my output pin
PixelClocks = desired speed
Frame clocks = 32 x PixelClocks
In WAITVID I then set Colors = xxxxxxxx_xxxxxxxx_xxxxxxx1_xxxxxxx0
I can then write my output stream, 32 bits at a time, to WAITVID in the Pixels value.
Each bit of my pixel value, as it is shifted out, will then cause one of the two lower bytes of Colors to be output to the pins, and because I've set only one pin active I just get the bit I'm interested in.
Vmode = VGA
Cmode = 0 (two colour, 32 bits/pixels)
Vgroup = (for example) 0
Vpins = (for example) 0000_0001 = P0 is my output pin
PixelClocks = desired speed
Frame clocks = 32 x PixelClocks
In WAITVID I then set Colors = xxxxxxxx_xxxxxxxx_xxxxxxx1_xxxxxxx0
I can then write my output stream, 32 bits at a time, to WAITVID in the Pixels value.
Each bit of my pixel value, as it is shifted out, will then cause one of the two lower bytes of Colors to be output to the pins, and because I've set only one pin active I just get the bit I'm interested in.
Comments
Just remember, you need to keep feeding it or it will repeat its frame. You can just feed it zeros if you want to, or you can just turn it off.
-Phil
I've used this sort of thing for driving unidirectional SPI, or controlling SDRAMs (4 colour mode though).