UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Other Discussions > Homebrew Equipment

Notices

Homebrew Equipment A place to show, design and discuss the weird and wonderful electronic creations from the hands of individual members.

Reply
 
Thread Tools
Old 25th Aug 2019, 8:58 pm   #1
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default Orton PIC video clock

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.
Attached Thumbnails
Click image for larger version

Name:	anaclock.jpg
Views:	176
Size:	38.8 KB
ID:	188905   Click image for larger version

Name:	Circuit.jpg
Views:	150
Size:	40.2 KB
ID:	188906  
Attached Files
File Type: txt anaclock.txt (9.8 KB, 64 views)
__________________
Karen O

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old 26th Aug 2019, 2:14 pm   #2
Wendymott
Heptode
 
Wendymott's Avatar
 
Join Date: Jun 2013
Location: Huddersfield, West Yorkshire, UK.
Posts: 942
Default 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.
__________________
Should get out more.

Regards
Wendy G8BZY
Wendymott is offline   Reply With Quote
Old 26th Aug 2019, 5:45 pm   #3
mole42uk
Octode
 
mole42uk's Avatar
 
Join Date: Aug 2010
Location: Bristol, UK
Posts: 1,745
Default 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.
__________________
Richard

Index:
recursive loop: see recursive loop
mole42uk is offline   Reply With Quote
Old 26th Aug 2019, 6:25 pm   #4
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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...
__________________
Karen O

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old 14th Sep 2019, 2:33 pm   #5
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 294
Default Re: Orton PIC video clock

Hi Karen,

Just wondering, is the "pixel" clock the same speed as a standard 625 line PAL television?
IanBland is online now   Reply With Quote
Old 14th Sep 2019, 4:30 pm   #6
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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
__________________
Karen O

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old 14th Sep 2019, 11:49 pm   #7
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 294
Default 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).
IanBland is online now   Reply With Quote
Old Yesterday, 4:08 am   #8
Radio Wrangler
Dekatron
 
Radio Wrangler's Avatar
 
Join Date: Mar 2012
Location: Fife, Scotland, UK.
Posts: 12,323
Default Re: Orton PIC video clock

Quote:
Originally Posted by Karen O View Post
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
__________________
Can't afford the volcanic island yet, but the plans for my monorail and the goons' uniforms are done
Radio Wrangler is offline   Reply With Quote
Old Yesterday, 7:51 am   #9
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old Yesterday, 8:07 am   #10
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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.
__________________
Karen O

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old Yesterday, 1:42 pm   #11
Argus25
Nonode
 
Argus25's Avatar
 
Join Date: Oct 2016
Location: Maroochydore, Queensland, Australia.
Posts: 2,251
Default Re: Orton PIC video clock

Congratulations. Lovely job on the clock. I think you should submit it as a project to Silicon Chip magazine.
Argus25 is offline   Reply With Quote
Old Yesterday, 2:34 pm   #12
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 294
Default 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
IanBland is online now   Reply With Quote
Old Yesterday, 4:51 pm   #13
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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
__________________
Karen O

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old Yesterday, 5:14 pm   #14
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 294
Default 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 is online now   Reply With Quote
Old Yesterday, 6:08 pm   #15
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 294
Default Re: Orton PIC video clock

Sorry to keep asking questions, but how is your serial port configured? Is it SPI?
IanBland is online now   Reply With Quote
Old Yesterday, 6:09 pm   #16
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old Yesterday, 6:16 pm   #17
Karen O
Heptode
 
Karen O's Avatar
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 524
Default 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.
__________________
Karen O

Temporal Paradox: Kills all known grandfathers. Dead.
Karen O is offline   Reply With Quote
Old Yesterday, 11:44 pm   #18
IanBland
Hexode
 
Join Date: May 2015
Location: Northampton, Northants, UK.
Posts: 294
Default Re: Orton PIC video clock

Thanks, that makes sense now!
IanBland is online now   Reply With Quote
Reply

Thread Tools



All times are GMT +1. The time now is 4:59 am.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


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