AtomColour sync problems, tearing my hair out with this :(

discussion of games, software, hardware & emulators relating to the Acorn Atom and Acorn System machines.
Post Reply
Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Mon Feb 11, 2019 11:52 am

Hi all,

I'm really stuck with this, there is a problem with the AtomColour 5.x boards where the sync is lost momentarally leading to the video image jumping.
I generate the sync in the CPLD and have tried two methods so far both of which seem to exhibit this problem.

Method 1: Wait for /FS to go low and then count /HS pulses and generate the needed sync when the counter is between the required values.
Method 2: Wait for /FS to go low and then count video clock pulses and likwise generate the sync from this counter.

Both seem stable when the machine is just sitting there, but in some games : Acorn Invaders, Cowboy Shootout and Manic Miner wre the ones that I have found. The sync problem is experienced.

What seems to be happening is that the /HS or VCLK counter is missing counts (or possibly getting reset).

Anyone have any idea what could be causing it?

I'll upload an archive with the CPLD code, and schematics if anyone wants to take a look. A fresh pair of eyes might help.
AtomColourForStardot.zip
AtomColour files.....
(287.28 KiB) Downloaded 5 times
Cheers.

Phill.

User avatar
hoglet
Posts: 7807
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by hoglet » Mon Feb 11, 2019 12:50 pm

Hi Phill,

So far I've been unable to reproduce this on the board I build up (which is a 5.10 I think). But it may just be that my LG TV is very tolerant of malformed sync pulses.

What's the actual effect on the sync pulse if you put a scope on it? i.e. is it shorter or longer than normal, does its position change, or is it missing completely?

All I can imagine is that it's down to noise on a slow clock edge, so the CPLD sees two clock edges very close together. I had problems like this with the 1MHz clock regeneration circuit on the AP5 CPLD. In this case, just putting a scope problem on the clock close to the CPLD was sufficient to stop the failure. This was an example of what the CPLD was seeing (look at the final clock edge):
IMG_0921.JPG
Is the CPLD design you have just posted compatible with the 5.10 boards?

I'll try again to reproduce this later on today.

Dave

Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Mon Feb 11, 2019 3:41 pm

screen.png
AtomColour Syncs.
This is my scope trace of what is happening.
1:Yellow is latched HS xor FS
2:Cyan is the FS input. The scope is set to trigger on the falling edge of this signal
3:Magenta is the HS input
4:Blue is the generated sync signal.

This sync is in the approx correct** place, when the problem occours the inverted area of the outpus sync moves later (to the right), often shortening it (as it hits the end of /FS).

**Acording to the data sheet the /FS to the monitor should happen at the end of the /FS from the 6847, but I moved it earlier whilst testing to try and see what was going on. I'll move it to the correct place once I get it working.

Observations :

1) All the identified games where the problem occours are running in clear 4 mode (hi-res mono), colour set 0 with a mostly black screen.
2) It does seem to happen much more on a faster RAM chip.

Cheers.

Phill.

User avatar
hoglet
Posts: 7807
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by hoglet » Mon Feb 11, 2019 4:14 pm

Phill,

I've been thinking about this a bit more.

GIven the generated sync pulse moves to the right, that would suggest the counter is being un-intentionally reset,

This is your Verilog for FSCCount:

Code: Select all

always @(posedge VCLKOUT or posedge FS)
begin
  if (FS)
    FSCCount <= 14'b0;
  else
    FSCCount <= FSCCount +1;
end
The FS signal is being used as an asynchronous reset, so any noise that crosses the CPLD switching threshold will clear the counter.

Could you try this version which changes FS to a synchronous reset:

Code: Select all

always @(posedge VCLKOUT)
begin
  if (FS)
    FSCCount <= 14'b0;
  else
    FSCCount <= FSCCount +1;
end
Depending on the duration of the noise, this may be more reliable.

You might also want to try both polarities of VCLKOUT.

Another idea would be to add some noise filtering to FS.

Dave
Last edited by hoglet on Mon Feb 11, 2019 6:19 pm, edited 3 times in total.

Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Mon Feb 11, 2019 6:42 pm

Right,

I've tried the syncronous reset and it seems (crosses fingers) to be much better, though I've gone back to counting HS pulses. I'm sure this was the way it was origionally, however I've since implemented a 2 stage latched /hs and am using that as the clock for counting the pulses, as that's what you had done in your VHDL code.

Now to see if I can backport to the 5.1 board, I'll have to try using the 3.5MHz vidclk on that board as it doesn't have an onboard oscillator.

Cheers.

Phill.

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Mon Feb 11, 2019 6:49 pm

This is all sounding very encouraging.
Prime wrote:
Mon Feb 11, 2019 3:41 pm
1) All the identified games where the problem occurs are running in clear 4 mode (hi-res mono), colour set 0 with a mostly black screen.
On my machine one of the most badly-affected games is Flappy Bird, which is colour.

If the problem really is noise, what could the mechanism be for generating more noise when running specific games I wonder?
Last edited by jms2 on Mon Feb 11, 2019 6:49 pm, edited 1 time in total.

User avatar
hoglet
Posts: 7807
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by hoglet » Mon Feb 11, 2019 7:11 pm

jms2 wrote:
Mon Feb 11, 2019 6:49 pm
If the problem really is noise, what could the mechanism be for generating more noise when running specific games I wonder?
I think Phill has just proved that it is noise on the frame sync signal that is responsible.

There are likely two factors at play here: the timing of the noise and it's magnitude.

Only noise that occurs during the active low frame sync pulse is going to be significant (due to the way Phill's design works).

In terms of a possible mechanism, writing to the video RAM might be responsible for brief bus conflicts which can generate lots of noise. The magnitude of the noise will be affected by what is being written, and what was previously in the RAM. The more conflicting bits, the larger the noise spike.

I can easily imagine these factors together being very game specific.

Dave
Last edited by hoglet on Mon Feb 11, 2019 7:12 pm, edited 2 times in total.

Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Mon Feb 11, 2019 7:32 pm

jms2 wrote:
Mon Feb 11, 2019 6:49 pm
This is all sounding very encouraging.
Hopefully so....
On my machine one of the most badly-affected games is Flappy Bird, which is colour.

If the problem really is noise, what could the mechanism be for generating more noise when running specific games I wonder?
I'll give flappy bird a try, does it do it in the title screen or have you actually got to play the game as I'm completely crap at it.

Cheers.

Phill.

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Mon Feb 11, 2019 7:44 pm

You have to play it, but skill level is not relevant - the screen rolling goes berserk right from the start and the game is unplayable!

User avatar
trixster
Posts: 733
Joined: Wed May 06, 2015 11:45 am
Location: York
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by trixster » Mon Feb 11, 2019 9:35 pm

I can confirm that my atom with iss 5.1 board also displays the video image jumping issue with certain games. The ones i've tried so far which display the problem are Flappy Birds (sometimes on the menu but definitely in-game, although i dont get the rolling that jms2 describes), Manic Miner, Jet Set Willy 1 (in the title menu but not in-game), and the Clear 4 version of Bad Apple. I haven't tried any other games yet.
A3020 | A3000 | A420/1 | BBC B 128K RAM/ROM 20K Shadow Pi0 VideoNuLA
Master Turbo DC BeebSID | Atom | A4000 060 | A3000 060 | A1200 060 | A500
Atari Falcon 060 | Saturn | PS1 | SNES | CPC6128 | C64 | 3DO | MD | Jaguar | X68000

Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Mon Feb 11, 2019 9:42 pm

Hi all,

If you have the ability to re-program the CPLD, then try this set of firmware it hopefully will fix the sync issues in the 5.10 board.

I've tested with Acornsoft Invaders & Flappy bird, and both seem fine.

Let me know how you get on.
AtomColour-5.10-2019-02-11.zip
AtomColour 5.10 CPLD firmware.
(763.06 KiB) Downloaded 8 times
Cheers.

Phill.

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Mon Feb 11, 2019 9:58 pm

This is great news!

I can do it... just need to remember how!

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Wed Feb 13, 2019 9:16 pm

OK I've found the correct programming cable and plugged it into the colour board, so the hardware side is ready to go. The Xilinx software is confusing me though...

Last time I had a .jed file which I programmed into the board using Impact. This time, there isn't a .jed file in the latest archive, but even if there was, Impact seems only able to load .cpf or .ipf files anyway. And there aren't any of those.

So I'm thinking I have to compile the .jed file using Xilinx ISE. But this only loads .ise project files, which I don't have any of either!

I think it's possible to load verilog (.v) files and I do vaguely recollect that these compile to .jed files - but which one to I need to load as there are several. I'd guess main.v?

Please can I have some guidance... I don't know how I managed to do this last time, I've checked through the old thread and all my queries were about the hardware side, not the software!

User avatar
hoglet
Posts: 7807
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by hoglet » Wed Feb 13, 2019 9:28 pm

jms2 wrote:
Wed Feb 13, 2019 9:16 pm
Last time I had a .jed file which I programmed into the board using Impact. This time, there isn't a .jed file in the latest archive, but even if there was, Impact seems only able to load .cpf or .ipf files anyway. And there aren't any of those.
There is a file Main.jed in Phill's zip.

Impact can work with this, you just skip the project loading bit.

Some detailed notes here:
https://github.com/hoglet67/RGBtoHDMI/w ... rogramming

Dave
Last edited by hoglet on Wed Feb 13, 2019 9:29 pm, edited 1 time in total.

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Wed Feb 13, 2019 10:16 pm

Nice one Dave... so it's main.jed in Impact, and start with "Boundary Scan".

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Wed Feb 13, 2019 10:53 pm

...it worked! I remember being really surprised the first time, because out of a set of controls that look like they might drive a nuclear power station, you click on one and it pretty much instantly completes the job!

And the good news doesn't stop there, because the new software has fixed the screen sync problem! =D> =D> =D>
So far only tested Flappy Bird and Cowboy Shootout, but they are both perfect! :D

Well done to Phill and Dave, I hope you both have some hair left ( I don't but its nothing to do with Atoms )

User avatar
DutchAcorn
Posts: 1979
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by DutchAcorn » Thu Feb 14, 2019 5:19 am

This looks really good! I’ll get my Atom out over the weekend and see if I can also remember how to program the video card... :D
Paul

Image

Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Thu Feb 14, 2019 9:41 am

jms2 wrote:
Wed Feb 13, 2019 10:53 pm
...it worked! I remember being really surprised the first time, because out of a set of controls that look like they might drive a nuclear power station, you click on one and it pretty much instantly completes the job!
Yeah the Xilinx software is a little like that, what is a reall pain in the ass is that you have to download the whole several gigabytes of it just to get the impact programmer :(
And the good news doesn't stop there, because the new software has fixed the screen sync problem! =D> =D> =D>
So far only tested Flappy Bird and Cowboy Shootout, but they are both perfect! :D

Well done to Phill and Dave, I hope you both have some hair left ( I don't but its nothing to do with Atoms )
Excellent, thanks for the feedback, I can hopefully mark this bug as fixed then :) I have a version of the firmware I have passed to Kees who has one of the 5.40 test boards, and it's fixed on the 4.70 boards. Need to get a small run of 4.80 boards made to test, then hopefully I'll be a lot more happy with the design.

Cheers.

Phill.

Prime
Posts: 2659
Joined: Sun May 31, 2009 11:52 pm
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by Prime » Thu Feb 14, 2019 9:42 am

DutchAcorn wrote:
Thu Feb 14, 2019 5:19 am
This looks really good! I’ll get my Atom out over the weekend and see if I can also remember how to program the video card... :D
Be careful, the above posted firmware is for the 5.10 board, but if you have one of those you should be good to go.

Cheers.

Phill.

User avatar
DutchAcorn
Posts: 1979
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by DutchAcorn » Thu Feb 14, 2019 8:13 pm

Prime wrote:
Thu Feb 14, 2019 9:42 am
DutchAcorn wrote:
Thu Feb 14, 2019 5:19 am
This looks really good! I’ll get my Atom out over the weekend and see if I can also remember how to program the video card... :D
Be careful, the above posted firmware is for the 5.10 board, but if you have one of those you should be good to go.

Cheers.

Phill.
Yes, I have the 5.10. But it was over a year since I used Xilinx Impact and I now get an error that it can't find the cable. The led is green, and windows device manager shows the cable. I tried reinstalling the driver (64 bit), but no luck. :(

The console shows "Source driver files not found."
Paul

Image

User avatar
jms2
Posts: 2141
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by jms2 » Thu Feb 14, 2019 11:23 pm

Are you using a proper USB JTAG cable? I'm not, just a lashup attached to the parallel port, so drivers etc are not needed.

User avatar
oss003
Posts: 2851
Joined: Tue Jul 14, 2009 11:57 am
Location: Netherlands
Contact:

Re: AtomColour sync problems, tearing my hair out with this :(

Post by oss003 » Fri Feb 15, 2019 7:00 am

It works for my 5.4 board without latch.

Great job guys ...... =D>

Greetings
Kees

Post Reply