Menu

PAL_Encoder module

Help
Lakis
2020-08-26
2021-01-28
  • Lakis

    Lakis - 2020-08-26

    Hi,
    I try the PAL module without success. Is any info help about the module and an example available?

     
  • Roy Rankin

    Roy Rankin - 2020-08-31

    I assume you are refering to PAL_video module. In the SVN source code in modules, you will find the files paltv-stim.stc and pal-tv-pp1.HEX. Running "gpsim pal-tv-pp1.HEX" looks a bit like PONG game simulation. I have take a quick look at the module src code "video.cc" but would need to dig deeper to understand what the module really does. If you gain understanding of this module, let me know.

    Roy Rankin

     
  • Lakis

    Lakis - 2020-08-31

    Yes i mean the PAL_Video module. I will see the examples and tell you. Thank you.

     
  • Lakis

    Lakis - 2020-08-31

    I cant find these files paltv-stim.stc and pal-tv-pp1.HEX. Can you provide a link? I will try the ponce game.

     
  • Roy Rankin

    Roy Rankin - 2020-08-31

    here is the other

     
  • Lakis

    Lakis - 2020-08-31

    Thank you, yes now i can see the video screen.
    I had tried the original pong with pic 16f84 and i got the first screenshot.
    I tried your files and got the second screenshot .
    It isnt so simple as i thought to connect lume and sync pins and make it work. I will study the stc file to understand it.

     
    • Paul S

      Paul S - 2021-01-24

      The pal-tv-pp1 code is mine, I have the source if you want.
      You will need to make sure you hook up the correct PINs to the Video (there
      is an audio line too)
      RA0 an RA1 connected with different resistors, to form the composite output.

      Paul S.

      On Mon, Aug 31, 2020 at 9:41 PM Lakis lakis007@users.sourceforge.net
      wrote:

      Thank you, yes now i can see the video screen.
      I had tried the original pong with pic 16f84 and i got the first
      screenshot.
      I tried your files and got the second screenshot .
      It isnt so simple as i thought to connect lume and sync pins and make it
      work. I will study the stc file to understand it.

       

      Last edit: Paul S 2021-01-26
      • Paul S

        Paul S - 2021-01-24

        Specifically - you attach RA0 (porta0) to lume, and RA1 (porta1) to sync
        Paul S.

         

        Last edit: Paul S 2021-01-26
  • Lakis

    Lakis - 2020-08-31

    Another small problem with the module PAL is that if you delete a node it makes segmentation fault.

    (gpsim:8090): Gtk-CRITICAL **: gtk_list_store_get_value: assertion `VALID_ITER (iter, list_store)' failed

    (gpsim:8090): GLib-GObject-WARNING **: gtype.c:4239: type id `0' is invalid

    (gpsim:8090): GLib-GObject-WARNING **: can't peek value table for type `<invalid>' which is not currently referenced</invalid>

    Segmentation fault

     
  • Lakis

    Lakis - 2021-01-24

    Hello,
    I havent yet tried it to a real TV only in gpsim. I run pong simulation with pal module. Look my screenshot3.jpg, the height of video is right but the width of the video is small. The same with 2.jpg i whitened the screen, video is about the 1/3 of screen. Do you know why?

     
    • Paul S

      Paul S - 2021-01-25

      Hi Lakis,
      What speed microcontroller in the sim are you using? 20MHz? 4MHz?
      The height would be based on the syncs (and number of lines) - but the
      width would be the timing (compared to standard).
      Paul S.

       

      Last edit: Paul S 2021-01-26
  • Lakis

    Lakis - 2021-01-25

    Hi
    Using (pic16f88) pal-tv-pp1.HEX and paltv-stim.stc, the simulation speed is 20Mhz, i tried again i cant get the full width of the screen.

     
    • Paul S

      Paul S - 2021-01-26

      I know why - the PAL_Video (video.cc) module is outputting pixels but one
      colour channel incrementing - so 10 bytes (say) gets folded into 3x3+1 byes
      (3 and a bit pixels) hence the red black white and cyan colours (should be
      white or black).

      Paul S.

       

      Last edit: Paul S 2021-01-26
      • Paul S

        Paul S - 2021-01-26

        I've made a minimal change to a copy of the code, changing three lines in
        modules/video.cc

        guint32 *p = (guint32 *)(data + (i*4 + y * stride));
        
        if (line[i] >= 4) {
            *p = 0xFFcfcfff;
        } else if (line[i] > 2) {
            *p = 0xFF7fff7f;
        } else {
            *p = 0xFF082010;
        }
        

        Basically changing to the RGBA (4 byte format) - and making sure opacity is
        0xFF

        It will work now:
        see [image: Screenshot from 2021-01-26 22-56-01.png]
        (I put analog simulation on porta2 to move the paddle around, and left it
        running for a while).

         

        Last edit: Paul S 2021-01-26
        • Paul S

          Paul S - 2021-01-26

          (formatting broke on that, resending)

          guint32 *p = (guint32 *)(data + (i*4 + y * stride));
          
          if (line[i] >= 4) {
              *p = 0xFFcfcfff;
          } else if (line[i] > 2) {
              *p = 0xFF7fff7f;
          } else {
              *p = 0xFF082010;
          }
          
           

          Last edit: Paul S 2021-01-26
  • Lakis

    Lakis - 2021-01-26

    Thank you, i will try it later

     
  • Lakis

    Lakis - 2021-01-27

    Hi,
    after a little odyssey i make it.
    I download first the r2553 change the files and compile it. it stops with error

    make[3]: *** No rule to make target `../modules/libgpsim_modules.la', needed by `gpsim'.  Stop.
    make[3]: Leaving directory `/root/Downloads/lakis/pic/gpsim/gpsim-code-r2553-trunk/gpsim'
    make[2]: *** [all] Error 2
    make[2]: Leaving directory `/root/Downloads/lakis/pic/gpsim/gpsim-code-r2553-trunk/gpsim'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/root/Downloads/lakis/pic/gpsim/gpsim-code-r2553-trunk'
    make: *** [all] Error 2
    

    i have done
    $ libtoolize
    $ aclocal
    $ autoheader
    $ automake --add-missing
    $ autoconf
    $ ./configure
    $ make

    do you know how to fix it?

    i use then the r2551 i already had and it compiles ok and use it. Thank you.

     
  • Paul S

    Paul S - 2021-01-28

    to solve that compile issue, I just:

    cd modules
    make
    cd ..
    make
    
     
  • Lakis

    Lakis - 2021-01-28

    Hello
    I did it and now the problem is libgpsim_extras.la
    somewhere is error paths?

     
  • Lakis

    Lakis - 2021-01-28

    i cd extras, make, cd .. make and it finishes ok
    i found the guilty, is the gpsim/Makefile
    i removed the reference to ../modules/libgpsim_modules.la \ and ../extras/libgpsim_extras.la \
    lines 76 and 250

     

    Last edit: Lakis 2021-01-28

Log in to post a comment.