Shop OBEX P1 Docs P2 Docs Learn Events
QuickByte Video Hardware with Character Map - Page 2 — Parallax Forums

QuickByte Video Hardware with Character Map

2»

Comments

  • I think one important rule is don't mix your IDE. Either use PropTool or FlexProp.

    If you use code snippets in FlexProp that were generated in PropTool, be really careful and expect to be adjusting tabs and spaces when you modify the code.

    Proptool converts tabs to spaces when saving. Flexprop doesn't. The different way they each handle tabs and spaces is what causes the issue.

  • @JonnyMac Thank you for your reply. Do you accept your tab stops being converted to spaces by the programming tool? Are new tab stops saved as spaces each time you save? Have you written spin code that compiles in PropTool and FlexProp?

  • VonSzarvasVonSzarvas Posts: 3,275
    edited 2022-11-24 15:50

    Hi @kg1

    Those "asm / endasm" commands are for FlexProp only. They cannot be compiled with PropellerTool.

    PropellerTool uses "org / end" instead, but it's not even as simple as swapping the names to org in order to use PropellerTool, because the current version of PropellerTool's compiler doesn't allow more than 16 longs of parameters & local variables in nested org code. The video routines use almost twice that!

    So you will need to use FlexProp, unless you are able to completely re-work the key functions such as gfxText8, to use no more than 16 parameters & local variables combined.

    In the meantime, I've just updated the Parallax website with new versions of the code files. (For all 3 of the video demos).
    https://www.parallax.com/search-articles/?swpengine=articles&swpquery=Intro+to+Using+Video

    I've removed the tabs, so that now the code will work fine with FlexProp set to any user tabstop setting.
    Just tested with the Parallax monitor, and they all work. I tried both DVI_800x480 and DVI_640x480.

    The Parallax monitor is not compatible with DVI_800x600, so I couldn't try that one. If you are using a different monitor, you might also need to consider which resolutions your monitor supports. I think the 800x480 is not so common- although it seems good for the aspect ratio of the small wide screen monitors like the Parallax one.

    Hopefully the updates will help you get past these initial hurdles?

  • Hi @VonSzarvas
    The photo of my hardware earlier in this thread were all purchased from Parallax Inc including the display:
    https://www.parallax.com/product/7-hdmi-display-800-x-480/
    Thank you for your excellent reply. I will work through your info and report back to you.
    Kevin

  • JonnyMacJonnyMac Posts: 8,918
    edited 2022-11-24 19:19

    @kg1 said:
    @JonnyMac Thank you for your reply. Do you accept your tab stops being converted to spaces by the programming tool? Are new tab stops saved as spaces each time you save? Have you written spin code that compiles in PropTool and FlexProp?

    Propeller Tool automatically converts tabs to spaces.
    While I don't use FlexProp, I have accommodations in my program templates for it so that my programs can be run on any system. When I conduct training sessions for Parallax, I always verify that my demo code works in FlexProp.

    A moment later....

    There are some inconsistencies between Propeller Tool and FlexProp. The memory address of clkfreq, for example, which can create an issue in PASM. Some time back I wrote a version of an OLED driver that had Propeller Tool and FlexProp-specific implementations. That is to say, if you're using FlexProp, you may hit a snag running some of my programs. I only test in FlexProp when I absolutely have to.

  • kg1kg1 Posts: 164
    edited 2022-11-26 08:07

    Hi @VonSzarvas
    I used the new code, changed the motherboard, changed the HDMI cable. Still no luck.
    Never tried the display since I purchased it many months ago.
    Could be the display is faulty?

  • @JonnyMac Thank you for your comments. I like the automatic conversion of tabs to spaces. However in FlexProp, if the number of spaces per tab is changed and new tabs are added... or if someone else's code has a mixture of tabs and spaces and your number of spaces per tab is different from the original author...
    Perhaps at the beginning of each spin file a statement could be made that "this code was written in FlexProp / Protool etc with a setting of x spaces per tab".

    Initially the project in this thread could have benefited from clarification like the above statement. If the intention of the user was to rewrite the driver in PropTool he/she would need to replace all tabs (using say Notepad++) before opening the file in PropTool.

    @rogersyd Please provided a link to: " There is an earlier demo i found that appears to be similar and works fine, so Ill stick with that one for now"

    Many thanks.

  • @kg1
    I'm wondering if the 5V signal is needed for that monitor.
    As a test, try enabling the ACC HDR 5V output, then plugging a jumper wire between one of the EVAL board 5V output pins and touching it to the 5V pad next to the HDMI socket on the Digital Video Out board.

    Later today I will also be able to confirm if it's needed or not. I know the breakout I used yesterday had the 5V attached, but can't recall just now if that monitor works both with and without 5V. Some require it, some don't.

    BTW. To enable the ACC HDR 5V output, there's a jumper on the EVAL board, close to the PC USB socket.

  • Hi @VonSzarvas @"Ken Gracey"
    Please ask Michael Mulholland the difference between the ex stock item:

    and the item used in the video:

  • Wuerfel_21Wuerfel_21 Posts: 4,448
    edited 2022-11-25 11:18

    @kg1 said:
    Could be the display is faulty?

    Not to be captain obvious, but have you tried just plugging it into your PC?

  • VonSzarvasVonSzarvas Posts: 3,275
    edited 2022-11-25 11:49

    Hi @kg1

    First... I am Michael from support! VonSzarvas is my forum alias.

    I got to the office and tested the adapter-- you do NOT need the 5V signal for the Parallax monitor.

    The difference in the two photos you showed is that I had soldered a standard 0.1" pitch 2way male header to the adapter (and plugged a green shunt jumper on top), so I could quickly connect/disconnect the shunt jumper (like on the EVAL board) to apply power to the monitor wake-up input if needed. (that is what that 5V pad behind the HDMI header does).

    That said, your version of the addon board is older than the version I had, and does not have the 2way pad holes. The newer (current) addon does have those pads for convenience. You can still solder a row of headers (or a single header) to the board you have though, and use a jumper wire from that 5V pad/pin to any 5V source on your EVAL board.

    But as I said... you don't need that 5V signal for your experiments with the Parallax monitor.

    For your monitor, I'm not convinced it's faulty as that's a pretty determined pattern output. So my next thought is that you are using the original P2-EC Edge module (and not the P2-EC32MB Edge Module). You need the 32MB version of the Edge module to run the video demos.

  • VonSzarvasVonSzarvas Posts: 3,275
    edited 2022-11-25 12:28

    @VonSzarvas said:
    For your monitor, I'm not convinced it's faulty as that's a pretty determined pattern output. So my next thought is that you are using the original P2-EC Edge module (and not the P2-EC32MB Edge Module). You need the 32MB version of the Edge module to run the video demos.

    Doh !

    Of course! You are using the EVAL board. As soon as I wrote that, I scrolled back in this thread and realised I had missed that detail before, being so focused on the code issue.

    All the video drivers we have so far need the 32MB Edge module. That memory is used (needed) to buffer and output the video graphics.

    It could be possible to use the HyperRAM addon for the EVAL board with some minor edits to the code. But for guaranteed compatibility you'd want to switch to the mini-breakout and P2-EC32MB module. The part numbers are all listed in that QuickByte article.

  • Hi @VonSzarvas Originally I purchased:
    https://parallax.com/product/p2-es-eval-board-accessory-set/
    which is still available for purchase today. Perhaps there should be a version 2:
    https://parallax.com/product/p2-eval-digital-video-out-add-on-board/
    I actually live on the other side of the moon in a country called New Zealand. During the past three years, purchasing product from the USA it takes forever. I have been waiting for articles like:
    https://parallax.com/video-hardware-character-map/
    for what seems like years!
    I have been very particular to include photos that show exactly what I have done. I even stated "My board is a Rev B?".
    Never mind: I generally purchase items well in advance:

    Please note the HyperFlash HyperRam in the photo. I wish to use this accessory, if possible, in this project. Sadly I am intellectually impaired due to old age. Do not be concerned, I am only 81. In 10 years of reading miles of scrambled information on this forum I have not improved my programming or electronic skills.
    Quote: "It could be possible to use the HyperRAM addon for the EVAL board with some minor edits to the code.".
    Are you willing to take a risk?
    Kevin.

  • @kg1 For something immediate, rogloh published a demo using the HyperRam board that you could run on your setup : https://forums.parallax.com/discussion/173218/psram-vs-hyperram-testing/p1

    @rogloh - could I ask if you have a version of hyperram/flash driver that's a drop-in replacement for the psram driver ?

    OBJ
        mem  : "psram"
        vid  : "p2videodrv"
    
  • Hi @VonSzarvas
    "For something immediate, rogloh published a demo using the HyperRam board that you could run on your setup : https://forums.parallax.com/discussion/173218/psram-vs-hyperram-testing/p1"

    I have not been able to find the demo.

    Also looked:
    https://forums.parallax.com/discussion/171176/memory-drivers-for-p2-psram-sram-hyperram-was-hyperram-driver-for-p2#latest

  • evanhevanh Posts: 15,171
    edited 2022-11-25 22:12

    Chip has a 800x480 HDMI spiral demo in the Pnut zip file that runs within the 512 kB of hubRAM ... looks like it's also in the PropTool examples too.
    Ah, you're using Flex, here's the code:

  • @evanh @VonSzarvas
    Thank you evanh: HDMI_Spiral_Demo_800x480.spin2 compiles and runs in proptool and flexprop:

  • @evanh
    VonSzarvas:
    "For something immediate, rogloh published a demo using the HyperRam board that you could run on your setup :

    Is there a demo using the HyperRam?

  • evanhevanh Posts: 15,171

    Here's one sitting in my collection from over two years back. I've had to remove the largest photo to make the zip file small enough to attach.

    It doesn't use either of Roger's drivers. Looks like Rayman wrote the whole thing.

  • kg1kg1 Posts: 164
    edited 2022-11-26 08:06

    @evanh Many thanks

  • Yes, thanks evanh. I don't have any ready-to-go HyperRam demos here.

  • To make this thread complete:
    Memory drivers for P2 - PSRAM/SRAM/HyperRAM (was HyperRAM driver for P2)
    https://forums.parallax.com/discussion/171176/memory-drivers-for-p2-psram-sram-hyperram-was-hyperram-driver-for-p2
    First page for files.
    @rogloh Thank you

  • evanhevanh Posts: 15,171
    edited 2022-11-26 23:33

    Also Roger's graphics driver as well - https://forums.parallax.com/discussion/170676/p2-dvi-vga-driver/p1
    The two drivers are built to cooperate.

    PS: I've not managed to dig through the complexities of his API myself.

  • @VonSzarvas said:

    @rogloh - could I ask if you have a version of hyperram/flash driver that's a drop-in replacement for the psram driver ?

    Not a drop in (yet). In time I still hope to rationalize all these driver variants so they would be drop in, and have started some of this work but it's not completed. The newer PSRAM can be accessed via a simpler driver wrapper vs the original HyperRAM board which still needs the complete memory driver which can support multiple heterogeneous memory devices with lots of APIs but is probably a little more complex to use. In the meantime however there is nothing stopping anyone from creating their own wrappers and communicating directly into the low level PASM driver with mailboxes etc. That mailbox interface stuff is reasonably well documented vs everything else right now. I think this is the solution that Wuerfel_21 used.

  • @Wuerfel_21
    rogloh: " In the meantime however there is nothing stopping anyone from creating their own wrappers and communicating directly into the low level PASM driver with mailboxes etc. That mailbox interface stuff is reasonably well documented vs everything else right now. I think this is the solution that Wuerfel_21 used."
    Hi Wuerfrl_21,
    If you have example code, may I have a copy please?
    Kevin

  • If by "example code" you mean "poopy excerpt ripped from production code", I can do that. Full thing is here: https://github.com/IRQsome/MegaYume/blob/master/megayume_upper.spin2

    Actually using the mailbox interface is easy.

    VAR
      long exmem_mailbox[8*3]
      long exmem_struct
      byte exmem_cog
    
    PRI exmem_sync()
    repeat while exmem_mailbox[0]
    
    PRI exmem_write(dst,src,length,async)
    exmem_sync()
    exmem_mailbox[2] := length
    exmem_mailbox[1] := src
    exmem_mailbox[0] := exmem.R_WRITEBURST + (dst & $fffffff)
    ifnot async
      exmem_sync()
    
    PRI exmem_fill(dst,val,length,async)
    exmem_sync()
    exmem_mailbox[2] := length
    exmem_mailbox[1] := val
    exmem_mailbox[0] := exmem.R_WRITEBYTE + (dst & $fffffff)
    ifnot async
      exmem_sync()
    
    PRI exmem_read(dst,src,length,async)
    exmem_sync()
    exmem_mailbox[2] := length
    exmem_mailbox[1] := dst
    exmem_mailbox[0] := exmem.R_READBURST + (src & $fffffff)
    ifnot async
      exmem_sync()
    

    Initializing it, uhhh, lets just say I do it in a rather complex way (partially because I also use custom embedded access routines and the setup has to match what those do). What I mean is: DO ANYTHING BUT THIS (relatedly, why am I mallocing exmem_struct when it could just be a VAR array????)

    CON ' copped from config.spin
    
    ' Enable one of these to select the exmem type to use
    #define USE_PSRAM16
    '#define USE_PSRAM8
    '#define USE_PSRAM4
    '#define USE_HYPER
    
    ' For PSRAM (either type)
    PSRAM_CLK = 56
    PSRAM_SELECT = 57
    PSRAM_BASE = 40
    PSRAM_BANKS = 1 ' Only used to stop further banks from interfering
    
    PSRAM_WAIT  = 5
    PSRAM_DELAY = 13
    PSRAM_SYNC_CLOCK = false
    PSRAM_SYNC_DATA = false
    
    ' Uncomment for slower memory clock
    '#define USE_PSRAM_SLOW
    
    ' For HyperRAM
    HYPER_ACCESSORY = 0 ' Base pin for P2EVAL HyperRAM board
    HYPER_CLK    =  8+HYPER_ACCESSORY
    HYPER_RWDS   = 10+HYPER_ACCESSORY
    HYPER_SELECT = 12+HYPER_ACCESSORY
    HYPER_BASE   =  0+HYPER_ACCESSORY
    HYPER_RESET  = 15+HYPER_ACCESSORY
    
    HYPER_WAIT  = 22
    HYPER_DELAY = 13
    HYPER_SYNC_CLOCK = false
    HYPER_SYNC_DATA = false
    
    #ifdef USE_PSRAM4
    #define USE_PSRAM_EITHER
    #endif
    #ifdef USE_PSRAM8
    #define USE_PSRAM_EITHER
    #endif
    #ifdef USE_PSRAM16
    #define USE_PSRAM_EITHER
    #endif
    
    OBJ
    #ifdef USE_PSRAM4
    exmem : "psram4drv-dualCE.spin2"
    #endif
    #ifdef USE_PSRAM8
    exmem : "psram8drv.spin2"
    #endif
    #ifdef USE_PSRAM16
    exmem : "psram16drv.spin2"
    #endif
    #ifdef USE_HYPER
    exmem : "hyperdrv.spin2"
    #endif
    
    CON
    #ifdef USE_PSRAM_SLOW
    PSRAM_TIMEOFFSET = 11 ' I guess???
    #else
    PSRAM_TIMEOFFSET = 9
    #endif
    
    PRI exmem_start() | tmp,cogs,banks
    
    ifnot exmem_struct
      exmem_struct := c.malloc(8*4+8*4+32*4)
    tmp := exmem_struct
    cogs := tmp+8*4
    banks := cogs+8*4
    
    if exmem_cog
      return
    
    long[tmp][0] := clkfreq
    #ifdef USE_HYPER
    long[tmp][1] := (HYPER_SYNC_CLOCK?0:1)<<exmem.UNREGCLK_BIT
    long[tmp][2] := HYPER_RESET < 32 ? 1<<HYPER_RESET : 0
    long[tmp][3] := HYPER_RESET >= 32 ? 1<<HYPER_RESET : 0
    #elseifdef USE_PSRAM_EITHER
    long[tmp][1] := (PSRAM_SYNC_CLOCK?0:1)<<exmem.UNREGCLK_BIT
    #ifdef USE_PSRAM_SLOW
    long[tmp][1] |= 1<<exmem.SLOWCLK_BIT | 1<<exmem.CLKSEL_BIT
    #endif
    long[tmp][2] := 0
    long[tmp][3] := 0 
    
    if PSRAM_BANKS > 1
      pinh((PSRAM_SELECT+1) addpins (PSRAM_BANKS-2))
    #endif
    
    #ifdef USE_PSRAM16
    long[tmp][4] := PSRAM_BASE
    #elseifdef USE_PSRAM4
    long[tmp][4] := PSRAM_BASE
    #elseifdef USE_HYPER
    long[tmp][4] := HYPER_BASE
    #endif
    long[tmp][5] := banks
    long[tmp][6] := cogs
    long[tmp][7] := @exmem_mailbox[0]
    
    long[cogs][0]:=-1<<16 + %1_111<<12
    longfill(cogs+4,-1<<16,7)
    longfill(banks,negx,32)
    
    #ifdef USE_PSRAM16
    long[banks][0] := 512<<16 + (PSRAM_DELAY-PSRAM_TIMEOFFSET)<<13 + (PSRAM_SYNC_DATA?0:1)<<12 + 22
    long[banks][16] := PSRAM_SELECT + PSRAM_CLK<<8
    #elseifdef USE_PSRAM8
    long[banks][0] := 256<<16 + (PSRAM_DELAY-PSRAM_TIMEOFFSET)<<13 + (PSRAM_SYNC_DATA?0:1)<<12 + 22
    long[banks][16] := PSRAM_SELECT + PSRAM_CLK<<8 + PSRAM_SELECT<<16
    #elseifdef USE_PSRAM4
    long[banks][0] := 128<<16 + (PSRAM_DELAY-PSRAM_TIMEOFFSET)<<13 + (PSRAM_SYNC_DATA?0:1)<<12 + 22
    long[banks][16] := PSRAM_SELECT + PSRAM_CLK<<8 + PSRAM_SELECT<<16
    #elseifdef USE_HYPER
    long[banks][0] := 128<<16 + (HYPER_DELAY-7)<<13 + (HYPER_SYNC_DATA?0:1)<<12 + 22
    long[banks][16] := HYPER_SELECT + HYPER_CLK<<8 + HYPER_RWDS<<16 + 6<<25 ' Latency????
    #endif
    
    exmem_mailbox[0] := -1
    cogs := exmem.getDriverAddr()
    exmem_cog := coginit(COGEXEC_NEW,cogs,tmp)+1
    repeat while exmem_mailbox[0] ' wait for init
    
    PRI exmem_stop()
    if exmem_cog
      exmem_sync()
      cogstop((exmem_cog\0)-1)
    
    
  • @Wuerfel_21 Thank you for the info you have provided. I will study your site at:
    https://github.com/IRQsome/MegaYume/blob/master/megayume_upper.spin2
    Much further and will try to complete tests with my hardware within the next two weeks.
    Kevin

Sign In or Register to comment.