22
A2 Video Streamer By Alex Lukacz

A2 Video Streamer

Embed Size (px)

Citation preview

A2 Video Streamer

By Alex Lukacz

What is it?

• Hardware that sends Apple IIc or IIe video serial stream over high speed USB.

• Software that runs on desktops / laptops / tablets and shows the video feed.

The aim was to get a mobile display for my IIc.

• DVD Player.

• Composite USB streamers.

• Original flat panels.

• LCD panels.

• iPad? What no video in? Arrhhh!!!

•Bulky.•Not great use of screen space.

•Poor quality.•Flickering.•Noise / interference.•Difficult to customise view size.

•Expensive.•Hard to find.•Poor contrast and no back light.

http://www.callapple.org/documentation/technical-notes/apple-c-flat-panel-lcd-conversion/

This will be going on my next Christmas wish list.

•Shows how hard it is to get something that shows a reasonable picture.

http://quinndunki.com/blondihacks/?p=1998

http://www.eljavo.com/en/la-apple-c-a-color/

•LG Philips LB084S02 panel.•Interesting option.

What problem do all of these options have in common?

COMPOSITE

Why?•Not well suited to modern technology.•Only monochrome on PAL IIc.•I can go on and on and on …

Why deal with it when you don’t have to?

iPad WiFi or iPad USB?

•Suspect the lag on WiFi would be too great.

•Streaming via USB is possible.

http://www.redmondpie.com/how-to-monitor-canon-eos-dslr-camera-from-ipad-video/

http://www.exolabs.com/products.html

Research

http://kaput.retroarchive.org/appleii/appleiidigital.png

http://john.ccac.rwth-aachen.de:8000/patrick/data/PALcard.pdf

How simple is this?Cut out the composite part of the circuit and get a better picture. How sweet is that?

Understanding the Apple IIe by Jim Sather Page 8-18contains schematic for PAL video circuit.

IIc video port (serial) to component (YPbPr)

Analysing signals from the IIc video port.

Checking to see which signals are going to be ok to send digitally.

Expected to see a square 14M signal but found a saw wave instead.

Logic Analyser Testing

Clock pulse does not look even but that is because this LogicAnalyser does not have a 14MHz (or multiple of) clock selection.Will need to use the Apple II clock when streaming data.

Which graphics tool do I use to display the Apple II window?Needs to be portable.

Knock something up and display a test pattern.

Microcontroller with high speed USBCypress EZ-USB FX2LP microcontroller (CY7C68013A).

14MHz streaming over high speed USB $10 deviceEasy to connectLossless signalNo overhead with video protocolsBypass NTSC / PAL processing

Modes: ‘Ports’ mode ‘Slave FIFO’ mode GPIF - General Programmable Interface

'Slave FIFO' mode: Synchronous AUTOIN

USB side: EndPoints BULK, INTERRUPT or ISOCHRONOUS transfers Buffers Packet per transfer Queues

Programming: RAM EEPROM USB from application

Sampling

14MHz -> Clock

WNDW Bit[0] -> Line and page syncSEROUT Bit[1] -> Data bitCREF Bit[2] -> Colour reference signal. Needed?GR Bit[3] -> Graphics modeSpare Bit[4] -> Maybe for colour - TEXT?Spare Bit[5] -> Maybe for colour - SEBG?Spare Bit[6] -> Maybe for colour - LDPS?Spare Bit[7] -> Spare

Note: For monochrome only the clock and bits 0 and 1 are needed.

Development and TestingFirmware Software

Keil uVision2 Microsoft Visual C++ 2008

Cypress USB examples are great if you have the professional versions of uVision2 and Visual Studio but if you have the free versions then they are a pain in the butt.That’s the difference you get when using products from a company that targets thecommercial sector as opposed to the education sector.

if (EndPt->FinishDataXfer(buffers[i], rLen, &inOvLap[i], contexts[i])) {BytesXferred += len;for (int iByte = 0; iByte < rLen; iByte++) {

if (!bProcessData) {if (!(buffers[i][iByte] & 1)) {

if (iDisplayBlank > 8000) {iDisplayY = 191;

}else {

if (iDisplayY > 0)iDisplayY -= 1;

}// iDisplayX = -7; // 80 column setting.

iDisplayX = -13; // 40 column setting.iDisplayBlank = 0;bProcessData = TRUE;

}else {

iDisplayBlank += 1;}

}if (bProcessData) {

if (iDisplayX < 560) {if (iDisplayX >= 0) {

if (!(buffers[i][iByte] & 2)) {color[iDisplayY][iDisplayX][0] = 255;color[iDisplayY][iDisplayX][1] = 255;color[iDisplayY][iDisplayX][2] = 255;

}else {

color[iDisplayY][iDisplayX][0] = 0;color[iDisplayY][iDisplayX][1] = 0;color[iDisplayY][iDisplayX][2] = 0;

}}iDisplayX += 1;

}else {

bProcessData = FALSE;}

}}

}

Take out the Window, OpenGL and USB code and the remaining code is quite short. The data processing part is very simple.

ResultsHigh Resolution Graphics Double High Resolution Graphics

Note: Page is shifted to the left compared to HGR.

ResultsText

Monochrome text can be any colour including white, green or amber.

Colour display is still a work in progress.

Colour

Will try and match something like AppleWin output. Normal 50% Scan Lines

Issues

• Still working on getting a colour solution.

• Could only get BULK USB working. Prefer to get ISOCHRONOUS transfers working.

• 80 Columns starts a character earlier than 40 Columns even though they both have the same line width.

• Need to crapify (technical word) the picture to make it look more like a vintage monitor. This is the same issue that emulator developers have.

Extra InformationWNDW signal is good for synchronisation because it changes state just before

the data begins but it can not be used to determine the end of line because it finishes before the data ends.

LDPS signal can be used to determine if 80 Columns/HGR or 40 Columns/GR is being used. Pulse is half the size for 80 Columns / HGR.

To determine which graphics mode is selected these signal lines are needed. Will this be needed for colour processing?

Mode TEXT Mixed GR/TEXT Mixed HGR/TEXTHGR DHGR

GR = 0 5/0 5/0 5 5

TEXT = 5 0/5 0/5 0 5*

SEBG = pulse 5/5 0/0 0 0

* TEXT signal is high in DHGR mode.

Design NoteUsing SEROUT and accompanying signals is not difficult. I encourage you to give it a go. I’ve used this method to build a better streamer but I would like to see what others can do.

VGA cards like the Guimauve 2000 and Nishida Radio’s VGA options already process serial data. They use FPGAs to do the processing but what about using other devices such as a Raspberry Pi or a PSoC or a dedicated VGA chip?

As screen technology has progressed video adaptors have been built to take up the slack from dwindling numbers of the original display solutions. As screen sizes increase the less appealing they for me as vintage monitor replacements. What sparks my interest is the current tablet market because the screens are of a similar size to our old favourites and the high resolutions can be used to reduce pixellation.

I thought that video streaming to the iPad would take one to two days to set up. It has taken quite a bit longer and I’m only half way there.

To be continued …

http://lukazi.blogspot.com.au/search?q=A2VideoStreamer

Conclusion