Shop OBEX P1 Docs P2 Docs Learn Events
4.3" Touchscreen Thread Consolidation Test - Page 3 — Parallax Forums

4.3" Touchscreen Thread Consolidation Test

1356

Comments

  • AribaAriba Posts: 2,690
    edited 2009-12-07 16:02
    Rayman said...
    Ariba: I would love to see the 480x272 version! Can different rows have different colors?

    The colors are now settable for every 32x32 pixel tile, like in the VGA original driver.
    But I can make a version with 1 color per row (=272 words for the colors).
    It would also be possible to change it only every n rows, i.e 8 rows for text lines. Just say what you need [noparse];)[/noparse]

    Andy
  • RaymanRayman Posts: 14,768
    edited 2009-12-07 16:21
    Per tile coloring is perfect... Does it have to be full screen? I can see cases where you only need 1-bit graphics in a less than a fullscreen window...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • AribaAriba Posts: 2,690
    edited 2009-12-07 17:44
    You can change some constants for pixel width and height, to get a lesser size, but the window is then always top left placed.
    It would be possible to add a left and top margin, but the current driver hasn't that implemented.
    It is really only a bitmap driver, and you can't use the remaining part outside the window for anything other.
    The tiles are only for defining the colors.
  • RaymanRayman Posts: 14,768
    edited 2009-12-07 17:57
    Can the 240 x 136 modes be double buffered?

    I wonder if there's a way to use the SD card or EEPROM as the second buffer for a 480x272 mode...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • AribaAriba Posts: 2,690
    edited 2009-12-07 18:13
    Double buffering with 2 buffers in RAM is certainly possible. It has a sync indicator to know when to switch the buffers.
    I don't know if SD as double buffer will be fast enough...

    It's the best I release the code now....
  • AribaAriba Posts: 2,690
    edited 2009-12-07 18:14
    OK, here are my Bitmap drivers for the 4.3" LCD.

    There are 1 bit per pixel drivers in HiRes- and LowRes versions (480x272 and 240x136 pixels).
    The color is definable per 32x32 pixel tile.
    HiRes is usefull when you will draw a lot on the screen, but needs 16 kByte memory.
    LowRes is mainly for application which has not much RAM free for the screen, LowRes needs only 4.2 kByte.

    Then there is also a 2 bit per pixel driver with 240x136 pixels. Every pixel can have 1 of 4 colors. Individual 4 colors
    are definable per 48x32 pixel tiles. This gives 5 x 5 tiles, which is a good size for touch buttons. The first line of tiles
    is only 10 pixels in height, this can be used for a Titlebar with its own colors.

    A demo code is included in the ZIP, which works for all drivers. You just need to change the driver in the OBJ section.
    The demo shows the color tiles, and draws pixels and lines. I've tried to make a photo, but my camera is not good
    enough, to show details sharp, so perhaps somebody else can make a screenshot.

    Andy

    Edit: Updated also the comments and description to the right version.

    Post Edited (Ariba) : 12/7/2009 6:53:39 PM GMT
  • RaymanRayman Posts: 14,768
    edited 2009-12-08 00:59
    Here's a couple·photos and a·little video of it running in high-res, 1-bit mode...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

    Post Edited (Rayman) : 12/8/2009 1:07:38 AM GMT
    1496 x 1122 - 553K
    1496 x 1122 - 483K
  • RaymanRayman Posts: 14,768
    edited 2009-12-08 02:19
    Here's a new screenshot and latest (final?) version of the fullscreen 6-bit driver.
    It's at 11 Hz refresh, which gives a noticeable flicker to the eye, but looks great on camera!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2009-12-08 02:26
    In case anybody is brave enough to try this themselves...· Here's how I prepared the image in Photoshop:

    1.· Resize to 480x272

    2.··Image-->Mode-->Indexed Color

    and then choose the settings as shown in this photo.

    Save as .png and then use that with the 6Bit dat generating app, I posted earlier...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
    773 x 517 - 119K
  • AribaAriba Posts: 2,690
    edited 2009-12-09 05:03
    Rayman

    I tried your 6 bit driver, but my SD card is to slow (a 512MB older card). I get only the half buffer filled for every
    16 lines.

    I tried to slow down your video driver, but as you say before, the pixel clock seems not to work under 4 MHz.

    So I decided to reprogram a 6 bit Fullscreen driver starting from my Bitmap drivers. And it was not very hard.
    I have attached the result in the ZIP. It contains only the changed files (demo-code and driver) the other objects
    are in your PSB_6bitDemo Archive.

    This driver allows to adjust the Pixelclock in 0.3 MHz steps (5/16 MHz). And I also found that it's the best when the
    Sync Signal for buffer filling comes after a 1/4 of the buffer is outputed by the driver.
    I have the feeling that the flickering is lower, but I can't really say, because I see only the half picture and some
    changing lines with your driver.

    It's very easy to change the driver to 480x136, and I also have tried a 240x272 version which is not so bad, perhaps
    for a movie player with higher frame rate.

    I hope this will be usful for you

    Andy
  • RaymanRayman Posts: 14,768
    edited 2009-12-09 12:46
    Great!· More the merrier...
    I'm surprised your SD would be slower, mines a very old 256 MB card...· Maybe it's fragged...
    Anyway, you could have also used this parameter to slow down the refresh rate in my driver:
    _hd                     long     1200'512'512       '1+             read-only   
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2009-12-09 23:53
    Ariba: Just tried out your driver! Didn't work so well with my old 256 MB card, but did work with newer, 2GB card...
    Measured a frame rate of 11 Hz, exactly like mine...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • AribaAriba Posts: 2,690
    edited 2009-12-10 00:42
    And I tried your driver again [noparse]:)[/noparse]

    I have interpreted the picture the wrong way, my card is to fast and not to slow. I just have seen half overwritten buffers, but
    that overwrites come from the new buffer which is filled in before the lcd driver picks the data from the buffer.
    When I add a delay of 3ms after syncing and before read sd-card, it works perfect. And I see now that flickering is the same.
    The 11 Hz comes from the speed of the SD card, and a lcd driver can't make theme faster.
    Perhaps you need to set the sync indicator not at begin of drawing the buffer data, but to a later position, so that it works
    for all SD cards.

    If I had found this yesterday, I not had written the driver new. OK two big advantages stay: My driver is 200 longs shorter, and I know how I can change it [noparse];)[/noparse]

    Now I begin with a text driver, I will see much more text on this LCD. Perhaps 60x34 characters with the 8x8 fonts known
    from various TV drivers.
    The motto this week for me seems to be: On driver per day....

    Andy
  • AribaAriba Posts: 2,690
    edited 2009-12-11 06:21
    Cluso99 said...
    I like the idea of a 6x8 character option for 80 chars/line (5x7 with a blank pixel). This is what was originally used in the 70's & 80's. The characters will be blocky, but hey, we lived with that for many years, and the LCD is a much better display than the old monitors.

    But this old monitors were much bigger then this 4.3" LCD.
    I tried 6x8 font with the HiRes Bitmap driver, and found that the characters are so tiny that I can not read it comfortably (perhaps it's time for glasses...). So I tried to double every pixel, but then the characters were unnecessray big, and only 40 fit in a line.

    So I was thinking 8x8, 8x12 or 8x16 would be a good compromise.
    The actual driver I work on, can switch between 8x8 and 8x16 uses the Atari font and allows separate colors for every character.

    It would be quiet easy to change it to 6x8 / 6x16, but I don't have a 6x8 font organized as 8 bytes (1 byte per row) to try it.

    Andy
  • EaglemanEagleman Posts: 31
    edited 2009-12-12 07:16
    Rayman,

    On the 4.3" display, if the power supply for LED+ and Vdd were intentionally shut down without stopping the signals from the Prop, would that destroy the LCD by having signal levels to the LCD that were greater than Vdd (0 volts)?·

    I ask because my devices are battery powered (LI-Ion rechargeable)·and in an effort to conserve power I like the devices to automatically turn off or cut back on consumed power when not actively in use.· If we can remove LCD power, we can still use touchscreen depressions to "wake-up" the LCD.· This would be just one method of conserving battery charge.
  • mctriviamctrivia Posts: 3,772
    edited 2009-12-12 07:22
    the backlight is just 10 leds in series it is safe to remove power from them and both mine and rays breakout boards use a driver chip with a disable option. The LCD itself should not draw much power if not enabled and you can use the PI pin on the breakout board to allow for an easy wake method.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    24 bit LCD Breakout Board now in. $21.99 has backlight driver and touch sensitive decoder.
  • AribaAriba Posts: 2,690
    edited 2009-12-13 09:43
    FlyingFishFinger said...
    How hard would it be to make the driver write along the short side of the display? I'm contemplating a PDA-style readout device which would be held upright rather than across.

    Rafael

    Should be possible. With a 6x8 font you will only get 40 characters per line, but a lot of lines.
    What it needs is a 90° rotated font, which I have already, and a different read sequence of the character buffer.

    I think this is especially useful for a virtual keyboard on the second half of the screen.

    Andy
  • EaglemanEagleman Posts: 31
    edited 2009-12-13 14:15
    Ariba,

    Thanks for your help! I finally have a screen working. Also, with your help I now have a better understanding how the video and spin work. I've got VBL connected to +3.3v; should that be connected to +5v?

    Here's my new connection chart (for anyone else that might need this info):
    p0 Vsync (basepin)
    p1 Hsync
    p2 B0
    p3 B1
    p4 G0
    p5 G1
    p6 R0
    p7 R1
    p8 DEN
    p9 DE
    p10 PCLK
    p11 BL
    p27 IRQ
    p28 SCL
    p29 SDA
    VBL +3.3v

    Where can I find additional information on the basic "Parallax VGA Driver"? I searched the forum archives, but found nothing.

    Thanks again for your help. GREATLY appreciated!!
    Eagleman
  • Harrison.Harrison. Posts: 484
    edited 2009-12-13 20:19
    These LCDs are great. My partner and I was able to incorporate the LCD into a university project without any problems (thanks to the excellent documentation Rayman provided). The main difference is we chose to use a MCP3202 2-channel ADC instead of a touchscreen controller. The touchscreen reading algorithm was simple enough to implement in software (the hardest part was implementing 3-point calibration).

    I would say these are easier to use than the B/W 128x64 graphic LCDs most people use. It only took us about 1.5 weeks from idea to finishing a board layout using this LCD. The board also contains a Freescale 9S12, ethernet interface, and an analog audio front end; which is what took up most of the layout and design time.
    1600 x 1071 - 147K
  • AribaAriba Posts: 2,690
    edited 2009-12-14 09:05
    kerryw said...
    Ariba said...

    OK, here are my Bitmap drivers for the 4.3" LCD.

    There are 1 bit per pixel drivers in HiRes- and LowRes versions (480x272 and 240x136 pixels).
    The color is definable per 32x32 pixel tile.
    HiRes is usefull when you will draw a lot on the screen, but needs 16 kByte memory.
    LowRes is mainly for application which has not much RAM free for the screen, LowRes needs only 4.2 kByte.

    Then there is also a 2 bit per pixel driver with 240x136 pixels. Every pixel can have 1 of 4 colors. Individual 4 colors
    are definable per 48x32 pixel tiles. This gives 5 x 5 tiles, which is a good size for touch buttons. The first line of tiles
    is only 10 pixels in height, this can be used for a Titlebar with its own colors.

    A demo code is included in the ZIP, which works for all drivers. You just need to change the driver in the OBJ section.
    The demo shows the color tiles, and draws pixels and lines. I've tried to make a photo, but my camera is not good
    enough, to show details sharp, so perhaps somebody else can make a screenshot.

    Andy

    Edit: Updated also the comments and description to the right version.
    Thanks so much for the drivers Ariba. Did you happen to create a graphics.spin object that support these?

    Kerry

    Kerry

    Here is the graphics object that tdeyle posted a few pages before, adapted to my Bitmap drivers.
    This is not as good as Chip's graphics.spin, but you can draw graphic and text (picked from the ROM font).

    The included Demo is for the HiRes version, if you change the bitmap object, and all the coordinates, then this should
    work also with the LowRes driver.

    It seems to have some issues if the Y coordinate is higher then the screen.

    I will also adapt my own Graphics object later, but not found the time so far.

    Andy
  • AribaAriba Posts: 2,690
    edited 2009-12-16 23:47
    And yet another Graphics driver.

    This time it works with Chip's Graphics object. In opposite to Raymans graphics demo for this TFT, this driver
    uses the whole screen for a 240x136 pixel bitmap. So every bitmap buffer needs only 8.5 kByte, that allows
    also double buffering and lets 7 kByte more memory free than the TV version.

    Sorry for the bad photo, I really need a better camera for such photos...

    Andy
  • AribaAriba Posts: 2,690
    edited 2009-12-17 07:44
    Thanks guys

    There are some wrong comments in the Driver file (just copied from a 2 bit driver and forgot to change).
    So I attach a polished version. The code has not changed, only some description. If you don't want study
    the driver you don't need to update it.

    Eagleman
    You can add the following line after the last line of PUB GraphicsDemo (same indention as k++):
    waitcnt(clkfreq+cnt)

    This updates the display only 1 time every second. Enough time for a photo...

    Andy
  • EaglemanEagleman Posts: 31
    edited 2009-12-17 14:23
    Ariba,

    Here is the photo of your TSD_Graphics_Demo on my 4.3" LCD.· Hope this is good enough.

    Also attached is a photo·of one of Ray's TFT LCDs in a Serpac 15-S-A box from Mouser.


    Post Edited (Eagleman) : 12/17/2009 2:44:30 PM GMT
    1043 x 898 - 193K
    898 x 582 - 136K
  • EaglemanEagleman Posts: 31
    edited 2009-12-17 21:30
    M.E.S.H,

    Your display looks fantastic, but....· The·special box to exactly fit the display is impractical because of cost, circuitry space, fastenings (the screws on your display would go right through the display), battery space, switches and space for connectors like power, I/O, etc.· Once you try to really make everything fit together then reality sets in and the enclosure size and some other features may have to play the compromise game.· It's like looking at a picture of the dream living room with all of the necessary things like lamps, tv, phone, but you never see a power cord or cable anywhere.

    McTrivia,

    There is space for circuitry.· The amount of that space is dependent on things like whether the box is ordered with the 9 volt battery compartment (I had to notch the top of the battery box for LCD clearance), height and placement of tall components (had to shave a little off the box's board mountings for DB15H clearance).· The LCD fits nicely and taking the que from earlier posts, the LCD is held rather securely with double stick (cushioned) tape from Loews or Home Depot.· They also make a slightly larger box (27-S-x) with the slope from long edge to long edge that might work better.· The 4.3" LCD display is in·landscape mode which might be better suited to the #27 box than my setup.· Again, it's a compromise.· A portrait oriented font is needed for my box.

    When I work out exact placements for my box, I'm going to send some boxes to neoteric for him to practice on with his new CNC machine.

    I've attached a photo showing comparative sizes with and without batteries, the inverted top with the LCD securely in place, and also showing the box as I've used before with the Hill 20 key pad.

    Post Edited (Eagleman) : 12/17/2009 9:37:39 PM GMT
    1197 x 598 - 178K
  • M.E.S.HM.E.S.H Posts: 18
    edited 2009-12-17 22:34
    Eagleman,

    Yes you're completely right. You have to excuse my photoshop skills and other drawing, they are out of proportions and all. I'm just a fan of the instrumentation plates/panels you see in old submarine movies and old fighter plane cockpits, nearly rusty w. old weared out screws etc. Plastic is great, but...

    A thin universal metal frame for this lcd exact measurements let's one mount it on any home made "box", as small as it would allow for that particular project, I think the hard part is just near the edges around the frame, to get the feeling of "no edges" height-wise around it since it's a touch screen, perhaps there is a panel mount kit that has the right measurements already?

    /M.E.S.H
    1449 x 462 - 62K
  • RaymanRayman Posts: 14,768
    edited 2009-12-19 18:12
    Ariba said...
    I tried your 6 bit driver, but my SD card is to slow (a 512MB older card). I get only the half buffer filled for every
    16 lines.
    Ok, I've cleaned up the 6-bit demo a bit.· I should now work with slow and fast SD cards.· Also, the number of rows of image is dynamically variable.· Also, it will show you a message if the SD fails to mount or open.· Also fixed the documentation a bit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2009-12-20 21:04
    Tim-M: Frontpanelexpress looks very interesting. I like the emachineshop place too.

    I think my next driver will be for a 6x10 font like this one:
    http://www.dr-hoiby.com/res/HobTiny.php

    I think it looks pretty good and will give 80 columns by 27 rows!

    I've already converted the font into a machine readable text file here:

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • ry.davidry.david Posts: 63
    edited 2009-12-20 22:10
    Does the variables defining the LCD pins work differently Ariba's drivers compared to Rayman's? I have the PSB Paint and PSB VGA Demo working fine. I can kind of make out the spinning triangles in the graphics demo, but it is really noisy.

    This is what I have it set the driver to currently. (My physical setup is set to the default of Rayman's driver)
    DAT   'LCD connection and settings
    sync          long  0           'Sync indicator variable
    basepin       long  16          'CUSTOMIZE this Pin settings!!
    DEpin         long  26
    PCLKpin       long  25
    DONpin        long  24
    BLpin         long  24
    Brightness    long  22          '1..31
    parpass       long  0        'reserved for parameter passing   
    
    



    Also, how tolerant is the display of longer wires? I have jumper wires ~8" from the prop to the break out board.

    Thanks!
  • ry.davidry.david Posts: 63
    edited 2009-12-21 00:22
    PSB Paint, VGA Demo, and Graphics Demo are working perfect. I wired the display according to the LCD Driver vars.

    I am having trouble with Arribas' driver. I had modified his driver to reflect how I have it hooked up, and the attached (crummy - sorry!) picture is what I get.

    Thanks!
    1600 x 1200 - 125K
    lcd.jpg 124.9K
  • ry.davidry.david Posts: 63
    edited 2009-12-21 02:12
    blush.gif

    I changed the DE and PCLK pins to 14 and 15, and now it works. Some reason it will not work with pins 24 and 25.

    Thanks for all your help (and to Ariba for all your work on the driver)!
This discussion has been closed.