It is currently Wed Jul 26, 2017 9:40 pm

PIC 405 line pattern generator

Valves, Transistors, IC's and Components. Bench test techniques, Test Gear - Valve Testers, Scopes, CRT Testers, Bridges, Sig Gens, Pattern Gens, Workshop tours etc
 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Wed Feb 17, 2016 8:40 pm

Well curiosity got the better of me and I made some space for the TV22.
I have posted two photos of the pattern on the scope. one with the background at black level the other the background is one step away from peak white. The third photo is of a grey scale. No settings on the scope were changed between photos, both channels are dc coupled . The bottom trace is from the tube base.

A youtube clip here shows clearly whats happening. Black level can be seen going more positive as the background gets brighter.

Frank
Attachments
testcard30.jpg
testcard29.jpg
testcard31.jpg

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Sun Mar 20, 2016 3:34 pm

I have eventually finished the software and it is available to download from here.
The final list of test patterns is.

Test card 4:3
Test card 5:4
Grey scale 9 step
Grey scale 10 step
Grey scale 9 step crossed
Grey scale grid
Cruciform
Checkerboard 8X6
Crosshatch white on black
Crosshatch white on grey
Black level
Peak white
Bounce
Frequency gratings
Missing line sync
Early line sync

The circuit is the same as posted earlier in this thread except that I have changed R3 to 1k8 this gives better black level and peak white levels.


Frank

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Tue Apr 05, 2016 9:10 pm

A couple of photos to conclude this thread.
One of the PCB and one of the finished generator connected to a modulator.

Frank
Attachments
32 pcb.jpg
33.jpg

 
Posts: 440
Joined: Tue Apr 16, 2013 4:43 pm
Location: Coventry, but originally from Holland

Re: PIC 405 line pattern generator

Post by ntscuser » Tue Apr 05, 2016 10:10 pm

That's a very professional looking finish I must say! :aap

 
Posts: 1931
Joined: Mon Jul 25, 2011 12:12 pm
Location: Burghfield, Reading, UK

Re: PIC 405 line pattern generator

Post by Brianc » Wed Apr 06, 2016 11:20 am

Wow Frank! Fantastic piece of development and production. :aap :aap :aap

 
Posts: 2714
Joined: Sun Sep 01, 2013 6:19 pm
Location: Behind the sofa

Re: PIC 405 line pattern generator

Post by Cathovisor » Wed Apr 06, 2016 2:49 pm

I shall be doing a technical review of this fantastic project in due course...

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Wed Apr 06, 2016 9:47 pm

Hi ntscuser and Brian
Thanks for the kind comments.
It polished up OK in the end. There is actually plenty of room inside the enclosure to fit the modulator but I decided to keep them separate as I would like to try and build a different modulator sometime.

Hi Cathovisor
I am looking forward to your review, warts and all. Thanks for doing that.

Frank

 
Posts: 3
Joined: Sun Oct 09, 2011 7:32 pm
Location: nr. Hannover, N.Germany

Re: PIC 405 line pattern generator

Post by eddie_ce » Sat Jun 11, 2016 6:33 pm

Frank,

I have just come across this excellent project and intend to build it. I have downloaded the circuit diagram and the hex file. I have just started on designing a PCB layout for it.

However as a valve and transistor man I am a complete numpty when it comes to all these new fangled microchips.

How do I get the hex file into the PIC?
What do I need for this as far as hardware is concerned?

Many thanks for a great project and all the work you have put into it.

Eddie

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Sat Jun 11, 2016 11:52 pm

Hi Eddie
To program the PIC you will need a "PICkit 3" programer.
They are available from most company's that sells PIC's.
This is a link to where I purchased my one from sometime ago. They are also available on Ebay from various sources, including China etc. at knock down prices, how good thees are I don't know.

You will need to download the software to run it, from http://www.microchip.com which is a free download.
The software is MPLAB IPE (Integrated Programing Environment). You may need to download and install the complete MPLAB X IDE (Integrated Development Environment) in order to get it. It is so long sense I installed it I cant remember.

You will also need a means of connecting the programer to the PIC. You can purchase an adapter, if you search ebay for "ICSP adapter" (In Circuit serial Programer) they will show up, but to I just use a IC socket that suits the chip(28 pin in this case) and a 6 pin header mounted on a scrap piece of Strip board (photo below).

I will draw a diagram of the connections and post here.

There is a lot on the web about how to program a PIC. If you google something like "PIC ICSP programming" quite a few pages should show up.

If you would like the pcb layout that I used just PM me your email address and I will send it to you.

Good luck with the build, keep us informed how it goes.

Frank
Attachments
testcard32.jpg

 
Posts: 3
Joined: Sun Oct 09, 2011 7:32 pm
Location: nr. Hannover, N.Germany

Re: PIC 405 line pattern generator

Post by eddie_ce » Sun Jun 12, 2016 8:34 am

Frank,

many thanks for that information. I'll see about getting the necessary PIC hard- and software. I have sent you a PM and would be grateful for a PCB Layout.

How critical is timing, would there be any advantage in using a 6MHz Xtal with 2 x 27pF to ground rather than a ceramic resonator?
Would the PIC parameters need changing?

Best wishes
Eddie

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Sun Jun 12, 2016 10:37 am

Hi Eddie
I have not tried it but there should be no problem in substituting a 6mHz crystal and its associated capacitors for the resonator, no software change is required.

I don't know If the increase in accuracy will make much difference in practice, as the generators timings are not perfect to start with, remember that the Generators line at 99 uS takes slightly longer than it ideally should, this in turn reduces the field frequency slightly to, if I remember correctly 49.88 Hz.

In practice being out that much makes little if any difference on an average TV but at the same time the timings are not perfect.

This particular PIC appears to be very static sensitive compared to others I have used so I would say a ESD wristband is a must when handling it. I have damaged two on this project before I started to use a wristband and I have never damaged a PIC before.
It just goes to prove that age old rule, the more expensive an item is the easier it is to damage.

Frank

 
Posts: 4203
Joined: Wed May 02, 2012 3:35 pm
Location: Worksop

Re: PIC 405 line pattern generator

Post by Refugee » Sun Jun 12, 2016 12:01 pm

I have added a basic test circuit to my adapter unit for programming chips. The only bit that could do with being added is the "hack switch" that allows copy protected chips to be copied.
Attachments
DSCF3342.JPG

 
Posts: 3
Joined: Sun Oct 09, 2011 7:32 pm
Location: nr. Hannover, N.Germany

Re: PIC 405 line pattern generator

Post by eddie_ce » Sun Jun 12, 2016 12:27 pm

Frank,

thank you for explaining that. A ceramic resonator it is then.

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Sun Jun 12, 2016 7:11 pm

The circuit of the ICSP adapter that I have used is shown below.
Pin 1 on the header connects with the pin on PICkit 3 that has a white arrow pointing to it.
(in the photo of the adapter I have a white arrow pointing to pin one of the header)

As this adapter dose not supply any power to the PIC, the IPE software will need to be told to power the PIC from PICkit 3.

This is done by going to

Settings -> Advanced Mode -> Power

and ticking the box that says "Power Target Circuit from Tool"

Frank
Attachments
icsp.jpg

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Sun Jun 12, 2016 7:56 pm

Going back to crystals etc, it would be possible to run it from the PIC's internal oscillators except I wanted a 6mHz one which the PIC didn't have.

Just to see what could be squeezed out of a 8 pin microcontroller I built PICGEN-MINI which uses a 12F1572 that uses its internal oscillator.
The frequency gratings are 1 and 2 mHz

Frank
Attachments
pgm1.jpg
pgm2.jpg
pgm3.jpg
pgm3a.jpg
pgm4.jpg

 
Posts: 1059
Joined: Sun Sep 04, 2011 9:27 am
Location: Falmouth, Cornwall

Re: PIC 405 line pattern generator

Post by freya » Sun Jun 12, 2016 8:09 pm

You knocked it up in an afternoon eh Frank, :bba

mines running well most weeks when I get the time :thumb

 
Posts: 63
Joined: Sun Dec 18, 2011 1:46 pm
Location: Hertford

Re: PIC 405 line pattern generator

Post by jjl » Mon Jun 13, 2016 5:13 am

I wouldn't recommend using the internal RC oscillator of any PIC. The frequency tolerance is around +/- 8% at room temperature. As an example, this is bad enough for communication via the PIC's UART to become unreliable over a single character.

John

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Mon Jun 13, 2016 12:36 pm

Hi Stephen
Its good o hear that your one is doing its job Ok.

Hi John
That's a good point about oscillator accuracy and stability and no doubt there are PIC's with internal oscillators that have a +/- 8% tolerance.

The PIC I used for PICGEN-MINI is a 12F1572 and as far as I can tell from its data sheet its internal oscillator is factory calibrated and should remain within +/- 2% over the temperature range of 0 to 60 C and a VDD range of 2.5 to 5.5V.

A crystal oscillator is obviously far more accurate and stable than that but bearing in mind that this is not a precision instrument and the workshop temperature wont vary that much I feel that this is tolerable in this project.

I have ran it for hours in the workshop with no noticeable difference on the display, when I get a chance I will attack it with the hair dryer and see what happens.

Presumably the problem you describe with UART could be resolved by adjusting OSCTUNE.

Frank

 
Posts: 475
Joined: Mon Sep 12, 2011 7:22 pm
Location: Blyth, Northumberland

Re: PIC 405 line pattern generator

Post by davegsm82 » Wed Jun 15, 2016 2:15 pm

Refugee wrote:The only bit that could do with being added is the "hack switch" that allows copy protected chips to be copied.


Does this switch actually exist? if so I could really do with knowing about it.

Dave.

 
Posts: 5926
Joined: Sat Jul 23, 2011 8:19 pm

Re: PIC 405 line pattern generator

Post by CTV » Wed Jun 15, 2016 2:37 pm

Hi Folks,

Only just read the recent posts in this thread and two give the team concern.

Refugee wrote:The only bit that could do with being added is the "hack switch" that allows copy protected chips to be copied

davegsm82 wrote:Does this switch actually exist? if so I could really do with knowing about it.

I would hate to see an otherwise excellent project/thread that Frank has invested a great deal of time in, closed due to others members discussions of illegal ways to hack IC's.

This practice is not something we wish the forum to be associated with. Speaking as owner and on behalf of the moderation team who could be equally held accountable by condoning such posts, any further discussion on hacking chips will result in the thread being closed. I hope you understand our stance in this matter, lets keep posts to the matter in hand which is creation/construction of a PIC 405 line pattern generator.

Note: The UK enacted the Copyright, Designs and Patents Act, 1988, c. 48, § 213, I believe the act/ law fully protects chip topography and code

 
Posts: 475
Joined: Mon Sep 12, 2011 7:22 pm
Location: Blyth, Northumberland

Re: PIC 405 line pattern generator

Post by davegsm82 » Wed Jun 15, 2016 3:07 pm

CrustyTV wrote:Hi Folks,

Only just read the recent posts in this thread and two give the team concern.

Refugee wrote:The only bit that could do with being added is the "hack switch" that allows copy protected chips to be copied

davegsm82 wrote:Does this switch actually exist? if so I could really do with knowing about it.

I would hate to see an otherwise excellent project/thread that Frank has invested a great deal of time in, closed due to others members discussions of illegal ways to hack IC's.

This practice is not something we wish the forum to be associated with. Speaking as owner and on behalf of the moderation team who could be equally held accountable by condoning such posts, any further discussion on hacking chips will result in the thread being closed. I hope you understand our stance in this matter, lets keep posts to the matter in hand which is creation/construction of a PIC 405 line pattern generator.

Note: The UK enacted the Copyright, Designs and Patents Act, 1988, c. 48, § 213, I believe the act/ law fully protects chip topography and code


Understood, perhaps I should have clarified with a little context, I have several of my own projects which I have lost the code for in the great hard disk crash of 2012, I'd really like to get the original hex code back but obviously there isn't a 'legal' method of doing so that I know about.

Thanks, Dave.

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Sun Jul 31, 2016 8:55 pm

I am after having quite an interesting battle with a new generator that I built to find out, why, what looked like a hum bar was appearing on screen.

All TVs that it was tried on displayed a perfectly steady test card C from the Aurora. The generator was tried on three different modulators the Aurora used as modulator only, a ETF modulator and another home built modulator that is similar to the Aurora's modulator. No matter what combination of modulator or TV that was tried a slight hum bar could be seen traveling up the screen.

The hum bar did not shade or brighten the area that it passed through as it moved up the screen, it just pulled the lines slightly to the left and appeared to moved the lines apart as it passed through them. This could be seen best at the top and boom of the picture where it would lengthen the castellations as it passed through them.

When scoped no mains ripple could be found on the output or the supply.
In order to eliminate any ground loops the generator and modulator was run from battery's but this made no difference either. Attention then tuned to the microcontrolers oscillator and to get rid of any suspicion the resonator was changed for a crystal. I then noticed that this microcontroler unlike the microcontroler that I was using at the start could run a crystal up to 25 MHz, I fitted a 24 MHz crystal and changed the software to suit. this removed the need for the the X4 PLL and any jitter it introduced but still no joy.

In order to confirm that it was mains hum and nothing else I decided to inject some mains frequency into the misbehaving generator. This was done by connecting the secondary of a small 9V transformer between 0V and the transistors base, a 15k resistor was put in series with with the transformers secondary to limit current. The primary of the transformer was connected to mains via a variac. The variac was wound up until a hum bar could be seen on screen and sure enough it tracked the hum bar from the generator in both direction and speed, at least now I knew for sure that it was mains related.

Next I found another Sony 9-90UB that I could run from DC. This was ran from the bench power supply and when the generator was tried on it the hum bar had disappeared. Then running the TV from mains the hum bar reappeared. Finally some progress!

Then I fitted a 'Y' splitter to the output of the modulator so I could feed two TV's, one ran from mains the other from DC. There was no hum bar on the one ran from DC while at the same time the one connected to mains had a hum bar. On the face of it this would appear to suggest that the hum was been introduced after the modulator but why then would one generator produce a hum bar while another would not?

After another bit of prodding around the cause was found, any ideas what it was?
I will post the answer in a while.

Frank

 
Posts: 3781
Joined: Sun Feb 12, 2012 7:43 pm
Location: North Hykeham, Lincolnshire and Ilford, Essex (but not for much longer ...!)

Re: PIC 405 line pattern generator

Post by Terrykc » Sun Jul 31, 2016 9:40 pm

I once had a problem that turned out to be an earth/neutral transposition on the mains socket, the RF source also being grounded. In my case, I discovered it by accident when I was lucky enough to observe a marked decrease in the effect when a 3kW fan heater was turned down to 2kW as a very cold office started to warm up!

See: http://www.radios-tv.co.uk/an-elusive-hum-problem/

This couldn't happen with an un-isolated chassis, of course, because of the aerial isolator.

So my money is on some form of earth loop.

 
Posts: 185
Joined: Sat Jul 23, 2011 10:40 pm
Location: Roscommon Ireland

Re: PIC 405 line pattern generator

Post by FRANK.C » Mon Aug 01, 2016 7:42 pm

Hi Terry
I had a look at your link, that was an unusual fault and just goes to show how something seemingly unconnected can trow a spanner in the works.
Right to the end I too thought that it had to be a hum loop of some sort and I had chased my tail trying to find it for quite a while.

After hooking the generators up to the scope again and comparing the output of a good and misbehaving generator a difference could be seen and the penny finally dropped.

I said in an earlier post that the frame rate was not exactly 50Hz. I had thought that this would not be a problem but I was wrong.
The difference between the two outputs displayed on the scope was when the scope was synced to mains, the misbehaving generator output passed across the display much faster that the good one. In other words it was more out of sync with the mains than the one that didn't display a hum bar.

The misbehaving one took 4S to cross the screen while the good one took 9S. I then checked the output of the Aurora and it took 30s to cross the screen.
I often heard that TV transmissions were synced to the mains but never realized that if it wasn't that it could cause such a problem.

All the good generators used a resonator from the same lot, while the misbehaving one was from a different lot and must be closer to 6MHz as substituting a crystal made no difference.
I set about seen what could be done to improve the situation and after doing the maths it looked like I should be getting a better frame rate with a crystal than what I was getting.

Out with the scope once again and checked the misbehaving generator, flicking through all the patterns revealed that apart from the two test card patterns all others patterns were moving across the screen at a much slower pace. Scoping a good generator showed the test card patterns moving across the screen in one direction (<50Hz) while all other patterns were moving in the opposite direction (>50Hz). This could only result from the test card patterns having more lines than the other patterns.

Sure enough after checking through the code two extra lines were found in a portion of code that was common to both test cards. The lines that forms the top and bottom castellations are produced in blocks. The last line in the bottom castellations is a modified line to allow for the interlace etc. This line is not part of the bottom block and should have been subtracted from it but wasn't hence an extra line was added to each field.

After removing the extra lines the generator is producing a much better picture, tough there is still a tiny bit of hum on it if you look at it very closely as it is still more out of sync with the mains than the first generators that I built. It would appear that the hum bar is more intense the further the frame rate is from 50 Hz and if it gets reasonably near to 50 Hz it diminishes altogether. This possibly just an optical illusion?

In the light of this, to get the frame rate closer to 50 Hz I will reduce the total line length from 99 uS to 98.83 uS. This will be done by reducing the sync pulse from 9 uS to 8.83 us. When I get it done I will make it available on the website as a download.

In the meantime I have updated the software download on the website to one which now has the correct number of lines in all patterns.

Frank

 
Posts: 3781
Joined: Sun Feb 12, 2012 7:43 pm
Location: North Hykeham, Lincolnshire and Ilford, Essex (but not for much longer ...!)

Re: PIC 405 line pattern generator

Post by Terrykc » Tue Aug 02, 2016 11:10 am

FRANK.C wrote:I often heard that TV transmissions were synced to the mains but never realized that if it wasn't that it could cause such a problem.
Oh yes it was!

Here's the history: in the beginning, transmissions were asynchronous, i.e: mains locked. The advantage of this was that stationary hum on a picture can be virtually invisible to the viewer, provided it is not excessive. No doubt that was very important in the early days when electrolytic capacitor technology kept values relatively low.

However, this could lead to some very interesting effects. With many sets, hum could affect one or both timebases, leading to slight S bends on verticals and linearity variations over the period on a frame - as you have now witnessed, Frank! Any insert into a live programme, whether from another studio, telecine or this new fangled video tape, would be from an external source which, although also mains locked, had a two in three chance being fed from a different phase, so the field sync might vary ±16.66mS from the studio sync. It might be better to say from +16.66mS to +33.33mS here. To avoid a nasty jump, the studio sync would be switched from mains lock to the incoming video, so the sync generator was allowed to free run until the field sync pulses agreed. What happened in the receiver was any combination of a number of effects, which would vary from receiver to receiver. This happened fairly quickly, so quite violent changes in line speed could occur, together with the other effects.

I was sitting reading with my back to our Ekco TV (a T281, I think) on one occasion when I heard the sudden change in line frequency and, on instinct, glanced round to catch the tail end of the characteristic field linearity convulsions. My mother said "How did you know that was going to happen?". (She couldn't hear a 10.125kHz line whistle, even with her head virtually inside the cabinet - I tried!)

Asynchronous working is not suitable for colour transmission - everything has to be synchronous with the colour subcarrier - so, after the report of the Pilkington report on the future of Television, which gave the go ahead for BBC2 on 625-lines and, later, colour, the BBC decided to switch to synchronous transmission with startling results because customers could now see the hum effects continually moving, which made them highly visible!

It was quite a busy time, particularly with older sets ...!

PreviousNext

Return to In The Workshop



Who is online

Users browsing this forum: No registered users and 2 guests