Shop OBEX P1 Docs P2 Docs Learn Events
1 pin video, ntsc greyscale possible? — Parallax Forums

1 pin video, ntsc greyscale possible?

SpinHeadSpinHead Posts: 28
edited 2008-06-09 19:55 in Propeller 1
is it possible to generate greyscale images only, and only use 1 pin? I am very cramped for pins and have only 1 left on my spinstudio demo board, anything possible?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-07 18:21
    The PropCAM firmware modulates a single pin using the counter's DUTY mode to produce 4-bit grayscale images. However, these images are overlain on a color NTSC signal already being generated in a different cog. There's no reason you couldn't bit bang the whole thing, though, sync tips and all. You will need an appropriate voltage divider on the output to produce a 2V P-P signal with a 75-ohm source impedance. (This gets reduced to 1V P-P when driven into a 75-ohm load.) You will also need a cap from the output to ground to filter out the DUTY doody. Since there's no chroma subcarrier to worry about clobbering, the cap value isn't terribly critical. 0.001uF might be a good place to start.

    -Phil
  • ciw1973ciw1973 Posts: 64
    edited 2008-06-08 11:10
    It's not possible to produce greyscale using 1 pin, and as to generate a useful NTSC signal you need 3 different voltage levels - black, white and sync - it would appear that that the two output states of a single pin are not enough.

    However, it *is* possible to produce black & white NTSC output with a single pin by using a simple, and pretty clever technique exploiting the properties of I/O pins when they are set as inputs.

    You'll find details of this technique and a suitable circuit here and another example with a more in depth discussion here.
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-06-09 16:53
    @Phil: What horizontal resolution do you suppose you can achieve with that technique?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-06-09 18:16
    The horizontal resolution of the PropCAM is 128 pixels, so that's as far as I've taken it. But an unenlarged PropCAM image takes up only half a horizontal line. So you could, theoretically, get 256 pixels across. However, a 256 x 192-pixel image, four bits deep, would occupy 24576 bytes of RAM, which doesn't leave much. And, since that same pin also has to generate sync levels, you would not get 16 visible gray levels with my technique, since a zero gray level would also be the sync level. In fact, if you adnere to the NTSC standards, you'd get about 11 visible grays, although you could probably cheat a little on the sync levels and hope for 12. This could be alleviated by packing six 5-bit pixels into a long, instead of eight 4-bit pixels. But that would also increase RAM usage by 33%.

    There are a lot of tradeoffs, but if you're not too fussy about getting maximum image resolution or depth, I'm sure it can be done.

    -Phil
  • Ken PetersonKen Peterson Posts: 806
    edited 2008-06-09 19:55
    I guess if SpinHead doesn't come up with a 1-pin monochrome composite driver, I might just try it myself. Looks like an interesting challenge. Might be useful for some..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.