Shop OBEX P1 Docs P2 Docs Learn Events
16-bit color photo on 4.3" LCD - Page 2 — Parallax Forums

16-bit color photo on 4.3" LCD

2»

Comments

  • RaymanRayman Posts: 14,768
    Was pretty trivial to adapt code to 1 bit per pixel image/buffer.
    Now, I can see about adding in a font and try it on Nano...

    Here's a screen shot and code:
  • RaymanRayman Posts: 14,768
    Works on nano! But, not with USB power... Had to use power jack on Prop board:
    (also I had to solder extra Prop Plug header that comes out sideways...)
    640 x 480 - 87K
  • RaymanRayman Posts: 14,768
    I've almost got a "Hello World." example, but ran into PNut issue, I think...

    I'm defining the string to write like this:
    Message      byte  "Hello World.",0
    

    But, I think PNut is rearranging my characters (see pic).
    Is there an easy fix for this?
    640 x 480 - 89K
  • cgraceycgracey Posts: 14,209
    Rayman wrote: »
    I've almost got a "Hello World." example, but ran into PNut issue, I think...

    I'm defining the string to write like this:
    Message      byte  "Hello World.",0
    

    But, I think PNut is rearranging my characters (see pic).
    Is there an easy fix for this?

    You should be able to do sequential RDBYTE's to read those characters in.
  • RaymanRayman Posts: 14,768
    That's what I think I'm doing, but I'll take a closer look...
  • RaymanRayman Posts: 14,768
    I won't claim a P2 bug this time, until I investigate some more...

    I did just verify that PNut appears to compile the bytes in the correct order.
    So, it looks like rdbyte is swapping order within words.
    But, like I said, I'll look harder at my code.
    Here's the part that reads the characters:
    DAT 'font drawing code
    DrawFontCog
                  org 0
                  mov       row,#7
                  mov       col,#20
                  mov       pMess,##Message
    MessLoop              
                  rdbyte    c,pMess
                  cmp       c,#0 wc,wz 'zero marks end of string
            if_z  jmp       #TheEnd
                  mov       s,c  'make char source address
                  shl       s,#4 '*16
                  add       s,##Font1
                   'make destination start address
                  mov       x,row
                  shl       x,#4 '16 rows per char
                  mov       y,BytesPerRow
                  call      #Multiply
                  mov       d,y
                  add       d,col
                  add       d,##HubLine1 
    
                  mov       y,#16 '16 rows in character
    CharLoop
                  rdbyte    charByte,s
                  add       s,#1              
                  wrlong    charByte,d
                  add       d,BytesPerRow
                  djnz      y,#CharLoop
                  'Next character
                  add       col,#1
                  add       pMess,#1
                  jmp       #MessLoop
    TheEnd
                  jmp       #TheEnd
    
  • RaymanRayman Posts: 14,768
    edited 2015-11-04 23:17
    Ooops, it is my code... Glad I didn't claim a P2 bug this time...

    My LCD driver is reading in words, which has high and low bytes swapped...
    Guess my photo data is also in words, so it worked out.

    Think should make the LCD driver read in bytes...
  • RaymanRayman Posts: 14,768
    All better:

    640 x 480 - 92K
  • RaymanRayman Posts: 14,768
    BTW: I've got 7 more of these boards... If anyone else wants to play around with this, I can make a pretty good offer: $20+shipping, including LCD and 40-pin male header pins installed.
  • jmgjmg Posts: 15,175
    Do you have a link to the specs ?
  • RaymanRayman Posts: 14,768
    edited 2015-11-05 00:45
    The LCD has specs, it's the same one I've been using for years...
    I can link to PSB or 4.3" breakout at rayslogic.com for the datasheet...

    The PCB has no specs, just something I drew up rather quickly one morning...
    I could post the schematic and PCB image, if that helps...

    There are some extras on the board, that I don't know if they work yet:
    pads for uSD jack and pads on bottom for SQI flash chip and eeprom.
  • Still have these available? Can I purchase 1?

    regards
    Lachlan


  • RaymanRayman Posts: 14,768
    edited 2015-11-11 13:55
    Yes, there are six left. email to ray @ rayslogic . com or private message me here with your email address.

    Oh, and I need to know if this is for P123 or DE type board, so I know which 40-pin header to solder on...
  • Thanks Ray. Let me check if anyone else wants one at this end, too. Won't be long
  • RaymanRayman Posts: 14,768
    Was reading the new docs today and now thinking there might be a way to use the streamer for LCD (or other things) without a streamer generated pixel clock...

    I noticed a wait/interrupt event that is NCO rollover.
    If I understand this right, this is when new data is read in or outputted from streamer to pins.
    So, maybe one could set up a interrupt or wait loop that toggled the pixel clock pin whenever that happened?
  • Ray, my board showed up in the mail today. I just plugged it in and tried the 1bitfont.spin program, my 1-2-3 board has one thing to say,


    "Hello World."

    Look like more fun times ahead, now with an LCD too!!
  • Rayman wrote: »
    Was reading the new docs today and now thinking there might be a way to use the streamer for LCD (or other things) without a streamer generated pixel clock...

    I noticed a wait/interrupt event that is NCO rollover.
    If I understand this right, this is when new data is read in or outputted from streamer to pins.
    So, maybe one could set up a interrupt or wait loop that toggled the pixel clock pin whenever that happened?

    Chip talks about the new 'Streamer Empty" event in this posting - it's an addition to the next release.

    The NCO rollover has been there.

    I'm still trying to wrap my head around all this video stuff. I've never done video before. My idea of a front porch is totally different!

    It seems like one of these events will be able to help out, I'm not sure which yet.

  • RaymanRayman Posts: 14,768
    Glad to hear you got it and it works.

    I was supposed to ship another one today, but had to play soccer mom all day :( as wife is out of town...

    I probably should post a circuit diagram and stuff soon...

  • My, how times have changed!

    I'm looking at/playing with your OneBitFont code and playing with P2 features and I see this gigantic font data structure (4kB) and then this HUGE bit buffer for the display (~16kB) and think, "wow, that's a lot of memory!"...then I realize on the P2, that's less than 4% of my HUB!

    The P2 'mul' seems to work fine as a replacement for you multiply routine. I replaced 'call #Multiply' with 'mul y,x" and it still works. :) I'm sure I'll break something this afternoon!
  • RaymanRayman Posts: 14,768
    Yes, P2 will be perfect for medium size LCDs like this.
    Lots of RAM and processing power.

    Just did 8-bpp VGA with Ariba's driver and it uses up more than half of RAM...
    Was feeling a little more squeezed there...
  • mindrobots wrote: »
    My, how times have changed!

    I'm looking at/playing with your OneBitFont code and playing with P2 features and I see this gigantic font data structure (4kB) and then this HUGE bit buffer for the display (~16kB) and think, "wow, that's a lot of memory!"...then I realize on the P2, that's less than 4% of my HUB!

    The P2 'mul' seems to work fine as a replacement for you multiply routine. I replaced 'call #Multiply' with 'mul y,x" and it still works. :) I'm sure I'll break something this afternoon!

  • I don't know how my last post got there. I suspect a cat.
  • RaymanRayman Posts: 14,768
    Here's the schematic and layout of the board:
    1078 x 813 - 69K
  • Woo hoo! Just got back from Thanksgiving with the in-laws and there were two packages waiting: an A9 board and the 4.3" display! Took no time at all to get them up and running (running Lenna_V2)! Thanks Parallax and Rayslogic! :)
Sign In or Register to comment.