Shop OBEX P1 Docs P2 Docs Learn Events
Flickering video after a few software mods — Parallax Forums

Flickering video after a few software mods

Hi All,
Crazy question for the day: Has anyone had a problem with their video flickering when their memory use gets tight? I was working on my project, and the customer noticed that the display flickers noticeably. I am not sure what, if anything, could cause this. There are a lot of calls to modify the display, so if there some problems if the display is modified during a frame?

Just curious to see if anyone else has seen this type of problem. I am using STDTV for the output...

Comments

  • If you are wondering what I define as flickering, there are several bar graphs on the display. about every second or so, one of more of them just kind of flicker, like they were not drawn for a frame or two. Not all at once, but individually!
  • As I just mentioned, in your other thread, when memory gets tight, the Spin interpreter ends up writing over part of your code. Once this starts happening all sorts of weird things start to occur.
  • Yeah, I know that I need to leave at least 144 longs for the stack, or things go into la-la land. The flickering seems to be something else. I wonder if is somehow trying to recalculate the values during the display time, and sometimes the values aren't ready yet?
  • Hack static values in and see if the flicker persists.

    If it does, you may need to rethink the draw code and how or if it gets buffered.

    If it does not, then your program is out of sync with your draw routines.
  • I had that happen a few times. when memory got tight. Try organizing your VAR & CON values from High to low and in even pairs. Start with 32 bit, 16 bit, then 8 bit names. You may have to adjust & test the variable orders, sometimes even adding a dummy value to make it even up. Don't understand why it works but it does.
  • You do not need to organize your memory allocation in the VAR section from longs to words to bytes. The compiler does that for you. But, yes, in the DAT (not CON) section, you need to be smart about arranging variable order to maximize memory usage.

    -Phil
  • PropGuy2 wrote: »
    even adding a dummy value to make it even up. Don't understand why it works but it does.

    There was something else going on if adding a dummy value made things work.

    If you forget to add an "org" statement to the beginning of a PASM section or you pass a byte or word address as the "par" register, then adding dummy values can end up masking these issues and your program will run correctly.

    If you find yourself adding dummy values I think it's a safe bet to assume there's some other problem in the program your dummy values are masking.

Sign In or Register to comment.