480i (576i) to 240p (288p) sync converter (Extron RGB alt.)

The place for all discussion on gaming hardware
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

480i (576i) to 240p (288p) sync converter (Extron RGB alt.)

Post by dooklink »

Here is a little circuit I've been working on to do 15Khz interlaced to progressive sync conversion. I started this as I was unhappy with my Extron RGB 109xi on my BVM2010p. I had to shift the image to the right, and then shift it back on the BVM to get progressive from an Xbox360 480i Scart signal. The Extron units are becoming quite popular, but results vary a lot, so I hope someone can make this into cheap product.

I wanted to try and build a cheap alternative that did the sync conversion properly, instead of just by chance. Hopefully this means that my solution will work with some video processors and digital chassis CRTs, but I need others to verify this.

Circuit
The circuit I have design uses two sync stripping circuits, two 7400 series logic chips and an atmega328 based Arduino. The LM1881 outputs an Odd/Even signal into a digital input of the Arduino and a Vsync pulse into one of the Arduino external interrupt pins. An Intersill ISL59885 sync splitter outputs a pure Hsync with no 2*H component from the serration or equalising pulses. The pure Hsync is also feed into a external interrupt pin, as well as sent into one of the mux inputs. Another mux input is feed an inverted version of the pure Hsync from the inverter. The Hsync and Inverted Hsync are selected with a digital high or low from the Arduino via the mux.

What all of this means is that A sync signal is reconstructed to look as close as possible to a standard progressive sync signal. It also means that the alignment of the two fields can be swapped. What that means is you can move the image up and down vertically by changing when the Vsync is inserted. Not only that, but you can offset the individual odd and even fields to move one up or down independent of the other. This can be useful on proper interlaced games as you can choose where the flicker will appear. It is quite hard to describe this in words though.

IC Component List:
  • LM1881 sync stripper (for ODD/EVEN field detect)
  • ISL59885 sync stripper (for pure Hsync)
  • ATmega328p (Arduino)
  • 74HC04 Hex Inverters (Or 74HC14 Schmitt Trigger Inverters)
  • 74HC151 8-to-1 Multiplexor (Or any 3+ to 1 Mux)
Here is how my prototype is setup:
Edit: Basic circuit diagram below.
Image

Here is a basic diagram of how this is connected. The Atmega328p pins are the same as Arduino Uno digital pins 2-8.
(A single TI LMH1980 Sync Chip could replace both the LM1881 and ISL59885 as it has both Odd/Even and Hsync out)
Image


Arduino Code
My code is design to be used with two push switches. This could (and should) be improved to use multiple selection switches instead. The code selects between a few options:
  1. Turn processing on/off (bypass processing)
  2. Swap odd/even field alignment
  3. Shift image up
  4. Shift image down
And here is my Arduino sketch:
EDIT: I've update this to solve the Vsync jitter issue by disabling timer0. Also, the code now auto switches to remove the offset when a signal swaps between interlaced and progresive. Note that 576i usally requires no offset, while 480i usally requires the offset turned on, so you still need to manually change this when switching between NTSC and PAL timings. I have no solution for this at the moment.
Spoiler
Arduino Sketch

Code: Select all

// Sync Processor Arduino Code
//
// 480i to 240p sync processor for use with LM1881 and ISL59885.
// Or any sync cleaners/strippers with hsync, vsync and odd/even field outputs.
// Signal remuxed with 74HC151 logic mux or similar from hsync and inverted hsync.
//
// Author: Duane (Dooklink) Cook 
// Date:   2014.12.07

// Power reduction / Hardware disable code from  Nathan Seidle, Spark Fun Electronics 2011
// Delays assume 8MHz clock, but timing is not critical here for button polling
#include <avr/power.h> //Needed for powering down perihperals such as the ADC/TWI and Timers

volatile unsigned char vCount = 0;
volatile char vFlag = false;
volatile unsigned int delayCountA = 0;
volatile unsigned int delayCountB = 0;
volatile char field = true;
char offsetSetting = true;
unsigned int delaySetting = 0;
char buttonMode = 0;
char buttonDelta = true;
char forceProgressive = true;
char interlacedSignal = true;
char previousField = false;
char fieldCheckCount = 0;
char fieldSwapCount  = 0;

/***************************************************
            Arduino setup function
****************************************************/

void setup()
{
  // To reduce power, setup all pins as inputs with no pullups
  for(int x = 1 ; x < 18 ; x++){
    pinMode(x, INPUT);
    digitalWrite(x, LOW);
  }
  pinMode(2, INPUT);          // Vsync interrupt pin
  pinMode(3, INPUT);          // Hsync interrupt pin
  pinMode(4, INPUT);          // Odd/Even field input pin
  pinMode(5, OUTPUT);         // Mux control pin bit 2 - HIGH -> bypass, LOW -> Hsync/not(Hsync)
  pinMode(6, OUTPUT);         // Mux control pin bit 3 - HIGH -> Hsync, LOW -> not(Hsync)
  pinMode(7, INPUT_PULLUP);   // Switch 1 input - select button 2 mode
  pinMode(8, INPUT_PULLUP);   // Switch 2 input - bypass/forceprogressive, line offset on/off, vshift up, vshift down
  
  attachInterrupt(0, vSync, FALLING );  // Pin 2 - vSync in
  attachInterrupt(1, hSync, FALLING );  // Pin 3 - hSyncn in
  digitalWrite(5, LOW);                 // Force progressive
  digitalWrite(6, HIGH);                // Select Hsync to begin with
  
  ADCSRA &= ~(1<<ADEN); //Disable ADC
  ACSR = (1<<ACD); //Disable the analog comparator
  DIDR0 = 0x3F; //Disable digital input buffers on all ADC0-ADC5 pins
  
  // Buffers are still required for external interupt pins for now
  //DIDR1 = (1<<AIN1D)|(1<<AIN0D); //Disable digital input buffer on AIN1/0
  
  power_twi_disable();
  power_spi_disable();
  power_usart0_disable();
  power_timer0_disable(); // Normally for delay_ms(), removes competing interrupt
  power_timer1_disable();
  power_timer2_disable();
  
  sei(); //Enable global interrupts
}

/***************************************************
            Arduino loop function
****************************************************/

void loop()
{
  fake_msdelay(25);  // Replaces timer driven delay()
  
  field = !digitalRead(4);
  
  if ( field != previousField )
  {
    fieldSwapCount++;
  }
  previousField = field;
  fieldCheckCount++;
  
  if (fieldSwapCount > 1)
  {
    interlacedSignal = true;
    fieldSwapCount = 0;
    fieldCheckCount = 0;
  }
  else if (fieldCheckCount > 5)
  {
    interlacedSignal = false;
    fieldSwapCount = 0;
    fieldCheckCount = 0;
  }
      
  if (!digitalRead(7) || !digitalRead(8) )
  {
    if (!digitalRead(8) && forceProgressive)
    {
      if (!buttonDelta)
      {
        buttonMode++;
	buttonMode = buttonMode % 4;
      }
      buttonDelta = true;
    }
    
    if (!digitalRead(7))
    {
      if (!buttonDelta)
      {
        switch (buttonMode)
	{
	case 0:
          if (forceProgressive)
          {
            detachInterrupt(0);
            detachInterrupt(1);
            digitalWrite(5, HIGH);
            forceProgressive = false;
          }
          else
          {
            attachInterrupt(0, vSync, FALLING ); // Pin 2 - vSync
            attachInterrupt(1, hSync, FALLING ); // Pin 3 - hSync
            digitalWrite(5, LOW); // Force progressive
            forceProgressive = true;
          }
          break;
        
        case 1:
          offsetSetting = !offsetSetting;      
          break;
        
        case 2:
          delaySetting++;
          if (delaySetting > 349)
            delaySetting = 0;
          break;
        
        case 3:
          if (delaySetting == 0)
            delaySetting = 350;
          delaySetting--;
          break;
        
        default:
          break;
        }
      }
      buttonDelta = true;
    }
  }
  else
  {
    buttonDelta = false;
  }
}


/***************************************************
            Interrupt Service Routines
****************************************************/

void vSync()
{ 
  if (field == LOW)
  {
    if (offsetSetting && interlacedSignal)
    {
      delayCountA = delaySetting +1;
    }
    else
    {
      delayCountA = delaySetting;
    }
    field = HIGH;
  }
  else
  {
    delayCountB = delaySetting;
    field = LOW;
  }
}

  
void hSync()
{
  if (delayCountA == 0 || delayCountB == 0)
    vFlag = true;
  
  if (vFlag)
  {
     if (vCount < 3)
    {
      digitalWrite(6 ,LOW);
      vCount++;
    }
    else
    {
      digitalWrite(6 ,HIGH);
      vCount = 0;
      vFlag = false;
    }
  }
  delayCountA--;
  delayCountB--;
}

/***************************************************
            Replacement Delay Routines
****************************************************/

// This is a not-so-accurate delay routine
// Calling fake_msdelay(100) will delay for about 100ms
// Assumes 8MHz clock
void fake_msdelay(int x){
  for( ; x > 0 ; x--)
    fake_usdelay(1000);
}

// This is a not-so-accurate delay routine
// Calling fake_usdelay(100) will delay for about 100us
// Assumes 8MHz clock
void fake_usdelay(int x){
  for( ; x > 0 ; x--) {
    __asm__("nop\n\t"); 
    __asm__("nop\n\t"); 
    __asm__("nop\n\t"); 
    __asm__("nop\n\t"); 
    __asm__("nop\n\t"); 
    __asm__("nop\n\t"); 
    __asm__("nop\n\t"); 
  }
}
Results & Sync Signal Description

The LM1881 datasheet shows a good example of what an interlaced sync signal should look like:
Image

I have been using an analogue CRO scope to analyse the sync signals. On analog scopes the signal is displayed differently when using one or two inputs. When using one input, an interlaced sync signal is displayed starting at the Vsync point. This is the start of the serration pulses, just after the pre equalising pulses.
Image

It is quite hard to see the transition from the post equalising pulses into the standard Hsync periods. This is due to both odd and even fields being displayed on top of one another. When most analogue scopes are switched to display two inputs, each input displays only one field, either odd or even. In the example below section 1 shows the serration pulses, section 2 the post-equalising pulses and section 3 the start of the video field. Note that the start of the video field has no active video as it is the start of the 525(625 in PAL) lines not the active the 480(576 in PAL) lines.
Image

The vertical red lines show how the odd and even fields are offset by half of the Hsync period. What can also be seen is that the vertical blanking interval (VBI) contains 2*Hsync pulses. The next image shows one field of the same interlaced sync, and then one field of my processed sync signal. The red line still shows that there is an offset between the odd and even fields, however, the 2*Hsync VBI is gone. Now we have progressive sync!
Image

It is also worth noting that the offset between odd and even fields MUST remain. Since the RGB video signals already have the half Hsync offset between fields this offset must reamain in the Hsync area of our new Composite sync signal. This means that the new progressive Csync is not strictly progressive, but it is as close as you can get. :)

Here is what the new Csync looks like on the scope as a single input. Here it is still being triggered from the interlaced sync, but you don't need to worry about that. What is important is the half Hsync offset is obvious as the signal looks twice the frequency. Again the odd and even fields are displayed on top of each other now.
Image

I'll get a circuit diagram uploaded as soon as I can. Hopefully this post makes sense so that others can try this out where Extron units haven't worked.
Cheers.
Last edited by dooklink on Sun Dec 07, 2014 9:20 am, edited 4 times in total.
User avatar
Fudoh
Posts: 13044
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by Fudoh »

Excellent! Did you have the chance to give the circuit a try on a digital processor ? Would be most interesting to see is the signal is properly recognized as 240p instead of 480i.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

Fudoh wrote:Excellent! Did you have the chance to give the circuit a try on a digital processor ? Would be most interesting to see is the signal is properly recognized as 240p instead of 480i.
No unfortunately. I don’t have an armada of processors yet. I think Is about as good of a chance for it to work without resampling of the video signal.
User avatar
emphatic
Posts: 8030
Joined: Mon Aug 18, 2008 3:47 pm
Location: Alingsås, Sweden
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by emphatic »

Very cool.
Image | My games - http://www.emphatic.se
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by BazookaBen »

Very cool. I'd say a lot of people could use this, judging by by the dissatisfaction from the Extron RGB in some of the threads. For example, I can't get a perfect 240p from my Extron on my PVM 20L2, though I can with my 20M2. On the 20L2 it seems that the lines don't land in the same spot ever 60 frames, so theres this flicker/interference going on. So something more precise is definitely welcome.

Your circuit is definitely more complex than anything I've built. Have you tried it on an actual CRT to verify the results?
User avatar
opt2not
Posts: 1289
Joined: Fri May 20, 2011 6:31 pm
Location: Southern California

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by opt2not »

Excellent stuff here. Subscribed!
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

BazookaBen wrote:Very cool. I'd say a lot of people could use this, judging by by the dissatisfaction from the Extron RGB in some of the threads. For example, I can't get a perfect 240p from my Extron on my PVM 20L2, though I can with my 20M2. On the 20L2 it seems that the lines don't land in the same spot ever 60 frames, so theres this flicker/interference going on. So something more precise is definitely welcome.

Your circuit is definitely more complex than anything I've built. Have you tried it on an actual CRT to verify the results?
I've had the problem of the fields not quite aligning as well. On my BVM2010p you can change the Auto Frequency Control (AFC) switch to low which changes the integration period of the sync locking circuits. Also, my RGB109xi has a sweet spot when you adjust the horizontal shift. It will bounce between interlaced and progressive just outside that spot.

My circuit is actually pretty simple in concept. Take pure hsync, invert it, then swap to the inverted hsync when you want the vsync to occur.

I've tested this setup on my BVM. It works very well indeed. I was hoping to add a hshift feature but have given up on that for now.
User avatar
Ed Oscuro
Posts: 18654
Joined: Thu Dec 08, 2005 4:13 pm
Location: uoıʇɐɹnƃıɟuoɔ ɯǝʇsʎs

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by Ed Oscuro »

BazookaBen wrote:I can't get a perfect 240p from my Extron on my PVM 20L2, though I can with my 20M2. On the 20L2 it seems that the lines don't land in the same spot ever 60 frames, so theres this flicker/interference going on.
What's a system that does this?

@ dooklink: Thanks for all the technical detail on this. It's on my radar again. I haven't yet run into anything I could use a device like this for, but it's early days still.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by BazookaBen »

Ed Oscuro wrote:
BazookaBen wrote:I can't get a perfect 240p from my Extron on my PVM 20L2, though I can with my 20M2. On the 20L2 it seems that the lines don't land in the same spot ever 60 frames, so theres this flicker/interference going on.
What's a system that does this?
This is with my Wii. It's not glaringly obvious, at first glance it looks like 240p, but you do notice a little flicker in the bright colors that can get annoying after a while. I can take a picture later to show you what I mean.

Even on my 20M2, it's hard to get perfect. You have to shift the picture pretty far vertically, which you then have to compensate by moving the picture down either in-game or in the PVM service menu. For some reason not all vertical positions in ADSP give the 240P look.

And then, on top of that problem, the top 5-10% of the screen will flag severely to the left, but that's also easy to hide in a lot of games by moving the picture downward.

So yeah, Dooklink's solution could save a lot of headache in this area.
dooklink wrote:I've had the problem of the fields not quite aligning as well. On my BVM2010p you can change the Auto Frequency Control (AFC) switch to low which changes the integration period of the sync locking circuits.
This is exactly the kind of setting I think is causing the problem on my 20L2. I couldn't find anything like it in the service menu though. If you know anything about how to do that on a PVM, let me know.

And as far as your device having H/V-shift, do you think an extron could take care of that, or do you think the ADSP would screw up all the good work your device did?

By the way, we should come up with a shorthand name we can call your device.
User avatar
SGGG2
Posts: 826
Joined: Thu Dec 31, 2009 1:03 am
Location: East Coast, US

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by SGGG2 »

If this works with digital processors, I'll definitely add one to my XRGB-3 setup. :)
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

BazookaBen wrote:
dooklink wrote:I've had the problem of the fields not quite aligning as well. On my BVM2010p you can change the Auto Frequency Control (AFC) switch to low which changes the integration period of the sync locking circuits.
This is exactly the kind of setting I think is causing the problem on my 20L2. I couldn't find anything like it in the service menu though. If you know anything about how to do that on a PVM, let me know.

And as far as your device having H/V-shift, do you think an extron could take care of that, or do you think the ADSP would screw up all the good work your device did?

By the way, we should come up with a shorthand name we can call your device.
The AFC setting on the BVM2010p is via a switch in the control draw. Everything is done via pots and switches as it is a full analogue chassis, no OSD. I don't think PVMs are likely to have an AFC control in the menus, but it might be possible via pots on the chassis for Hfreq or similar.

Perhaps an Extron after my circuit would behave properly, that is something I'll try out and report back.
EDIT: My Extron 109xi doesn't work correctly after the sync processor, if anything it is worse. I believe this might be due to a Phase Locked Loop (PLL) being used to recreate the vsync which doesn't have a fixed period due to the offset compensation.

I'm not good at naming products, this is just a sync processor. One day it would be nice to have an all-in-one sync processor for 15-31Khz for converting Composite video as sync, Csync, H&Vsync, polarity etc... plus the interlaced to progressive mode and H and V shift.
User avatar
chronicdog
Posts: 61
Joined: Mon Feb 21, 2011 11:17 am

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by chronicdog »

Just out of curiosity, why are you using a 480i signal from the 360 rather than 480p/VGA? Wouldnt that give a cleaner image?
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by BazookaBen »

chronicdog wrote:Just out of curiosity, why are you using a 480i signal from the 360 rather than 480p/VGA? Wouldnt that give a cleaner image?
480i is just as clean if the deinterlacing is done properly, and it has zero lag, as only the sync signal is modified and the color signal is passed right through.

480p has some amount of lag because you have to digitize the video signal and store it in a buffer.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

chronicdog wrote:Just out of curiosity, why are you using a 480i signal from the 360 rather than 480p/VGA? Wouldnt that give a cleaner image?
I think you mean VGA direct from the 360 instead of scart. You have to use scart on a low res only 15Khz CRT. There is a thread somewhere where fagin describes 15Khz looking better than 31Khz on his arcade monitors. Fudoh then explains that the 15Khz will have a lower bandwidth. Also, this is to be used on 360 arcade ports that were originally 15Khz anyway, so you are not really losing detail.
User avatar
chronicdog
Posts: 61
Joined: Mon Feb 21, 2011 11:17 am

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by chronicdog »

Yes, VGA out from the 360. I just got a Super Emotia for the purpose of getting 240p into my CRT from the 360 via VGA, but my understanding was that this did does not introduce lag and provides the cleanest possible low res image, which is almost identical to native 240p. However, Im far from an expert in these matters although Im learning a lot from these boards.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

chronicdog wrote:Yes, VGA out from the 360. I just got a Super Emotia for the purpose of getting 240p into my CRT from the 360 via VGA, but my understanding was that this did does not introduce lag and provides the cleanest possible low res image, which is almost identical to native 240p. However, Im far from an expert in these matters although Im learning a lot from these boards.
Ah okay, that would probably be just as good. Those units are somewhat rare though. Also you would get the benefit of being able to run scaled games at 240p without flicker.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by BazookaBen »

chronicdog wrote:Yes, VGA out from the 360. I just got a Super Emotia for the purpose of getting 240p into my CRT from the 360 via VGA, but my understanding was that this did does not introduce lag and provides the cleanest possible low res image, which is almost identical to native 240p. However, Im far from an expert in these matters although Im learning a lot from these boards.
And the Emotia is certainly less of a headache than getting 240p from an Extron RGB. You have to mess with the vertical adjustment a lot, and on some monitors I still couldn't get it perfect.

But I bet you could definitely measure some amount of lag on the emotia if you had a test setup. Probably less than a frame, though, given how simple the conversion is.
User avatar
Fudoh
Posts: 13044
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by Fudoh »

But I bet you could definitely measure some amount of lag on the emotia if you had a test setup. Probably less than a frame, though, given how simple the conversion is.
It buffers just a few lines, so the delay is far from even 1ms.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by BazookaBen »

Fudoh wrote: It buffers just a few lines, so the delay is far from even 1ms.
Wow, that's pretty cool. So that's definitely the optimal solution, especially if you're only playing WiiWare and XBLA stuff. There are a few PS2 arcade compilations that can't be forced into 480p where you would still have to go for the Extron RGB.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

I've made a basic diagram of how this is connected. The schematic is not fully complete with power connectors and oscilator etc, but that doesn't make sense for a breadboard prototype anyway.

I've noticed that the Arduino may not be ideal for this circuit as the Vsync has too much jitter, causing the image to jump sometimes. I was using an ARM Cortex originally which has no problems, but swapped to Arduino as that would be easier for more people to understand how it works.
User avatar
Crafty+Mech
Posts: 395
Joined: Sat Jan 19, 2013 1:17 am

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by Crafty+Mech »

dooklink wrote:I've made a basic diagram of how this is connected. The schematic is not fully complete with power connectors and oscilator etc, but that doesn't make sense for a breadboard prototype anyway.

I've noticed that the Arduino may not be ideal for this circuit as the Vsync has too much jitter, causing the image to jump sometimes. I was using an ARM Cortex originally which has no problems, but swapped to Arduino as that would be easier for more people to understand how it works.
I'd bet the Vsync jitter is caused by interrupt latency on the ATMega micrcontrollers. The latency is 1-3 clock cycles from the point when the pin change interrupt is generated. A design attribute that has always annoyed me about the ATMega series. With clever use of timers it is possible to compensate for latency in most cases, but it is a real pain in the ass.
User avatar
BazookaBen
Posts: 2159
Joined: Thu Apr 17, 2008 8:09 pm
Location: North Carolina

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by BazookaBen »

Here are a couple of examples of how the Extron RGB doesn't always workout perfectly.

This is the best I can get my 201rxi looking on my PVM-20L2. In pic 1, if you look at the line just above Mega Man's head, you can see interference with the white background. Same with the text in pic 2, you see the white bleeding into the black line directly above it. This leads an overall lower color purity, and in high contrast areas colors will actually flicker slightly. For some reason, my 20M2 looks way better with the Extron, almost a perfect 240p. So the two PVM models definitely deal with sync differently.

Image

Image

This of from Mega Man 9 on WiiWare. For some reason, a few PS2 games get better results, though I'm not sure if they're on par with the results they have on the 20M2.
Last edited by BazookaBen on Tue Dec 02, 2014 12:42 am, edited 1 time in total.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

Crafty+Mech wrote:
dooklink wrote:I've made a basic diagram of how this is connected. The schematic is not fully complete with power connectors and oscilator etc, but that doesn't make sense for a breadboard prototype anyway.

I've noticed that the Arduino may not be ideal for this circuit as the Vsync has too much jitter, causing the image to jump sometimes. I was using an ARM Cortex originally which has no problems, but swapped to Arduino as that would be easier for more people to understand how it works.
I'd bet the Vsync jitter is caused by interrupt latency on the ATMega micrcontrollers. The latency is 1-3 clock cycles from the point when the pin change interrupt is generated. A design attribute that has always annoyed me about the ATMega series. With clever use of timers it is possible to compensate for latency in most cases, but it is a real pain in the ass.
Yep, that's exactly it. I was running it off the internal oscillator originally, so it thought that might have been the problem. It seems the 16MHz crystal hasn't helped.

The 80MHz ARM M4 was fine though.
User avatar
donluca
Posts: 865
Joined: Sat Feb 28, 2015 8:51 pm
Location: Italy
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by donluca »

Hi there!

I've been growing interested in this project as my Extron RGB unit has recently acquired sentience and it's behaving on its own. :P

A couple of questions though:

1 - I can't find the ISL59885 anywhere in Europe. Can I just use 3 AND ports (with something like the 74LS00) to get H Sync from the Composite and Vertical Sync signals?
Or is there any equivalent of the 59885 I can use?
I took a look at the newer implementations of the LM1881 (the LMHsomething ICs) but I honestly have no clue on what should I wire up of the thing and what I can just leave it as it is.

2 - Did you solve the problem with the vertical jitter? Did you use an external oscillator? Or did you ditch the Arduino board entirely for something else?

Thanks! :)

EDIT: also, will an arduino nano suffice? It uses the same processor of the Arduino Uno. http://arduino.cc/en/Main/ArduinoBoardNano
User avatar
donluca
Posts: 865
Joined: Sat Feb 28, 2015 8:51 pm
Location: Italy
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by donluca »

OK, I managed to reply to most of my questions today after some research :P

1 - I'll just use an LMH1980 since now I know how to wire it up properly

2 - You did resolve it, there was an update I missed on your main post.

3 - Yes an Arduino Nano will do since it uses the same ATMega solution as the Uno.


But right now I have a question unanswered: will the LMH1980 process 240p signals?
There's no mention of 240p signals on the datasheet, only 480i/576i.

I might have to put a switch somewhere to bypass the entire circuit and feed the original composite thing to the ouput.

Anyway... it's time to rock!
I'll order everything soon and report back with videos and stuff as soon as I get everything up and (hopefully) working.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

All that you need with the current design is Hsync (pure hsync, no serration pulses), Vsync and Odd/Even field signals.

These all go to the arduino. And the Hsync goes to the MUX as well.

I'm thinking of creating a pure ARM cortex version with no sync stripper.

Let me know how it goes.
User avatar
donluca
Posts: 865
Joined: Sat Feb 28, 2015 8:51 pm
Location: Italy
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by donluca »

Oh, so you're working towards doing everything in the digital domain.
That's an interesting approach and potentially cheaper.

Those LMH1980 don't come cheap (and neither do Arduinos unless you want to buy them from China and wait one month for them to arrive).
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

donluca wrote:Oh, so you're working towards doing everything in the digital domain.
That's an interesting approach and potentially cheaper.

Those LMH1980 don't come cheap (and neither do Arduinos unless you want to buy them from China and wait one month for them to arrive).
Exaclty, Atmegas are overpriced and sync strippers are such low volume and rarely used so they are expensive.
I'm thinking of either using an ADC if it is fast enough or condition the signal myself.
User avatar
donluca
Posts: 865
Joined: Sat Feb 28, 2015 8:51 pm
Location: Italy
Contact:

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by donluca »

Going digital has its own downsides though.

There's going to be additional lag, regardless of the operations you do on the signal since you'll have to use buffers.

Also you'll have to manage jitter and quantization noise so you're gonna need quite a bit of bandwidth to begin with.

This is going to be a though one and I'm not sure if it will be worth it.

The solution proposed here could be a cheap one if one's willing to wait a month or more to fetch all the pieces from china. You can then use a normal USB charger to power everything up which is really convenient.
User avatar
dooklink
Posts: 85
Joined: Fri Nov 07, 2014 6:16 am
Location: Australia

Re: 480i (576i) to 240p (288p) sync converter (Extron RGB al

Post by dooklink »

I don't think it will be that problematic, bit I could be wrong.

I only need to deal with the Hsync frequency, not the dot clock. The part I'm thinking of has 48MHz operation and an ADC that can run at 2MHz. If there is lag its not too bad as the image just shifts, then you just compensate. The signal is periodic I'm not dealing with the RGB.
Post Reply