Shop OBEX P1 Docs P2 Docs Learn Events
Assistance requested for new Catalina VGA plugin — Parallax Forums

Assistance requested for new Catalina VGA plugin

Hi all,

I will soon release Catalina 4.2, with a new HMI (Human/Machine Interface) plugin. This will provide Catalina P2 support for VGA screen, USB keyboard and USB mouse, at various resolutions and color depths. The Catalina plugin is based on variants of eric's VGA tile driver and garryj's USB driver. The new P2 HMI plugin will be largely compatible with the same Catalina plugins for the P1(which were themselves based on Parallax's original drivers for the P1).

However, I have had some issues getting the VGA tile driver to work at 1024x768 resolution. I have "tweaked" it by trial and error to work on my monitor, but it only works on my monitor if I use non-standard timings, so I am not sure if it will work on all monitors.

Can anyone with a P2_EVAL board and accessory set please run the test programs and tell me if they work on your VGA monitors, and with your USB keyboards and mice (one thing I already know is that the USB keyboard and mice have to be plugged in directly - i.e. you cannot use a USB hub).

Here is a copy of the README, included in the zip file:
These test programs have been compiled to test Catalina's new VGA HMI Plugin, 
which incorporates VGA, Keyboard and Mouse drivers. These programs have been
compiled for the P2_EVAL board, using the P2-ES Eval accessory boards. 

The programs expect the accessory boards to be connected to the P2_EVAL board
as follows:

   The A/V board plugged into the header with base pin 32

   The Host Serial (USB) board plugged into the header with base pin 40

There are four program binaries provided - two for rev A P2 chips, and two for
rev B chips:

   test_term_rev_A.bin : test vga, keyboard & mouse @ 640x480 (rev A chip) 

   test_term_rev_B.bin : test vga, keyboard & mouse @ 640x480 (rev B chip)

   test_vga_rev_A.bin  : test vga & keyboard (no mouse) @ 1024x78 (rev A chip)

   test_vga_rev_B.bin  : test vga & keyboard (no mouse) @ 1024x78 (rev B chip)

The keyboard and/or mouse can be plugged into either USB port.

I'd particularly like to hear from you if the vga test program does NOT run on your VGA monitor!

Thanks!

Comments

  • RaymanRayman Posts: 14,646
    Looks a little off here on Rev.B…

    Mouse/KB doesn't see to work with VGA example. And, there's something wrong at bottom of screen.
    KB does work with term example, but horizontal alignment is off.

    4032 x 3024 - 1M
    4032 x 3024 - 2M
  • RossHRossH Posts: 5,462
    Rayman wrote: »
    Looks a little off here on Rev.B…

    Mouse/KB doesn't see to work with VGA example. And, there's something wrong at bottom of screen.
    KB does work with term example, but horizontal alignment is off.

    Thanks! This is exactly what I was afraid of :(

    Attached is another version of the VGA test program with the timing returned to the VESA standard. This does not work on my monitor (the top is clipped) but it may work better on yours.

    The VGA test program doesn't use the mouse, just the keyboard. Is the keyboard working?

    Ross.
  • RossHRossH Posts: 5,462
    And here is another version of the term test program, with the timing returned to standard. I don't think it will make any difference, but it is worth a try ...

    Also, does your monitor have an "auto-adjustment" feature? If so, can you try using it to see if that helps?

    Thanks again.

  • roglohrogloh Posts: 5,787
    edited 2020-06-27 02:13
    RossH.

    Your second version of your VGA demo (test_vga_B2) works on my Dell monitor with a USB keyboard. Reported as 1024x768 60Hz. I see all 48 rows.

    Your first version VGA demo (test_vga_rev_B) timing looks weird and my monitor detected it as 1360x768 60Hz and stretched it. USB keyboard worked.

    Your first version term demo (test_term_rev_B) worked with USB mouse & keyboard but some scanlines were chopped off at the top and a bottom row seems to be black not blue. Video timing looks a little off there. Reported as 640x480 60Hz.
  • evanhevanh Posts: 15,916
    edited 2020-06-27 02:13
    test_term_rev_B.bin: Keyboard and mouse works, good
    - On 16:10 monitor - thinks it's 640x480, good
    - On 16:9 TV - thinks it's 640x480, good
    - On 4:3 monitor - thinks it's 640x480, good. Image shifted up, centred it okay

    test_vga_rev_B.bin: Keyboard works, good
    - On 16:10 monitor - thinks it's 1366x768, not good
    - On 16:9 TV - thinks it's 1024x768, good
    - On 4:3 monitor - thinks it's 1024x768, good. Image shifted up, centred it okay

  • roglohrogloh Posts: 5,787
    edited 2020-06-27 02:10
    You will find the USB driver code doesn't like to operate at different frequency to what it was compiled for. Either the USB keyboard or mouse won't work once the frequency is changed from its default. One USB device works much better than the other (but I can't recall which fails first). I encountered this with my own drivers. It's currently a problem because you need to code statically for a single operating frequency and if different video modes use different PLL frequencies determined at runtime you will hit this issue with the P2 USB driver.

    There was a thread discussing this, with the hope to get the USB driver to operate at a runtime determined frequency and from memory I think @AJL even did some early work to try to help @garryj with the timeout calculations once he gets a chance to take another look at this.
  • RossHRossH Posts: 5,462
    Thanks for the responses. It seems (as I half expected) that I should issue the release with the standard VESA timings, and with instructions on how to "tweak" them for specific monitors as required. I will include my own "tweaks" as an example should anyone else have the same problem.

    On the clock frequency issue - yes, with the current plugin design various things will fail in both the USB and VGA drivers if you change the clock frequency at run time. Perhaps the Propeller 3 should allow for each cog to run at a different frequency! :)

    Ross.


  • I have an old 12" Coby monitor that I use for P2 video and the term and vga revB files both worked. The monitor identified 640x480 and 1024x780. It's "auto" feature got pretty close, but a little manual tweaking made it better.

    @rogloh, I've been moving at a snail's pace on the USB kbd/mouse improvements, but I can finally see a light at the end of the tunnel. Dynamic sysclock changes and USB on P2 can get along!
    All sysclock related calculations are in registers and USB suspend, resume and reset are now functional. There is a method that takes the new frequency and clockmode values and if there is a USB device connected, the bus will be suspended while the sysclock is getting changed and when that completes, the USB will be resumed and it will detect the new frequency and recalculate all NCO and timing values. If no device is connected, there is no need for suspend/resume as in the "connect wait" state it looks for a sysclock change and put the usb in the idle state while it recalculates.

    The code is still a mess, but I'm hoping to get it cleaned up and the demo out in the next few days. It runs on P2 revs A/B, though revA doesn't work as smoothly as revB when it comes to changing the NCO and sometimes the bus will stall. If that happens you need to follow up with a "hard" bus reset to get things going again.
  • RossHRossH Posts: 5,462
    garryj wrote: »
    I have an old 12" Coby monitor that I use for P2 video and the term and vga revB files both worked. The monitor identified 640x480 and 1024x780. It's "auto" feature got pretty close, but a little manual tweaking made it better.

    Good to hear - thanks. I actually think the older monitors tend to be more "forgiving" on timing issues.
  • Hi Ross! What frequency are you running your demos at? My VGA text driver requires a fairly high clock frequency for 1024x768: twice the pixel clock (130 MHz) for monochrome only, 3 times the pixel clock (195 MHz) for full color, and 4 times the pixel clock (260 MHz) for 8bpp and 4bpp color. It's mentioned in the documentation but kind of buried (I need to bring it out more) so it's not surprising if you misssed that.

    If you're running at Catalina's default 180 MHz then I suspect full color will be very close to working and might even work on some monitors but not others. It might be possible to tweak the timings a bit to get full color to work; you'll need to reduce the pixel clock from 65 MHz down to 60 MHz.
  • RossHRossH Posts: 5,462
    edited 2020-06-27 12:13
    ersmith wrote: »
    Hi Ross! What frequency are you running your demos at? My VGA text driver requires a fairly high clock frequency for 1024x768: twice the pixel clock (130 MHz) for monochrome only, 3 times the pixel clock (195 MHz) for full color, and 4 times the pixel clock (260 MHz) for 8bpp and 4bpp color. It's mentioned in the documentation but kind of buried (I need to bring it out more) so it's not surprising if you misssed that.

    If you're running at Catalina's default 180 MHz then I suspect full color will be very close to working and might even work on some monitors but not others. It might be possible to tweak the timings a bit to get full color to work; you'll need to reduce the pixel clock from 65 MHz down to 60 MHz.

    At 1024x768 resolution, I use 260Mhz for the 4 bit and 8 bit color modes. The 1 bit and 24 bit color modes seems to work ok at either 195Mhz or 200Mhz, and everything else works fine at 180Mhz. Catalina's default clock speed is still 180Mhz, but I have made 200Mhz and 260Mhz configurable on the command line.

    Ross.
  • RossH wrote: »
    ersmith wrote: »
    Hi Ross! What frequency are you running your demos at? My VGA text driver requires a fairly high clock frequency for 1024x768: twice the pixel clock (130 MHz) for monochrome only, 3 times the pixel clock (195 MHz) for full color, and 4 times the pixel clock (260 MHz) for 8bpp and 4bpp color. It's mentioned in the documentation but kind of buried (I need to bring it out more) so it's not surprising if you misssed that.

    If you're running at Catalina's default 180 MHz then I suspect full color will be very close to working and might even work on some monitors but not others. It might be possible to tweak the timings a bit to get full color to work; you'll need to reduce the pixel clock from 65 MHz down to 60 MHz.

    At 1024x768 resolution, I use 260Mhz for the 4 bit and 8 bit color modes. The 1 bit and 24 bit color modes seems to work ok at either 195Mhz or 200Mhz, and everything else works fine at 180Mhz. Catalina's default clock speed is still 180Mhz, but I have made 200Mhz and 260Mhz configurable on the command line.

    Ross.

    I've added all the above frequencies to my USB test list and no issues popped up. This is the list I'm currently using and if anyone uses one that's not there, let me know:
      sysclocks     long 80_000_000,  96_000_000,  108_000_000, 130_000_000, 148_000_000, 148_500_000, 148_750_000
                    long 160_000_000, 168_000_000, 180_000_000, 192_000_000, 195_000_000, 200_000_000, 240_000_000
                    long 252_000_000, 260_000_000, 270_000_000, 288_000_000, 297_000_000, 300_000_000, 0
      clkmodes      long $100070B,    $1102F0B,    $1101AFB,    $1040CFB,    $11024FB,    $19D28FB,    $13C76FB
                    long $10007FB,    $11029FB,    $10008FB,    $1102FFB,    $10C26FB,    $10009FB,    $1000BFB
                    long $1103EFB,    $1000CFB,    $1041AFB,    $11047FB,    $14D28FB,    $1000EFB
    
  • evanhevanh Posts: 15,916
    edited 2020-06-27 22:14
  • garryj wrote: »
    I've added all the above frequencies to my USB test list and no issues popped up. This is the list I'm currently using and if anyone uses one that's not there, let me know:
      sysclocks     long 80_000_000,  96_000_000,  108_000_000, 130_000_000, 148_000_000, 148_500_000, 148_750_000
                    long 160_000_000, 168_000_000, 180_000_000, 192_000_000, 195_000_000, 200_000_000, 240_000_000
                    long 252_000_000, 260_000_000, 270_000_000, 288_000_000, 297_000_000, 300_000_000, 0
      clkmodes      long $100070B,    $1102F0B,    $1101AFB,    $1040CFB,    $11024FB,    $19D28FB,    $13C76FB
                    long $10007FB,    $11029FB,    $10008FB,    $1102FFB,    $10C26FB,    $10009FB,    $1000BFB
                    long $1103EFB,    $1000CFB,    $1041AFB,    $11047FB,    $14D28FB,    $1000EFB
    

    250, 320 and 325MHz might be good to include.
  • Added. Thanks!
Sign In or Register to comment.