Featured
Latest
PIC 405 line patter...
 
Share:
Notifications
Clear all

Forum 135

PIC 405 line pattern generator

138 Posts
19 Users
0 Reactions
40.5 K Views
Terrykc
(@terrykc)
Posts: 4005
Member Rest in Peace
 

I am doing the calculations for the circle old school compass and graph paper hence a 1 pixel to 1 line ratio makes it easier to start with ...

Now that you've explained the logic behind what you are doing, the simplicity of it makes sense, especially as you weren't originally contemplating a circle.

However, the resulting card will always be displayed in 4:3 ratio because that it will be how the monitor/TV would normally be set up.

If you really are using graph paper and compass - and I see no reason why not, again: simplicity - have you considered scanning a sheet of graph paper and compressing it it slightly in the horizontal direction so that 120 squares occupies the same horizontal measurement as 125.3 (I think you could ignore the 0.3!) in the vertical direction.

You would then get the right answer for everything on the card without any scaling at a later date.

When all else fails, read the instructions

 
Posted : 24/12/2015 10:27 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

have you considered scanning a sheet of graph paper and compressing it it slightly in the horizontal direction so that 120 squares occupies the same horizontal measurement as 125.3 (I think you could ignore the 0.3!) in the vertical direction.

Hi Terry
Now that's something I hadn't thought of, what a brilliantly simple solution to scaling and one I will try.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 25/12/2015 12:09 pm
Brian Cuff
(@briancuff)
Posts: 2063
Member Rest in Peace
 

However, the resulting card will always be displayed in 4:3 ratio because that it will be how the monitor/TV would normally be set up.

A testcard generator with a 5x4 aspect ration could be useful with very early sets - although the normal input to a standards converter is, of course, 3x4. To that end, has anyone contemplated an aspect ratio converter from 3x4 to 5x4? The broadcast industry used ARCs all over the place but nothing to 5x4!

Forum Memorial

 
Posted : 25/12/2015 1:10 pm
Cathovisor
(@cathovisor)
Posts: 6467
Famed Member Registered
 

I once suggested an option of producing 5:4 to Dave.

I think the answer translated as 'no' :aaj

Maybe when the next generation comes along that takes HDMI in from an 1125 line source...?

It's at times like these I wished I'd bought one of those lovely Snell ARC150s out of my studio when I had the chance - they were quite capable of doing this under BNCS control :aaf Certainly a TVOne converter would do it, if it had the option for analogue video fitted.

 
Posted : 25/12/2015 1:19 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

If it was thought to be of any use I could make the circle switchable between 5:4 and 4:3. It would mean a separate set of lines for each circle but as much of each set of lines are the same there should be enough memory left on the PIC to do it.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 26/12/2015 1:30 pm
freya
(@freya)
Posts: 1315
Prominent Member Registered
 

What a great project, its so small it could be made as an inline phono plug / socket with flylead for power ?
Something I could use on the dinosaur instead of using the testcard output from the aurora`s video output.

 
Posted : 26/12/2015 2:10 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

Hi Stephen
It should be quit small when complete. Power consumption isn't too high either, there is a 5V reg on the stripboard, I am feeding it with 9V and it draws less than 20mA at the moment.

I am currently using the aurora`s modulator for testing but when I get it finished I intend to build a modulator for it so it can be used on its own.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 26/12/2015 3:30 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

I have started to adjust the circle to 4:3 and move the gratings and grey scale inside it.
It will be 192 pixels by 200 lines.
I have uploaded a photo of the top portion of the circle but wit the middle section of the old circle left in placed to show the difference in width.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 28/12/2015 3:18 pm
Terrykc
(@terrykc)
Posts: 4005
Member Rest in Peace
 

That is looking very promising indeed!

When all else fails, read the instructions

 
Posted : 28/12/2015 6:44 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

Got the circle finished.
The grey scale at the bottom will eventually be removed.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 28/12/2015 9:05 pm
Norman-Raeburn
(@norman-raeburn)
Posts: 174
Reputable Member Registered
 

Hi Frank, Many thanks for sharing your project with us. It looks very promising now. I must have a go with pic chips one of these days. My old journeyman who is 91 tells me pic chips are easy to program, I have serious doubts about that. I look forward to the next instalment. Norman

 
Posted : 28/12/2015 9:58 pm
Terrykc
(@terrykc)
Posts: 4005
Member Rest in Peace
 

That is superb, Frank!

Are you considering adding any other options?

I ask because I have a couple of simple ones.

The first is black level and syncs because this can help when chasing some sync faults because there is no longer any video content to drive the sync separator hard on.

The second is the exact opposite: peak white and syncs.

The requirement, at least as far as I am concerned, is as follows. As mentioned in other threads on here, I have been involved in the RF distribution system at the Dulwich museum and have had trouble with reliably measuring the 405-line vision carriers. This is because the Level Measuring Set I am using is designed to measure negatively modulated vision signals which means that it only has to sample the signal for about 100µS to see horizontal sync pulses which, of course, are 100% carrier. 

With System A 405-line signals, however, this doesn't work because of the positive modulation. Programme material is no use because there can be lengthy periods of video that contain no peak white - i.e.: 100% carrier - at all and, even with a test card, very little of it is peak white, so it can take some time using peak hold to get a suitable sample, one hopes, of peak white.

Of al the signals available at the museum, none of them are suitable (I don't ever recall seeing colour bars there, which is the only common test signal that would be of any use) so, on a recent visit, it was necessary to import another generator specially for the purpose. For the first time ever, I found it possible to get reliable readings on the VHF channels.

High accuracy isn't vital for the average simple distribution system - an Aurora feeding a 4-way splitter with fairly short cables will provide signals of around 2mV without any need to measure them - but there are other more complex systems where such a simple signal could make things so much easier!

Sorry to hog your thread but the thought just crossed my mind ...

When all else fails, read the instructions

 
Posted : 28/12/2015 10:00 pm
Cathovisor
(@cathovisor)
Posts: 6467
Famed Member Registered
 

If I wore a hat Frank, I would doff it to you :aap

In the light of what Terry has written, I'd be inclined to suggest a line-rate sawtooth would be useful...

 
Posted : 28/12/2015 10:02 pm
Terrykc
(@terrykc)
Posts: 4005
Member Rest in Peace
 

I don't think a sawtooth would be any good for my purpose as it would equate to only one pixel of peak white per line! My LMS would expect to see around 5µS of peak carrier per line!

It does have a variable dwell time which can be switched to measure scrambled signals which use the suppressed line sync method.* This ensures that it waits around long enough to see the vertical sync but, again, this only works on negatively modulated carriers.

A stepped grey scale would be OK though ...

* I think this is done by reducing the gain to 50% during the line fly-back period but a similar effect can be achieved by adding a 500mV positive going pulse to the video.

This has the effect of raising the whole of the horizontal sync pulse so that it it is entirely above black level.

This is reversed during reception to restore the sync pulses to normal.

When all else fails, read the instructions

 
Posted : 28/12/2015 10:19 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

Hi Norman
You should have a go at PIC's there are quite easy, after all I am finding my way around them.
99.9% of this project is nothing more that counting and can be quite monotonous, but that generally is not the case.

Hi Terry
Black level and peak white would be very easy to do and would use an absolute minimum amount of memory so I will include them in the final version.

Hi Cathovisor
A true sawtooth I wouldn't be able to manage but I should be able to do a 32 step grey scale, it would just need the addition of a few resistors. I intend to include it.

I would like to make it as versatile as possible, with as many options as feasible, so please keep the suggestions for options coming.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 28/12/2015 11:18 pm
Cathovisor
(@cathovisor)
Posts: 6467
Famed Member Registered
 

Hi Cathovisor
A true sawtooth I wouldn't be able to manage but I should be able to do a 32 step grey scale, it would just need the addition of a few resistors. I intend to include it.

Myself, I wouldn't bother with that; a simple eight step staircase of equal amplitude would be more than satisfactory.

One test that is particularly stressful of video systems is the 'bounce' test - whereby the video signal is switched between full-field white and full-field black on a periodic basis, say, twice a second. A good way to exercise clamps and EHT regulators!

 
Posted : 28/12/2015 11:59 pm
jjl
 jjl
(@jjl)
Posts: 89
Estimable Member Registered
 

You should have a go at PIC's there are quite easy, after all I am finding my way around them.

A true sawtooth I wouldn't be able to manage but I should be able to do a 32 step grey scale, it would just need the addition of a few resistors. I intend to include it.

Frank

Frank

Congratulations on the excellent results of your project.
I'm intrigued to find out how you've implemented the analogue video output. I didn't think that the PIC18 DAC would be fast enough. Are you using an external R, 2R network and driving this at logic level?

I've used PICs professionally quite a few times, and I'm not all that keen on them. I've found writing programs for them in C bearable, but the very odd, limited instruction set and weird memory layout I've found maddening when programming in assembler.
It's true that they're very low cost and can get quite a lot done at modest clock speeds though.
Speaking of clocks, did you say that you are using a resonator to drive your PIC? If it's a ceramic type, these tend to have poor frequency accuracy, stability and temperature coefficient. I seem to remember that we needed to use a 25 ppm crystal as the source of pixel clocks etc. on a video project I worked on about 15 years ago.

John

 
Posted : 29/12/2015 7:35 am
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

Hi Cathovisor
The bounce test should be easy to include. On a similar note earlier on I decided to see what one field would look like on its own. I had the odd field at blanking level and the even field at peak white. The TV didn't like it at all and I liked it even less the flicker was something terrible.

Hi John
You are correct I am using a simple external R, 2R, 4R network connected to some of the pins on one port, an emitter follower is used to buffer the output of the network. One Port is used for Video and another for Sync. The Sync is also inserted through the network. The video information is wrote to the port latches which holds it at that level until they are wrote to again. It is arranged so peak white has its own bit (bit.4) as opposed to the more common all bits high for peak white. Mid greay is beside it (bit.3). This arrangement allows for transition between white and mid grey in one instruction cycle using the shift left or right instructions. Transitions between black and white or mid grey also can be done in one instruction cycle.

I am using a ceramic resonator, but if it proves to be inaccurate or not stable enough a crystal and its associated capacitors can be substituted.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 29/12/2015 11:26 am
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

I have adjusted the 5:4 circle to get it closer to what it should be, it now occupies 200 pixels by 196 lines. Next is to merge the two into a single program and find out will they fit. Each test card on its own takes up almost 71% of the available memory.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 30/12/2015 3:06 pm
FRANK.C
(@frank-c)
Posts: 252
Reputable Member Registered
Topic starter
 

Unfortunately the two test cards are too large to fit on the PIC that I have.
I will have to wait until I get a larger one before I can continue with that. Until then I will press on with less memory hungry options.
I have uploaded a photo of the grey scale and what it looks like on the scope.
The scope is set to 0.2V/div and 10uS/div.

Frank

www.electronics.frankcuffe.ovh

 
Posted : 01/01/2016 10:18 pm
Page 2 / 7
Share: