Shop OBEX P1 Docs P2 Docs Learn Events
Using the Video Generator to Generate an Arbitrary Bitstream — Parallax Forums

Using the Video Generator to Generate an Arbitrary Bitstream

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.

Comments

  • That's going to work.

    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.

  • It does work. I have been using it as a 3 Mbaud serial output in JET Engine's serial output driver thing. It's on the OBEX, as JETVIEW1.ZIP
  • potatohead wrote:
    Just remember, you need to keep feeding it or it will repeat its frame.
    IIRC, it doesn't repeat its frame but uses whatever was in the src register from the last instruction executed before its time comes around. So feeding it all zeroes then ignoring it won't work for creating an idle condition.

    -Phil
  • Yes, I was unclear. Meant, either feed it zeroes during downtime, or shut it off.
  • What I did: just set OUTA on the pin(s) to high. That'll mask out the garbage video generator output.
  • [ Assuming high is benign - if not stop the video hardware ]

    I've used this sort of thing for driving unidirectional SPI, or controlling SDRAMs (4 colour mode though).
Sign In or Register to comment.