UK Vintage Radio Repair and Restoration Discussion Forum

UK Vintage Radio Repair and Restoration Discussion Forum (https://www.vintage-radio.net/forum/index.php)
-   Homebrew Equipment (https://www.vintage-radio.net/forum/forumdisplay.php?f=99)
-   -   Orton PIC video clock (https://www.vintage-radio.net/forum/showthread.php?t=159208)

Karen O 25th Aug 2019 8:58 pm

Orton PIC video clock
 
3 Attachment(s)
This PIC project displays an analogue clock on a monochrome 625 monitor.

Points to note:

The video output delivers 1V p-p video into a 75R load. Many consumer appliances (e.g. Chinese mini televisions) present a much higher load than this so need an additional resistor across the video output. Try 82R or maybe 100R.

The video signal is non-standard (non-interlaced, no equalisation pulses, no chroma, non-standard frame sync). It'll almost certainly work with older CRT monitors but more modern monitors may turn their collective nose up at it.

If you want to trim the crystal, the location of the trimmer is shown on the circuit. I lack the means to measure the crystal frequency accurately so didn't bother with this.

The text file contains the hex for the program. Just change the extension to .HEX and it should be digestible by PIC programming software.

Wendymott 26th Aug 2019 2:14 pm

Re: Orton PIC video clock
 
Nice one Karen...One day I will post my fully interlaced TV pattern generator..problem is I only have the hex files now..All the other software was consigned to the bin on a faulty hard drive.
Fortunately I have a physical print out, but do I really want to retype it.

mole42uk 26th Aug 2019 5:45 pm

Re: Orton PIC video clock
 
That’s a fun project! I have one that writes an analogue clock to an oscilloscope but it’s much more complex.

Karen O 26th Aug 2019 6:25 pm

Re: Orton PIC video clock
 
This is not actually my first attempt. The previous one used flash as graphics memory! But I worked out that the flash's endurance would be exceeded in a very few months. Also, because the PIC stops processing while writing to flash, the video goes off for a second while it redraws everything. Could be an answer for infrequently changed captions though...

IanBland 14th Sep 2019 2:33 pm

Re: Orton PIC video clock
 
Hi Karen,

Just wondering, is the "pixel" clock the same speed as a standard 625 line PAL television?

Karen O 14th Sep 2019 4:30 pm

Re: Orton PIC video clock
 
Hi Ian,
Yes, it displays on a normal 625 monitor. I say 'normal'... I've only tried it on a couple of CRT monitors. It does generate a sub-standard signal which might prevent its acceptance by some modern sets.

When I get a round tuit I'll build a skeletal monitor rather like those 'scope clocks. You know - bare CRT on top of a box sort of thing :)

IanBland 14th Sep 2019 11:49 pm

Re: Orton PIC video clock
 
Thanks for the answer! What's puzzling me (I'm an absolute n00b compared to everyone else on this forum regarding video signals) is how you get that from a crystal at 14.75 MHz, as I understand 625 line TV is 6.5MHz and that's not a simple ratio. Would you be kind enough to give a simple explanation?

(I'm interested partly because it's a cool project and partly because for reasons unknown I've found myself contemplating Sinclair micros again and the ZX81's "novel" approach to getting video without a video chip, and in that the Z80 had to run at 3.25MHz (slowing it even further from its possible 4MHz) to sync with the video).

Radio Wrangler 15th Sep 2019 4:08 am

Re: Orton PIC video clock
 
Quote:

Originally Posted by Karen O (Post 1176290)
When I get a round tuit I'll build a skeletal monitor rather like those 'scope clocks. You know - bare CRT on top of a box sort of thing :)

Rather like a prop from Gilliam's 'Brazil' if you have a Fresnel lens dangling in front of it.

Add a second PIC quietly playing the music.

David

Karen O 15th Sep 2019 7:51 am

Re: Orton PIC video clock
 
Hi Ian,

My choice of 14.7456MHz for the PIC crystal is key to generating 'square' pixels. The clock face is displayed on a 128x128 pixel area that needs to be square otherwise you'll get an elliptical clock! (we'll ignore the fact that CRT monitors often have poor linearity and that modern LCD monitors often take liberties with aspect ratio).

There is no video interface on the PIC. The video is generated using a double buffered serial port which can be used to generate an arbitrary stream of bits (the pixels) without interruption. The PIC has to feed the serial port at just the right time to make the digits appear on the screen. That code was generated by a program I wrote in MATLAB which works out the right series of serial port assignments and pauses. I'd have gone md trying to work it out manually!

The fingers: for these I use another PIC peripheral - the pulse width modulator. The code uses this to generate the horizontal line segments that make up each finger. The PWM is used alternately to generate the hour and minute hands.

You're probably shaking your head in disbelief but that is par for the course for my kind of PIC programming - hellishly real time with copious amounts of instruction cycle counting.

Karen O 15th Sep 2019 8:07 am

Re: Orton PIC video clock
 
Forgot to mention: The PIC code is in two parts: the real time part which feeds the serial port, controls the PWM and flaps the SYNC output up and down; and a background process which works out how to display the fingers on completion of each minute. The first is time critical and precisely timed while the second is not time critical and 'goes as fast as it goes'.

The frame blanking periods are used to give time to the background process. At the start of each blank line a timer is armed and control returned to the background process. Just before the next line sync pulse is due, the time generates an interrupt which returns control back to the real time code.

I'm pretty sure this is how the ZX 'slow' mode works. The background process can be written as though nothing else is going on. In truth, its time is heavily diluted by interrupts to service video generation.

I hope this helps.

Argus25 15th Sep 2019 1:42 pm

Re: Orton PIC video clock
 
Congratulations. Lovely job on the clock. I think you should submit it as a project to Silicon Chip magazine.

IanBland 15th Sep 2019 2:34 pm

Re: Orton PIC video clock
 
Thanks for the explanation! The ZX81 display is broadly similar yes.

So just to clarify are your lines still the standard PAL timing (about 64 microseconds)? Also I never would have thought of using a PIC serial port that way. What speed is it running at?

I enjoy PICs for much the same reason as I think you do, it's nice to be close to the metal, counting instruction cycles and the like, and thinking up new "twists" on the hardware.

Also, I love those little CRTs from Brazil :)

Karen O 15th Sep 2019 4:51 pm

Re: Orton PIC video clock
 
The PIC instruction clock is one quarter of the crystal frequency i.e. about 3.7MHz. This is the speed of the serial port too. Each pixel is two lines high and one instruction clock wide. One line of 625 is 236 instruction clocks, which is very close to 64 microseconds.

Yes, Brazil is a fascinating film. Over-stretched technology everywhere! But I think I'll skip the Fresnel lens :)

IanBland 15th Sep 2019 5:14 pm

Re: Orton PIC video clock
 
I think I'm beginning to understand. Am I right in thinking that the TV (being analogue) doesn't care how wide your "pixels" are so long as the sync pulses are correct and the the right time apart?

IanBland 15th Sep 2019 6:08 pm

Re: Orton PIC video clock
 
Sorry to keep asking questions, but how is your serial port configured? Is it SPI?

Karen O 15th Sep 2019 6:09 pm

Re: Orton PIC video clock
 
Hi Ian,
You are correct. To the TV the pixels are just a varying waveform. The same is true of digital TVs which have analogue inputs. A digital telly will construe its own pixels only after filtering and smoothing out an analogue input. There are no pixels when it comes to analogue TV signals!

Karen O 15th Sep 2019 6:16 pm

Re: Orton PIC video clock
 
On the serial port: I use the synchronous/asynchronous serial port in synchronous mode. This serial port has double buffering to allow back-to-back transmission. The SPI port is single buffered and would need a gap between consecutive bytes. I have used the SPI port for video generation of text on a grid where a gap is tolerable, but in this application the digits are too wide to render in single bytes.

IanBland 15th Sep 2019 11:44 pm

Re: Orton PIC video clock
 
Thanks, that makes sense now!

duncanlowe 18th Sep 2019 6:36 pm

Re: Orton PIC video clock
 
Quote:

Originally Posted by Radio Wrangler (Post 1176425)
Rather like a prop from Gilliam's 'Brazil' if you have a Fresnel lens dangling in front of it.

When the film came out, Proops on Tottenham Court Road were selling off a lot of those Fresnel lenses, I wondered at the time if the studio had sourced them there.

Karen O 18th Sep 2019 7:06 pm

Re: Orton PIC video clock
 
I'm kinda hoping that Santa will bring me some new ducting this year :)

I did make something like a Brazil monitor a while ago. I salvaged a tiny CRT monitor from a defunct camcorder, and mounted it on a box with a credit card size Fresnel in front of it. My little piece of Brazil 8-)


All times are GMT +1. The time now is 12:43 pm.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.