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

4.3" Touchscreen Thread Consolidation Test

1246

Comments

  • AribaAriba Posts: 2,690
    edited 2009-12-21 10:10
    Rayman said...
    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:

    Here is this font conditioned to copy into a Spin source.

    I have adapted one of my Text drivers to the font, but I am not totally convinced....
    I will post first my Text Drivers which use other fonts.

    Andy
  • RaymanRayman Posts: 14,768
    edited 2009-12-22 20:33
    Got the 6x10 font working!· I think it's pretty legible too.

    Gives 80 columns by 27 rows (plus top two lines of 28th row).

    There's one bug that I'm having trouble nailing down though...· If you set the colors to white on black anywhere on the screen, the screen goes unstable.· It's driving me crazy!

    Anyway, for now, don't use white on black!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • AribaAriba Posts: 2,690
    edited 2009-12-23 09:35
    Here are my Text drivers

    1) Landscape format 60x34 characters with 8x8 pixel font.
    Can be switched between 60x17 and 60x34 mode while running, this allows a zoom mode.

    2) Portrait format 45x40 characters with a 6x8 font and 4 empty lines between rows.

    Both allow to define the Background color and an individual color for every character out of all 64 possible colors.
    There is also an Inverse-Bit which allows to swap Fore-and Backgroundcolor i.e for cursors and Block selection.

    For both, I have written a TV_Text compliant layer. This makes it easy to replace the TV-Monitor by this TFT in all applications
    which use TV_Text (or VGA_Text or PC_Text).
    The text drivers have an additional methode: button(stringptr) which allows to draw a text with a border around it.

    The Text drivers include a little Testcode for demonstration. This Testcode can be deleted (or commented out) to get
    a clean driver object.

    Andy
  • RaymanRayman Posts: 14,768
    edited 2009-12-24 00:41
    Ok, TinyFont is all better now...· Here's a more stable version and the program that turns that font file into a .dat file...

    Had to resort to using 16 bytes for each character because inner waitvid loop wasn't fast enough to do a x10 multiply...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2009-12-25 20:45
    Here's some screenshots of Ariba's fonts (Nice Work!):

    (Think I need to get a tripod out to do this better...)





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
    1496 x 1122 - 772K
    1496 x 1122 - 755K
  • Luis DigitalLuis Digital Posts: 371
    edited 2009-12-25 21:07
    Rayman said...
    Here's some screenshots of Ariba's fonts (Nice Work!):

    (Think I need to get a tripod out to do this better...)

    I was watching last night's work Ariba, and I liked it, especially the driver TSD_rot6x8.

    Another thing is the assembly code looks so simple. Place the BL code in Spin was also a good idea, but had to write a little function to change the brightness, for example:
    PUB BL_Bright(bright)
       repeat bright    
         outa[noparse][[/noparse]bl]  := 0 
         outa[noparse][[/noparse]bl]  := 1
    



    It'sa good idea to separate the code from the screen and the BL, because I use another smile.gif and because in the future you can still upgrade with minimal modifications and using the same functions (API).
  • Luis DigitalLuis Digital Posts: 371
    edited 2009-12-25 22:09
    Ray,

    The driver / Demo "PSB Paint", seems to have a bug with "newline" at the end of the last lines display becomes unstable.

    Try:
      repeat                        
       newline                      
       printStr(string("New line")) 
       Waitcnt(clkfreq/2 + cnt)       
    
    
  • RaymanRayman Posts: 14,768
    edited 2009-12-26 00:35
    Yeah, that's in inherent problem with an odd number of rows (17)... Not quite sure what to do about that...
    Probably should make #rows either 16 or 18...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • ry.davidry.david Posts: 63
    edited 2009-12-30 03:52
    Ariba said...
    Landscape format 60x34 characters with 8x8 pixel font.
    Can be switched between 60x17 and 60x34 mode while running, this allows a zoom mode.

    Is it possible to do a native 8x16 font (rather than a 8x8 with the rows doubled)? I am trying to sort through Ariba's driver, but I am not very comfortable how the video generation works yet. I am using the driver in full character height (rows = 17, char height = 2), but it would be awesome to have smoother characters.

    Thanks both Rayman and Ariba for your efforts on this display
  • AribaAriba Posts: 2,690
    edited 2009-12-30 19:01
    ry.david

    This driver is a little special in that the font is in the CogRAM. That's why the access of the single font-bytes is complicated.
    A 8x16 font would not fit in CogRAM, so another technik is needed.

    I have also a driver which accesses font data from MainRAM, perhaps an 8x12 font (from the VGA drivers) is a good size?

    Andy
  • RaymanRayman Posts: 14,768
    edited 2009-12-31 14:24
    I didn't realize you had the font in COG RAM! That's very nice. Mine takes up a lot of HUB memory...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2009-12-31 22:52
    Here's an 8x16 font driver (gives 60 columns by 17 rows):


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

    Post Edited (Rayman) : 12/31/2009 10:58:44 PM GMT
  • AquaaddictAquaaddict Posts: 20
    edited 2010-01-01 17:22
    Hi,

    Finally got my LCD and (Mctrivia) breakout board hooked up, but the display isnt right and I have no idea why.

    On Ray's Grafx demo the top title bar it pretty stable, but gets echod for want of a better desription twice below it, and there is lots of flickering of the rest of the screen. Here is a video of it·; as you can see the animated lines in background appear to move OK behind the corruption.

    The paint program looks semi normal but the image is clearly not right, and the VGA demo program looks barley recognisable (see attached images)

    Can anyone please suggest what the problem might be?

    My pins are set as follows:

    BackLightPin=11
    · DisplayOnPin=8
    · PixelClockPin=10
    · DataEnablePin=9
    · TouchIrqPin=27· 'This pin is really optional, but touchscreen sets this whenever screen is touched
    · NotUsedPin=26·· 'Need to define one pin that is not to be used for LCD (can still be used for anything else)
    · VgaPins=%000_111 'RGB and syncs connected to P0-7

    I have double checked all pins are connected correctly and tried 3 different LCDs, and just cant find anything wrong.

    Thanks

    Anthony
    1600 x 1088 - 194K
    1600 x 1200 - 243K
    1600 x 1045 - 223K
  • RaymanRayman Posts: 14,768
    edited 2010-01-01 19:37
    Aquaaddict:· Definitely looks like a bad connection on a sync signal!

    ry.david:· The 8x16 font code is slightly different...· I'll post it and the input file here.

    The input file is the output of a·program called "xFont" for Palm Pilot development (you can still download it from the web).

    xFont puts out a .pfn file that I just rename to .txt so I can edit it with notepad more easily...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2010-01-01 21:02
    Here's another 8x16 font, it's a bit more bold:



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2010-01-02 22:23
    Well, maybe it just won't work with 9" wires... Perhaps something is coupling to the sync signals...

    One thing I'd try is putting 100-Ohm (or 1000-Ohm)·to ground resistors on the sync signals at the breakout board.· That should reduce the effects of any capacitive coupling to the sync signals...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • ry.davidry.david Posts: 63
    edited 2010-01-03 16:32
    I modified the original 8x16 font Rayman posted (thanks again!) to make some a basic GUI. I modified the first 30 characters for the GUI elements, and slightly modified the 0-9, A-Z, and a-z.

    Here are the functions I added to the driver test:

    'UpdateProgressBar
    'Creates and updates a progress bar
    'Call first time with percent of 0 to create, afterwards call with percent
    
    PUB UpdateProgressBar(percent, barcolor) | columns, oldcolor
      columns := (percent * 40) / 100
    
      oldcolor := color
      color := barcolor
    
      if columns == 0
        SetPos(10, 14)
        print($01)
        repeat 38
          print($02)
        print($03)
    
      elseif columns == 1
        SetPos(10, 14)
        print($04)
    
      elseif columns == 40
        SetPos(49, 14)
        print($06)
    
      else
        SetPos(columns + 9, 14)
        print($05)
    
      color := oldcolor
    
    'CreateButton
    'Creates button using supplied text, framecolor, and text color
    
    PUB CreateButton(text, framecolor, textcolor) | oldcolor
      oldcolor := color
      color := framecolor
    
      Print($08)
      repeat strsize(text)
        Print($09)
      Print($0A)
    
      row++
      col -= strsize(text) + 2
    
      Print($07)
    
      color := textcolor
      PrintStr(text)
    
      color := framecolor
      Print($0B)
    
      row++
      col -= strsize(text) + 2
    
      Print($0E)
      repeat strsize(text)
        Print($0D)
      Print($0C)
    
      col++
      row -= 2
    
      color := oldcolor 
    
    'SetPos
    'Moves cursor to specific column and row
    
    PUB SetPos(x, y)
      col := x
      row := y
    
    640 x 421 - 60K
  • RaymanRayman Posts: 14,768
    edited 2010-01-03 19:43
    Looks great!· Don't get mad, but I think I like this new version of 8x16 font driver better:

    It's based on 8x8 tiles, stored in 4-color mode, like the Parallax ROM font.

    This way, one can mix in 2-bit color tiles with the regular font...

    The dat generator program now recognizes "GLYPH2" as a 2-bit color glyph (see first two characters in this example).

    This should make it easier to add fancy looking buttons, etc...


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • ry.davidry.david Posts: 63
    edited 2010-01-03 21:52
    Thanks Rayman, the 8x8 tiles look very promising!

    Could you please explain the longs defined under vga colors? I am assuming they are in binary as RRGGBBxx? How do the bytes 0-3 within each long work?

    Thanks!
    Ryan
  • RaymanRayman Posts: 14,768
    edited 2010-01-03 22:07
    It's exactly the same as the regular VGA (&TV) driver...· Some primer here:

    http://www.rayslogic.com/propeller/Programming/Colors.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • HarleyHarley Posts: 997
    edited 2010-01-05 20:24
    @ anyone

    Yesterday I went through ALL the posts on this subject. Phew, was I beat after that. Was looking for some info, some of which I found, some not.

    Where is the Prop <=> breakout board signals listed. I see some signal names on the b/o board, but that doesn't tell me what the Prop I/Os are needed for them. Is there a table somewhere; I didn't see how the Prop-to-breakout board should be wired? I will be using the original Prop Protoboard.

    Unfortunately the orientation of the LCD flat cable below the display (6 o'clock position) and the available edge pads on the Prop Protoboard are a bit awkward. That seems to be quite often the case, in my experience. Makes the LCD upside down, closer to the viewer, below the Protoboard.

    From the photos I saw looking through all the posts, this display should be a very good one. Photos don't always do justice to the actual display.

    I plan to have a SD card on this Protoboard also. So I hope there are sufficient I/Os left over for other interfaces. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • RaymanRayman Posts: 14,768
    edited 2010-01-05 20:36
    Well, the main thing is that the color and sync pins have to be used the same way as with the VGA driver... I think this means they have to be in a group of 8 pins. Choices are pins P0...P7 or P8...P15 or P16...P23 etc. VSync has to be the lowest number pin and HSync the next lowest.
    All the other signals can be on any pin you like...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • RaymanRayman Posts: 14,768
    edited 2010-01-05 23:05
    Also, for the protoboard, it's probably better to use the +5V for the backlight voltage (AVDD), although you could also use the same 3.3V as for DVDD...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • HarleyHarley Posts: 997
    edited 2010-01-06 00:14
    Peter said...
    Well, the main thing is that the color and sync pins have to be used the same way as with the VGA driver... I think this means they have to be in a group of 8 pins. Choices are pins P0...P7 or P8...P15 or P16...P23 etc. VSync has to be the lowest number pin and HSync the next lowest.
    All the other signals can be on any pin you like...

    Sorry to be a pain, but I've not worked with any VGA and your information isn't very helpful. I have looked at the PSB demo code and need to study that, maybe, more to understand. For some reason, this interface seems so vague. I'm trying to draw up the Prop to breakout board wiring for those 20 pins; can't get very far. Don't know what the PSB is really; hopefully the code can be used for a demo. Or is there a better selection?

    Thank you for the info on the backlight supply being better on +5v; lesser load on the input current I'd suppose. Would help if I looked up the data sheet on what that IC is.

    Thanks for any further guidance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • RaymanRayman Posts: 14,768
    edited 2010-01-06 00:18
    Hmm...· Well, since PSB is almost out the door, I'll post a couple schematics here, in case you want to copy the pin setup exactly with your protoboard:

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
    2365 x 1359 - 88K
    2343 x 1339 - 52K
  • tdeyletdeyle Posts: 85
    edited 2010-01-06 00:45
    Here's a pinout using the DIP Prop, just in case someone else is using that instead of the SMD versions.
    816 x 1056 - 187K
  • HarleyHarley Posts: 997
    edited 2010-01-06 01:48
    Thank you,

    I reread Ray's 12:36 pm post over and over, looked at that PSB demo source and the breakout board. Finally I figured out what you wrote. (sorry I called you 'Peter'; had two posts to get out and I goofed.)

    Those 'middle eight signals, on pins 9 - 16, R1, R0, G1, G0, B1, B0, HSync and VSync are the color and sync signals you referred to. So, I come back and find Ray and tdeyle show me what they have.

    Had I dealt with VGA before, I'm sure it would have made loads more sense. (How does all the 60 conductors from the LCD get transformed down to under 20 signals and pwr/ground, I'm wondering?) I suppose only 2 signals/color, this limits the colors to 64 color at any one time.

    Thanks for clearing up my fog. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • HarleyHarley Posts: 997
    edited 2010-01-09 00:20
    @ anyone,

    Below is what I think is one way to interface the 4.3" LCD breakout board to a Prop. (I used Rayman's rough schematic to understand the purpose and organization of the Prop signals vs. the breakout board (silk screened) names at header zone J1. I trust it was correct.)

    Does my list below appear to be correct? I prefer to NOT wire up this i/f with unknown errors! Thank for any help or suggestions to improve it.

    Propeller / 4.3 breakout board i/f for 4.3" Samsung color LCD module - 7 Jan.2010
    
        GND     1    GND
        A29     2    SDA    (I2C)    
        A28     3    SCL       "
        GND     4    GND
        3.3V     5    Vdd
        A27     6    IRQ
        A26     7    PCLK
        A25     8    DE
        A23     9    R1    msb
        A22    10    R0       |
        A21    11    G1       |
        A20    12    G0    (byte)
        A19    13    B1       |
        A18    14    B0       |
        A17    15    HSync   |
        A16    16    VSync  lsb
        A24    17    DON  (DON/BL = 1 for ON)
        A24    18    BL
        GND    19    GND (for backlight)
        +5V    20    VBL
    Prop  H1 pin    J1 Breakout board
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • HarleyHarley Posts: 997
    edited 2010-01-09 01:32
    Ray,

    Looking at the PSB_LcdDriver source listing it has PCLK on A25 and DE on A26 (opposite to what I first found...somewhere; maybe a reading error?)

    Also, WHY is there a "...Need to define one pin as NOT used"? That would be difficult to 'discover' a need for doing such.

    I'm about to wire up this i/f and hope to have the documentation, at least, correct to begin with. yeah.gif

    It appears if the breakout board is plugged in upside down, the the LCD would display 6 o'clock down and the Prop Protoboard in 'normal' position. That is the breakout would have the header pins or socket on the component side. The module then could be attached with double-sided tape to the back of the b/o board nicely. Do you see any problem doing that?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • RaymanRayman Posts: 14,768
    edited 2010-01-09 01:47
    PSB has PCLK on P25.

    The "not used pin" is needed in order to get a pixel clock that is 180 degrees out of phase with the pixels...
    Needed that so as to not violate setup and hold times for the display color inputs...

    Should work upside down. Looking forward to hearing about your results...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
This discussion has been closed.