Shop OBEX P1 Docs P2 Docs Learn Events
Sampling at an odd frequency? — Parallax Forums

Sampling at an odd frequency?

MarkSMarkS Posts: 342
edited 2009-11-03 02:28 in Propeller 1
I have a project I'd like to start working on. I have an old Macintosh Plus with a bad analog board.

The oscillator on the original Macs (128K, 512K and Plus) is 15.6672 MHz and is is divided in half for the processor. The video signal on the motherboard is clocked at the full 15.6672 MHz. What I want to do is read that signal with a Prop and output a VGA signal. My concern is that I'm not going to be able to sample that frequency accurately. It would be easier if it were 16 MHz, but Apple has never been known to make their hardware easy to access. The video signal is a 5v TTL pulse, with a low representing a white pixel and a high representing a black pixel.

Will this be possible with the Prop? One option I'm considering is swapping the oscillator with a 16 MHz version, but I cannot find information on exactly why Apple chose such an odd frequency in the first place and I'm not sure what, if anything, the increase in frequency will do.

My reasons for doing this project are basically sentimental, but it should also be fun.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-11-02 23:26
    They probably chose that clock frequency because it's an integer multiple of numerous common baudrates. 'Makes it easy to divide the processor clock for baudrate generation.

    -Phil
  • MarkSMarkS Posts: 342
    edited 2009-11-02 23:31
    That is the second time I've heard that today. I guess that's the reason then. I could have sworn it was something else though.

    Anyway, this is a problem. I cannot simply read the signal and act upon it since each pulse represents one pixel. Anything other than a 50% grey pattern will throw this off. I must sample it with a generated pulse.
  • kwinnkwinn Posts: 8,697
    edited 2009-11-02 23:36
    As Phil said, to divide down for a common baud rate or generate timing for video. If this is monochrome video the display frequency could be quite different from VGA.
  • MarkSMarkS Posts: 342
    edited 2009-11-02 23:39
    kwinn said...
    If this is monochrome video the display frequency could be quite different from VGA.

    It is. My plan is to read the pulses and set the pixels, possibly using Kye's bitmap generator. The signal will be interpreted, not fed directly through. This will affect the speed, but not too badly if the Prop is running at 80 MHz.
  • Bill HenningBill Henning Posts: 6,445
    edited 2009-11-03 00:37
    Get one more 15.6672MHz crystal, and divide it by two to get 7.8326MHz, or just get a 7.8326MHz crystal

    Run the prop at 7.8326MHz with PLLx8 for 62.6608MHz clock rate.

    Use a Kurenko's 20Mbit receive (that uses counters), it will now receive at 15.6672Mbps. Use WAITPEQ to synchronize the reads to Mac's HSync and Vsync. You need 3 pins for input.

    Receive the 512x384 bitmap into hub memory, it takes 24576 bytes.

    Run another cog generating XGA-like timing with at 31.3304MHz clock, ie double wide pixels. Display each scan line twice.

    Presto, scan converter from original Mac!

    Its actually pretty easy.
    MarkS said...
    I have a project I'd like to start working on. I have an old Macintosh Plus with a bad analog board.

    The oscillator on the original Macs (128K, 512K and Plus) is 15.6672 MHz and is is divided in half for the processor. The video signal on the motherboard is clocked at the full 15.6672 MHz. What I want to do is read that signal with a Prop and output a VGA signal. My concern is that I'm not going to be able to sample that frequency accurately. It would be easier if it were 16 MHz, but Apple has never been known to make their hardware easy to access. The video signal is a 5v TTL pulse, with a low representing a white pixel and a high representing a black pixel.

    Will this be possible with the Prop? One option I'm considering is swapping the oscillator with a 16 MHz version, but I cannot find information on exactly why Apple chose such an odd frequency in the first place and I'm not sure what, if anything, the increase in frequency will do.

    My reasons for doing this project are basically sentimental, but it should also be fun.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.mikronauts.com Please use mikronauts _at_ gmail _dot_ com to contact me off-forum, my PM is almost totally full
    Morpheusdual Prop SBC w/ 512KB kit $119.95, Mem+2MB memory IO board kit $89.95, both kits $189.95
    Propteus and Proteus for Propeller prototyping 6.250MHz custom Crystals run Propellers at 100MHz
    Las - Large model assembler for the Propeller Largos - a feature full nano operating system for the Propeller
  • MarkSMarkS Posts: 342
    edited 2009-11-03 02:28
    That sounds like a plan and is actually what I was planning on doing. Now to find that extra 15.6670 MHz crystal... Not exactly a common part.

    Actually, the screen is smaller on the Plus. It is 512x342, or 21888 bytes (if it really matters...).
Sign In or Register to comment.