Shop OBEX P1 Docs P2 Docs Learn Events
Fix for VGA displays running GCC in external memory — Parallax Forums

Fix for VGA displays running GCC in external memory

Dr_AculaDr_Acula Posts: 5,484
edited 2014-03-15 18:38 in Propeller 1
There is a timing problem when using VGA display code ported to GCC. The problem only comes up when running GCC from external ram, eg serial spi ram chips.

The discussion that led to this is on this thread http://forums.parallax.com/showthread.php/152730-spin2cpp-version-1.05

The problem is that the display takes several minutes to start, and this give the initial impression that the code is not running.

The fix is to increase a timing delay. For example, in the VGA 80x40 object in the obex there is this code in the startup method
  'implant pin settings
  reg_vcfg := $200000FF + (BasePin & %111000) << 6
  i := $FF << (BasePin & %011000)
  j := BasePin & %100000 == 0
  reg_dira := i & j
  reg_dirb := i & !j

  'implant CNT value to sync COGs to
  sync_cnt := cnt + $10000

The last line needs the $10000 value increased. $20000 does not work. $40000 works, and to be safe, suggest change to $80000

This will then work if the spin code is run through a spin to C converter such as spin2cpp. It does not appear to introduce any unwanted delay when running Spin code.

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2014-03-15 18:13
    Dr_Acula wrote: »
    This will then work if the spin code is run through a spin to C converter such as spin2cpp. It does not appear to introduce any unwanted delay when running Spin code.
    It's still ugly. Under these circumstances a better solution would be to have the start method sync the cogs manually but maybe that's just me.
  • jazzedjazzed Posts: 11,803
    edited 2014-03-15 18:38
    Have you tried David's SpinWrap program? It uses an extra COG, but it allows calling SPIN from C/C++. I've tested some small programs with it. It will run the TV_Text_Demo.spin program, no problem.
Sign In or Register to comment.