Shop OBEX P1 Docs P2 Docs Learn Events
P8X32A and VGA — Parallax Forums

P8X32A and VGA

megaionstormmegaionstorm Posts: 178
edited 2013-10-04 06:46 in Propeller 1
I have a idea and i wan't create a 640X480 pixel vga picture with the p8x32a.
Each pixel 8 bit color value and double buffering.

Hardware:
P8X32A, 5 X K6X4008C1F-DB55 512KByte Static RAM.

The graphic data should be stored in the 2.5MByte RAM Memory.

2 pages X 640 X 480 X 3 Bytes = 1843200 bytes

The addresslines should be accessed through 74HC595 shift registers.

What do you mean ?
«13456710

Comments

  • RaymanRayman Posts: 14,662
    edited 2013-05-18 04:46
    I contemplated doing something like that for a while...
    But, I didn't see how to update the image while showing it, for one thing.

    What I wound up doing eventually is using the SSD1963 and a VGA DAC to make the "VGA Graphics Shield".

    Still, this other way would be a fun project...
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 06:16
    Why use the VGA Graphics Shield (VGS) the ADV7125 and not the ADV7123 ?

    I think the ADV7123 looks good for my idea !
  • RaymanRayman Posts: 14,662
    edited 2013-05-18 07:21
    If I remember right, they are about the same, except ADV7125 allows 3.3 V for Vdd and the other needs 5 V...
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 07:48
    The ADV7125 has 8 red, 8 blue and 8 green signal lines.

    How do you handle this with one p8x32a ?
  • RaymanRayman Posts: 14,662
    edited 2013-05-18 08:28
    I used the SSD1963 to output 24-bit color frames to the ADV7125...
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 09:19
    Output resolution ? 800X600 ?
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 09:41
    But, I didn't see how to update the image while showing it, for one thing.

    http://www.allshore.com/pdf/solomon_systech_ssd1963.pdf

    Page 17, 7.1.5 Tearing Effect Signal (TE)
    If the MCU writing speed is slower than the display speed, the display data should be updated after the LCD controller start to scan the frame buffer. Then the LCD controller will always display the old memory content until the next frame.
    However, if the MCU is faster than the LCD controller, it should start updating the display content in the vertical non-display period (VNDP) to enable the LCD controller will always get the newly updated data.
  • RaymanRayman Posts: 14,662
    edited 2013-05-18 10:04
    The VGA output resolution is 640x480. It can do 800x480, but it's tricky and monitor dependent.

    Updating the image on SSD1963 is no problem, I've got example code on my website...

    What I meant was that I didn't see how to update the memory very fast using external ram chips, like in your top post...
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 11:26
    A p8x32a has eight cogs.

    Is it possible one cog read data from a ram chip and a second cog writes data to a second ram chip ?

    At the same time ?
  • RaymanRayman Posts: 14,662
    edited 2013-05-18 12:02
    Yes, that might be a way to do it. Essentially double-buffering.
    Like I said, I thought about this for a long while, but it just seemed very complex...
  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-18 12:19
    A P8X32A has 8 cogs, but only 32 I/O pins, not all of which are freely available all the time. Each RAM chip requires address and data lines as well as a few control lines. If you multiplex these lines, you slow the whole process down (reading and writing) and probably require additional hardware (for address latches and tri-state buffers). If you use serial I/O to save pins, that slows things down further. There are some serial RAMs now that handle 2 or 4 bits at a time and are pretty fast. The Prop1 doesn't have the specialized instructions that would be needed to run these at full speed.
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 15:09
    That's why i think not to use:

    Hardware:
    P8X32A, 5 X K6X4008C1F-DB55 512KByte Static RAM.

    but

    Hardware:
    2 P8X32A, 2 X DS1270 16Mb Nonvolatile SRAM
  • Mike GreenMike Green Posts: 23,101
    edited 2013-05-18 15:45
    The DS1270 has 21 address lines plus 8 bidirectional data lines plus a couple of control lines (at least 2). That's a total of 31 and the P8X32A only has 32 lines of which some are not available during boot. As I mentioned, you could use only a portion of the address space. You could use external address latches or counters like the Hydra memory expansion board did. There are all sorts of possibilities, all of which make things more complex and slow things down. There were plans originally for a 64 I/O pin version of the Prop 1 which would have been great for this sort of application, but that never came to be.
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 16:02
    The day will come and prop2 is released !
  • jmgjmg Posts: 15,173
    edited 2013-05-18 17:48
    Hardware:
    2 P8X32A, 2 X DS1270 16Mb Nonvolatile SRAM

    That DS1270 is seriously expensive and also slow.

    You have not mentioned how quickly you need to update the RAM ?

    It is hard to beat the SSD1963 Rayman has already mentioned, as it has RAM included, and of a useful width.

    Any other solution will chew a lot of PCB space, and power.
    eg If you want 24b colour that is a lot of data-bus routes, and 3 x 8 b or 2x 16b chips, or 1 x 32b chip.

    The 25MHz VGA scan is also above a Prop 1, without hardware assist, - adding something like a loadable-counter, for the X axis would be needed.

    Once you have a loadable X counter, and lots of SRAM, you are best to bump into SDRAM territory, as that is pretty much what you are building.
    Many new SDRAM offer full page burst, and if you choose one with a full page of > X scan (eg 1024), then your hardware simplifies a lot.
    For most uses, 16 bit Colour will be enough, and that can save a lot of PCB routing.
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-18 18:56
    JMG, i think about your comment.

    Yes, the DS1270 is to slow !

    How should i manage the 16 bit colour ? How many bits for each colour ?
  • jmgjmg Posts: 15,173
    edited 2013-05-18 19:10
    How should i manage the 16 bit colour ? How many bits for each colour ?

    Follow what is already done ?
    http://en.wikipedia.org/wiki/Color_depth
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-19 03:36
    SDRAM, something like this MT48LC32M16A2 – 8 Meg x 16 x 4 banks ?
    http://download.micron.com/pdf/datasheets/dram/sdram/512MbSDRAM.pdf
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-19 12:41
    I have searched a description about a loadable X counter.
    But don't found something usefull and no example schematic about it !
  • jmgjmg Posts: 15,173
    edited 2013-05-19 13:03
    I have searched a description about a loadable X counter.
    But don't found something usefull and no example schematic about it !

    I think this thread has some examples :
    http://forums.parallax.com/showthread.php/137266-Propeller-GUI-touchscreen-and-full-color-display

    For the SDRAM, you look for one with a full-page burst and size, of at least your X axis, as they then have a loadable X counter.
    Probably easiest to allocate (eg) 1024, and simply not use a portion of the count.
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-19 16:38
    For the SDRAM, you look for one with a full-page burst and size, of at least your X axis, as they then have a loadable X counter.
    Probably easiest to allocate (eg) 1024, and simply not use a portion of the count.

    Please take a look.
    Can i use one of this two ?
    http://uk.farnell.com/amic/a43l0616bv-7f/memory-sdram-16m-50tsop/dp/1907101?Ntt=A43L0616BV-7F
    http://uk.farnell.com/amic/a43l2616bv-7f/memory-sdram-64m-54tsop/dp/1907102?Ntt=A43L2616BV-7F
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-19 17:01
    There may be some things we can do with the propeller and those ram chips that haven't been explored yet.

    The chip can run to 143Mhz (6ns) and a lot of ram experiments have been done with 55ns ram chips (or even slower with serial ram). At the end of the day, a VGA output is a bunch of digital pins toggling up and down and even 3 bits per color would give a lot more color combinations. 16 bits would give a very nice color space.

    Thinking aloud, either an external clock or the propeller could handle the timing. The chip will be dumping out data for each row on the display, but there is lots of spare time between each row and at the end of the screen for the propeller to send data to the ram chip.

    The experiments with the touchscreens show where the limits are, and for displaying a static display things should be fine. Where one pushes against the limits is playing movies, and the limiting speed factor there is the rate you can get data off an SD card, not any display factors.

    If one had a ram chip (or chips) with more memory than one screen, then you can store sprites and move them around in the ram chip as needed. This is how we got Pacman working on a touchscreen, and approx 1/4 of the ram was for the active display and about 3/4 was for sprites and other data.

    That ram chip A343L0616BV-7F has 16 data lines and 9 address lines and some control lines. It may be necessary to move data in with two 8 bit latches as there might not be enough propeller pins but that is ok.

    re
    How should i manage the 16 bit colour ? How many bits for each colour ?

    On the touchscreen it is RRRRRGGG_GGGBBBBB ie 5,6,5 bits which gives a little more weighting to the green as the eye is more sensitive to green. Both myself and AverageJoe have code to translate bitmaps and jpegs into this format.

    Intriguing possibilities...
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-19 17:40
    Is there a website about this pacman project ?
  • jmgjmg Posts: 15,173
    edited 2013-05-19 17:44
    Dr_Acula wrote: »

    That ram chip A343L0616BV-7F has 16 data lines and 9 address lines and some control lines. It may be necessary to move data in with two 8 bit latches as there might not be enough propeller pins but that is ok.

    Intriguing possibilities...

    SDRAM are getting cheaper all the time, and using the Full page burst per line does make this simpler, but you need a page size of >= the Pixel count, to avoid needing a re-load.

    The 16Mparts quoted above are smaller, and the data is vague, but says this
    3. The full column burst (256bit) is available only at Sequential mode of burst type.
    which sounds like they meant to say 256 clocks for Full Page mode.

    As parts get larger, that Clock count per Full page increases, and that number will determine which part you need.

    Likely there will be plenty of extra memory :)

    Halving the memory width usually doubles that Clock count, so it may be an interim solution to find a 1024 x 8 and use 2, while you wait for the prices of the N x 1024 x 16 to come down. Google suggests 512M is needed to get 1024 x 16, but there are some 128M ones with 1024 x 8
    ( or, you could design with 512 x 16, and move to 1024 x16 later )


    eg IS42S16800B-7TLI ISSI DRAM Chip SDRAM 128M-Bit 8Mx16 3.3V 54-Pin TSOP-II 864 : $2.2499
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-19 17:57
    Is there a website about this pacman project ?

    and the thread http://forums.parallax.com/showthread.php/137266-Propeller-GUI-touchscreen-and-full-color-display

    There is code in that thread in propeller pasm to handle converting a bitmap to a 16 bit format. Initially we started off doing the conversion on a PC using other programming languages, but in the end it was easier to do it on the propeller. So we just store standard .bmp files on an SD card and then do the conversion once when the data is moved from the SD card to the external ram.

    I need to brainstorm this with averagejoe as well, as I think your ram chip you found could greatly simplify driving the touchscreen, as we could use the burst mode rather than the five 74HC161 counters.

    There could be some synergies between driving a VGA display directly with a ram chip, and with driving a touchscreen. Both have the same problem - dumping large amounts of 16 bit data out in a short space of time (you can't dump it from a propeller directly as the propeller ram is not big enough for a screen of pixels). So the driver for a touchscreen and a driver for directly driving a VGA display might be more similar than it would first appear.

    At 6ns, one might also even be able to think about driving a TV screen directly using a fast D to A converter.

    jmg said
    but you need a page size of >= the Pixel count, to avoid needing a re-load.

    Excellent point.

    Ok, what is a pixel count? 640x480 to start with, so 640 pixels? Send one line, then do other things during the 'back porch" time. Would that work?
  • jmgjmg Posts: 15,173
    edited 2013-05-19 18:19
    Dr_Acula wrote: »
    I need to brainstorm this with averagejoe as well, as I think your ram chip you found could greatly simplify driving the touchscreen, as we could use the burst mode rather than the five 74HC161 counters.

    It depends on how many pixels you have in the Horiz Scan ?

    Looks like AS4C8M16S-7TCN 128M and AS4C16M16S 256M SDRAM have 512 clock full page shifts, and are 1: $1.63 & 1: $2.15 resp. in TSSOP II 54 - prices keep coming down :)
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-19 18:36
    1)
    Pacman looks very nice !

    2)
    MT48LC8M16A2P-6A IT
    http://www.farnell.com/datasheets/1674468.pdf


    Page 46, 1. For full-page accesses: y = 2048 (x4); y = 1024 (x8); y = 512 (x16).

    jmg, is this one ok ?
  • jmgjmg Posts: 15,173
    edited 2013-05-19 18:50
    MT48LC8M16A2P-6A IT
    http://www.farnell.com/datasheets/1674468.pdf


    Page 46, 1. For full-page accesses: y = 2048 (x4); y = 1024 (x8); y = 512 (x16).

    jmg, is this one ok ?

    Yes. It looks more expensive than the 256M one above, but the TSOP54 looks to be a widespread SDRAM standard, so you can move vendors easily.
    I see a ISSI part IS42S16320D, is 1024(x16) @ 512M, but is over $10
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-19 19:04
    So 640x480 is 307200 and at 16 bits it is one pixel per word, so a 16megabit chip is 1 megaword so lots of space left for buffering sprites etc. But if it is 640, will that work if the burst is only 512?
  • megaionstormmegaionstorm Posts: 178
    edited 2013-05-19 19:05
    jmg. Good to hear.

    Then i purchase 2 MT48LC8M16A2P-6A IT for my project.

    When i calculate right then the chip has a 16MByte size ?
Sign In or Register to comment.