Shop OBEX P1 Docs P2 Docs Learn Events
Yet another video proposal — Parallax Forums

Yet another video proposal

kwinnkwinn Posts: 8,697
edited 2011-04-25 07:50 in Propeller 1
@Leon, You seem to be the most knowledgeable person on the forums when it comes to FPGA's and CPLD's. Any thoughts on the best chip to do what I have outlined below?

After reviewing the prop video documentation and looking at several approaches to producing higher resolution and greater color depth video I have to agree with Leon that a small FPGA or CPLD is the way to go. Yes, it could be done with counters, latches, and the memory chip, but that would involve more chips, cost more, and be less flexible.

A single cog to produces the horizontal and vertical sync signals along with a dot (pixel) clock. That leaves the other 7 cogs free for communications and updating the video RAM. Having the prop generate those signals also makes synchronizing the video and memory writes simpler.
The dot clock increments the Scan counter (20-24 bits?) in the FPGA/CPLD that is output to the RAM address pins during the video scan time.
The Scan counter DotClk is gated by the Horizontal and Vertical sync signals so that video data is stored sequentially in RAM. There are no gaps in the video data.
The Address counter and R/W signal is output to the RAM address pins during the Horizontal and Vertical sync times so the propeller can write new data during that time.
The Address register high and low 12 bits can be loaded from the data bus.
The 12 bit value on the Propeller to FPGA/CPLD data bus can be added to the Address register in order to get to the next line of video data.
A 12 bit data bus and 3 control lines (A0, A1, R/W) control the FPGA/CPLD and write through to the RAM.

Comments

  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-24 15:59
    Interesting idea. It does seem a bit more expensive, and complicated than using a prop with four latches, 2 buffers, and a resistor DAC. Though you still have my attention (this does after all seem to be very similar in function to the circuits I use).

    I am very interested to see the end result, especially if it can be done at a lower cost (of which I am quite skeptical at this point).
  • kwinnkwinn Posts: 8,697
    edited 2011-04-24 17:01
    Interesting idea. It does seem a bit more expensive, and complicated than using a prop with four latches, 2 buffers, and a resistor DAC. Though you still have my attention (this does after all seem to be very similar in function to the circuits I use).

    I am very interested to see the end result, especially if it can be done at a lower cost (of which I am quite skeptical at this point).


    Being a video generation circuit it is in some ways similar to yours. It was inspired by the design of a terminal that used a Z80 (I think) or similar microprocessor as a smart counter to generate the address scan for an 80x24 character terminal. It only had to scan through memory and present 80 characters per scan line to a latch so even an early 8 bitter could do that.

    In pure parts cost I am sure the FPGA/CPLD is more expensive than four latches, 2 buffers, and a resistor dac. No reason this design couldn't use a resistive dac., and with a small FPGA/CPLD (around $10.00) I can interface that prop to the memory with a single chip (less PCB real estate and fewer parts to mount).The FPGA/CPLD also provides additional functionality and reduces the load on the prop to the point that 1920 x 1080 might (stress on the might) be possible.

    PS - As for being more complicated, programming the chip certainly is more work initially, but less in the long run.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-24 18:02
    Ok definitely takes less space. as to the cost the latches each cost $0.11, the buffers are $0.09 each, and the resistors are about 2 for $0.01. I can see some benefits in your approach in the way of reducing component count. Good luck on the super high resolutions (I hope you can do it, I think we can all use it), as most have difficulty with anything above about 60MHz in FPGA.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-24 18:07
    Sorry about that the Buffers are $0.18 each, and the latches $0.20 each.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-04-24 19:04
    This looks a fascinating idea. If it works there would be many optimisations - vary the number of props, different memory chips, external logic chips vs FPGA.

    Back of an envelope, if you had 640x480 and went for 5 bits per color, that is 15 bits. 640x480 is 307k so that would fit in two 512k x8 chips, or (if available) one 512k x16 bit chip. If it works you could then go for more bits per color. But 5 would look pretty good though and it would also be well within the accuracy of a R 2R network so no clever DAC chips would be needed.

    I researched this a few months back and where I got stuck was finding a suitable ram chip. I think it needs to run at 25Mhz for VGA? So ?30ns, ?25ns or 10ns to be sure?? Price vs speed is a factor.

    And then there are delays within any support chips. eg if you used 74xx counter chips, are they ripple binary count or are the outputs synchronous? Or could the propeller do the counting fast enough - eg use a latch for each row but have enough lower bits to do one row directly from propeller pins.

    This is a fascinating topic!
  • AleAle Posts: 2,363
    edited 2011-04-24 22:46
    This was done before :), at least 3 times. (BTX did a Altera MAX2 version and I did 2 with Xilinx CPLDs pPropCPLD).

    Some notes:

    . Altera version: a monolithic video DAC was used, no R2R needed. It has 512kx16 SRAM and works :) A EPM1270 was used but the code fits in a EPM570 too.

    . Xilinx versions:

    I used a XC9572 + a XC9536 with 512kx8 SRAM. The code can only produce an image as there are not enough macrocells for the propeller interface :(
    The second prototype has the same limitations but I used a XC95144.
    Btw, I used a similar approach with these two prototypes :).

    I also did a FPGA version :), with SDRAM and a XC3S200 :), all code fits !
    http://forums.parallax.com/showthread.php?119689-A-new-dimension-in-Propeller-marriages-pPropFPGA&highlight=pPropFPGA

    Notes: You need a latch for the video data. unless you only write to RAM during blanking. (a '573 will do)

    Edit: What I wanted to say was: prototype the code first and simulate it ! (I use Icarus Verilog+GTKWave), then grab the tools from your preferred vendor and (fix the code) and see which device you need... Xilinx CPLD are incredibly small :(, (but cheap), Altera's are bigger and way more versatile and expensive (they are FPGAs). Lattice has also FPGA-like CPLDs. (Or ask for one of the unpopulated boards from me :) ) (I'd recommend a XC3S50AN, it is a FPGA, it has plenty of LE, it only needs 2 power supplies and it is non-volatile, and costs some $8 copared to the $16 for the EPM1270).
  • jazzedjazzed Posts: 11,803
    edited 2011-04-24 22:49
    Ale wrote: »
    This was done before :), at least 3 times. (BTX did a Altera MAX2 version and I did 2 with Xilinx CPLDs pPropCPLD).
    "Nothing new under the sun." :)

    Nutson did something like this (along with a Propeller COG execution unit!) in an FPGA. That man is brilliant - words I don't use often.
  • AleAle Posts: 2,363
    edited 2011-04-24 23:05
    jazzed... I just wanted to present a couple of examples... nothing more (and the failed experiments and what I learned from them....).
    I also wanted to code a COG into a FPGA... and thus learned Verilog... I coded several processor cores... they are a lot of fun, not very prop related, though. A COG needs loads of logic...
  • kwinnkwinn Posts: 8,697
    edited 2011-04-24 23:10
    Ok definitely takes less space. as to the cost the latches each cost $0.11, the buffers are $0.09 each, and the resistors are about 2 for $0.01. I can see some benefits in your approach in the way of reducing component count. Good luck on the super high resolutions (I hope you can do it, I think we can all use it), as most have difficulty with anything above about 60MHz in FPGA.

    David, you are probably right about my idea having problems with the FPGA at the higher data rates. I spent some time looking at low priced chips and could not find much that was faster than 10ns. The only workaround I can see is outputting 2 pixels to latches and displaying them in sequence. How ironic.

    As for the cost difference, I am not too concerned about having the board cost a few dollars more if it gives me some flexibility with regards to resolution, communications, and on board software. In any case replacing one of the two props, the latches, and the buffer chips with an FPGA for a few dollars more seems like a reasonable tradeoff.

    For my own use I have two goals to meet with this board if I can make it work.

    The first is as a standalone graphical data display driver at the end of an RS485 line, which requires the prop to have enough processing power left over for serial communications, to format the received data for display, and to run a touch screen or keyboard.

    The second is to have it attached locally as the graphical display and control console for an automation system.
  • kwinnkwinn Posts: 8,697
    edited 2011-04-24 23:52
    Dr_Acula wrote: »
    This looks a fascinating idea. If it works there would be many optimisations - vary the number of props, different memory chips, external logic chips vs FPGA.

    Back of an envelope, if you had 640x480 and went for 5 bits per color, that is 15 bits. 640x480 is 307k so that would fit in two 512k x8 chips, or (if available) one 512k x16 bit chip. If it works you could then go for more bits per color. But 5 would look pretty good though and it would also be well within the accuracy of a R 2R network so no clever DAC chips would be needed.

    I researched this a few months back and where I got stuck was finding a suitable ram chip. I think it needs to run at 25Mhz for VGA? So ?30ns, ?25ns or 10ns to be sure?? Price vs speed is a factor.

    And then there are delays within any support chips. eg if you used 74xx counter chips, are they ripple binary count or are the outputs synchronous? Or could the propeller do the counting fast enough - eg use a latch for each row but have enough lower bits to do one row directly from propeller pins.

    This is a fascinating topic!

    Dr_Acula, after hunting down various CPLD's, FPGA's, SRAM's, SDRAM's, and other such goodies I can see that any design is severely constrained by the chips that are available.

    First and foremost, none of the reasonably priced CPLD's or FPGA's seem to be fast enough for 1080P (1920x1080 @ 60Hz). I would love to be proven wrong on that point, so if anyone can do so please, please, please, do so.

    Second, RAM seems to come in multiples of 8 bit widths while video out is in multiples of 3. Yes, I know there are some 9, 18, and 36 bit wide chips but they are either too slow, too expensive, or impractical to use. That leaves a Look Up Table (an additional chip), wasting a bit, or giving an extra bit to some color.

    Currently I am proposing 1280x1024 the max resolution for 4x3 ratio displays, and 1280x720 (720P) the max for 16x9 ratio (wide screen) displays. All these resolutions would have 256 colors per pixel available with a resistor dac of 3, 3, 2 bits. I am wondering if it is possible to provide 1080P (1920x1080@60HZ) at a reduced color palette (16 colors) by treating each 8 bit pixel as 2 4 bit pixels.
  • kwinnkwinn Posts: 8,697
    edited 2011-04-25 00:27
    Ale wrote: »
    This was done before :), at least 3 times. (BTX did a Altera MAX2 version and I did 2 with Xilinx CPLDs pPropCPLD).

    Ale, any information you can PM to me would be greatly appreciated. Although the requirements in this case seem to be fairly simple, FPGA and CPLD programming is uncharted territory for me. The last chips I dealt with were the 16-something PAL chips way back when. At this point I have no desire to climb another learning curve so any help you (or any one else) can provide would be greatly appreciated. I would like to make this an open source/open hardware project for the benefit of everyone.
  • LeonLeon Posts: 7,620
    edited 2011-04-25 05:08
    The low-cost Xilinx Spartan-6 can run at 500 MHz and can input, process, and output 1080P HDMI at 24 bits/pixel, using DDR2 RAM. See the Digilent Atlys board:

    http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,836&Prod=ATLYS

    For basic graphics a much cheaper device could be used, with less RAM.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-04-25 05:42
    Something that was flagged up when I was playing with Xilinx CPLDs on a DracBlade was the programming interface was on a parallel port. These are not on the newer PCs and the propriatry USB interfaces were on the high side of extortionate.
  • LeonLeon Posts: 7,620
    edited 2011-04-25 05:46
    Cheap Chinese clones are available on Ebay. I have Xilinx USB cable and Altera USB Blaster clones, they work very well.
  • AleAle Posts: 2,363
    edited 2011-04-25 06:03
    I second the get a cheap clone from ebay... I also got a byteblaster compatible (it even looks like the original!) :)
  • LeonLeon Posts: 7,620
    edited 2011-04-25 06:10
    My Xilinx one looks identical to the original!
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-25 06:31
    kwin wrote:
    That leaves a Look Up Table (an additional chip), wasting a bit, or giving an extra bit to some color.
    Interesting. Even though I have not yet posted that block diagram, I am using the 16th bit in the MuAmi by having a second frame buffer of equal size to the first that is loaded with sprite data as it will be displayed, if the high bit is set in this buffer the sprite is visible and a through an AND is used to control which set of 74HCT244s the data goes through to reach the screen. I am aware that this can be a terrible waste of memory, though it is fast.

    In my own experiments I have found that the most expensive component is the SRAM, and the cheapest CPLDs that I can find that would fill the job are 2 to 3 times the price of all 4 SRAM chips combined.
    Leon wrote:
    The low-cost Xilinx Spartan-6
    For a Spartan-6 that would fit the bill, you are talking about at least $18.00 (USD), and probably closer to $30.00 (USD), not to mention of the cost in correctly soldering BGA, not so 'low-cost'.
  • LeonLeon Posts: 7,620
    edited 2011-04-25 06:51
    BGA assembly doesn't cost any more than any other device in production quantities. They are easier to deal with than QFP parts.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-25 06:56
    Leon:
    True in production quantities, not so true for one off home built devices. I often have to remove, and replace BGA devices on the boards I make because one or more balls are not attached.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-25 06:59
    A should note that I use a cheap high temp oven (I think it was made as a toaster oven) to do my SMT soldering, as I think many hobbyist do (because it is easy).
  • LeonLeon Posts: 7,620
    edited 2011-04-25 07:06
    I can get BGA prototypes assembled quite cheaply, including X-ray.
  • davidsaundersdavidsaunders Posts: 1,559
    edited 2011-04-25 07:50
    Last post on BGA soldering from me, must return the thread to its topic.

    Leon:
    Maybe so, though to do this at home by most hobbyist is more difficult, buying the blank two sided board easy (and cost almost nothing) masking, and etching the board, quick and easy, drilling vias and holes for through hole devices, easy, and soldering QFP and QFN components (in an oven) easy. Having to check BGA components not so easy.
Sign In or Register to comment.