Author Topic: CGA timing, request for documentation  (Read 9752 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
CGA timing, request for documentation
« on: July 20, 2016, 07:47:43 pm »
hi,
I got an old 1 bit amber color CGA-CRT and I am willing to "adapt" my VGA-VDU to CGA
I got it for free, but life is never perfect, there's one catch: CGA's not that well documented

the pinout and the frequencies can be found on almost every ontopic web
search result for the right keywords

also the Wikipedia page has a pretty decent summary including colors etc etc
but most of the article deals with the PC-side hardware (video card)
not the timing nor the connection between them.

I am looking for the timing, an example of time relations between signals,
I need it in order to adapt my VGA-VDU, written in VHDL

tips and tricks are appreciated  :-+


 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: CGA timing, request for documentation
« Reply #1 on: July 20, 2016, 08:04:07 pm »
Hi

I ama little confused, is the screen just amber or full glorious 8 colours?

The reason is that if it is just amber, then technically the monitor would MDA (monochrome display adapter) and the timing will be completely different because MDA is much higher resolution than CGA
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: CGA timing, request for documentation
« Reply #2 on: July 20, 2016, 08:10:29 pm »
Hi

I ama little confused, is the screen just amber or full glorious 8 colours?

The reason is that if it is just amber, then technically the monitor would MDA (monochrome display adapter) and the timing will be completely different because MDA is much higher resolution than CGA

Could also be Hercules but I seem to remember there was a mono monitor standard with CGA type timings as well just to confuse things..
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: CGA timing, request for documentation
« Reply #3 on: July 20, 2016, 08:22:21 pm »
Here are a couple of links that seem to concure on the sync freq/rate for MDA

http://minuszerodegrees.net/mda_cga_ega/mda_cga_ega.htm
https://en.m.wikipedia.org/wiki/IBM_Monochrome_Display_Adapter

Not sure if IBM officially supported Hercules, Hercules produced a third party display adapter that became a defacto standard.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13833
Re: CGA timing, request for documentation
« Reply #4 on: July 20, 2016, 08:29:26 pm »
CGA cards originally had a NTSC compatible composite video output.  The timings should be near as dammit NTSC (which is well documented) in all official modes.     The CGA and MDA/Hercules pinouts are totally different so it shouldn't be difficult to figure out wha you actually have.  I believe you could get mono  EGA monitors ('greyscale' in green or amber) which had a certain popularity in companies which differentiated the PC specs different levels of manglement were allowed to have.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: CGA timing, request for documentation
« Reply #5 on: July 20, 2016, 08:51:10 pm »

Think you should look at a 6845 display controller.
https://en.wikipedia.org/wiki/Motorola_6845
http://www.classiccmp.org/dunfield/r/6845.pdf

and NTSC

The CGA circuit was wrapped around a 6845

I have seen a better PDF then this one.
Note that the graphics memory layout could be a big mess.
Instead of a nice simple array, you might have all character row 1 grouped together in memory followed by the remaining rows in groups.
You might have two characters displayed while 6845 thinks it is one character. The characters here could be graphic blocks in character time.
An example would be the 6845 displaying characters 8 dots wide and 12 rows tall and this turning into a 2w x 3h blocks (4x4 graphic block)

The 6845 was programmed to make logic simple even if the graphics memory became a mess.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #6 on: July 20, 2016, 08:55:34 pm »
is the screen just amber

it's amber CRT, used in a transportable computer
unfortunately I don't have a graphic card to check which is right, MDA? CGA?
and to solve my doubts about timing and signals through a DSO
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #7 on: July 20, 2016, 09:04:08 pm »
The 6845 was programmed to make logic simple even if the graphics memory became a mess.

my VGA-VDU is text-only, it allows you to put 80x30 chars on the screen through a serial (RS232) connection, you can also have an hardware cursor, with 3Hz blinking

I am willing to port this VHDL project to the amber CRT, which requires 12V, and it's 9 inches size, very small and cool.

I will have to adapt the text screen size, from 640x480 pixel -> 80x30 chars, to 320x200 pixel -> 40x25 char, I also need to redesign my font-rom, from 8x16 to 8x8 pixel
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #8 on: July 20, 2016, 09:13:20 pm »
Code: [Select]
  -- VGA 640x480

  process (in_clk, in_reset, counter_h, counter_v)
  begin         
    if in_reset = '1' then
      counter_h <= (others => '0');
      counter_v <= (others => '0');   
    elsif rising_edge(in_clk) then
      -- Pulse width: Tpw = 96 cycles @ 25 MHz
      -- Back porch: Tbp = 48 cycles
      -- Display time: Tdisp = 640 cycles
      -- Front porch: Tfp = 16 cycles
      -- Sync pulse time (total cycles) Ts = 800 cycles =640+96+48+16

      if counter_h >= (639+16) and counter_h <= (639+16+96) then
        out_sync_h <= '0';
      else
        out_sync_h <= '1';
      end if;                                 
     
      -- Pulse width: Tpw = 2 lines @ 25 MHz
      -- Back porch: Tbp = 33 lines
      -- Display lines: 480 lines
      -- Front porch: Tfp = 8000 cycles (10 lines)
      -- Sync pulse time (total cycles)  (525 lines= 480+33+2+10
      if counter_v > (479+10) and counter_v < (479+10+2) then
        out_sync_v <= '0';
      else
        out_sync_v <= '1';
      end if;
      -- horizontal counts from 0 to 799
      counter_h <= counter_h+1;
      if counter_h = 799 then
        counter_v <= counter_v+1;
        counter_h <= (others => '0');
      end if;
      -- vertical counts from 0 to 524
      if counter_v = 524 then
        counter_v <= (others => '0');
      end if;
    end if;
  end process;

I have to *adapt* something like the above  :D
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: CGA timing, request for documentation
« Reply #9 on: July 20, 2016, 09:23:55 pm »
Hercules was the same display format as MDA, just with bitmap graphics capability. Not all monochrome monitors are MDA/Hercules: for example, many laptop computers had CGA graphics but only monochrome internal panels.


Not MDA.

Docs on CGA (and other hardware that uses the CRTC chip) timing can be found here.
http://www.6502.org/users/andre/hwinfo/crtc/crtc.html
 

Offline CJay

  • Super Contributor
  • ***
  • Posts: 4136
  • Country: gb
Re: CGA timing, request for documentation
« Reply #10 on: July 20, 2016, 09:27:10 pm »
is the screen just amber

it's amber CRT, used in a transportable computer
unfortunately I don't have a graphic card to check which is right, MDA? CGA?
and to solve my doubts about timing and signals through a DSO

Ohhhh, which transportable?

Any pics?
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #11 on: July 20, 2016, 09:38:23 pm »
Ohhhh, which transportable?

Unfortunately I don't know, I got only the glass CRT, unmounted, with its electronics

Any pics?




 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #12 on: July 20, 2016, 10:26:49 pm »
  • maxlogic mx675 rev B, combo, 9pin connector(CGA?MDA?Hercules?) and VGA connector
  • tseng et4000, combo, 9pin connector(CGA?MDA?Hercules?) and VGA connector

I have just called the guy who gave me the CRT for free, he said that the above video cards were working with his CRT, unfortunately they are ISA16 cards, while my PC is ePCI  :palm: :palm: :palm:
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: CGA timing, request for documentation
« Reply #13 on: July 20, 2016, 10:33:55 pm »

Think of this
Change your font-rom to ram and keep it 8x16 pixel in size just do not use full size all the time. Large fast static ram's are cheap these days,
When you program the controller to 8x8 you just load new font in ram or select a different address range. No problem to not use half of the ram to make logic easer.

You might make your VHDL project look like a fancy 6845. The problem is getting the settings correct.
If you divide Hsync with a programmable divider and phase lock it to 1 Hz and control the Dot clock VCO, setup to a new display should be very easy.
When the programmable divider above is correct horizontal on display shows.
Adjusting the settings in fancy 6845 for vertical then gets vertical working. 

Think you will see that the 6845 is your VHDL using ram locations in-place of your constants.
 

Tac Eht Xilef

  • Guest
Re: CGA timing, request for documentation
« Reply #14 on: July 20, 2016, 10:43:32 pm »
  • maxlogic mx675 rev B, combo, 9pin connector(CGA?MDA?Hercules?) and VGA connector
  • tseng et4000, combo, 9pin connector(CGA?MDA?Hercules?) and VGA connector

I have just called the guy who gave me the CRT for free, he said that the above video cards were working with his CRT, unfortunately they are ISA16 cards, while my PC is ePCI  :palm: :palm: :palm:

Just to note: both those cards/chipsets were multistandard MDA/CGA/EGA/VGA (& the ET4000 at least could also do Hercules, & supported XGA), so it doesn't narrow it down as much as you'd hope ;).
« Last Edit: July 20, 2016, 10:45:16 pm by Tac Eht Xilef »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #15 on: July 20, 2016, 10:43:44 pm »
Large fast static ram's are cheap these days,

atm I am using BRAM, I have enough BRAM inside the fpga
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #16 on: July 20, 2016, 10:46:40 pm »
it doesn't narrow it down as much as you'd hope ;).

ah, good  ;D ;D ;D
so, I need to find a 486 PC with ISA slots, in order to plug in the video card
this way I can observe signals going to the CRT through my DSO
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #17 on: July 20, 2016, 10:53:16 pm »
p.s. guys
look at this transportable

Quote
IBM Portable PC 5155
Model:   model 68
Introduced:   February 1984
Price:   US $4225.
Weight:   30 pounds
CPU:   Intel 8088 @ 4.77MHz
RAM:   256K, 640K max
Display:   9-inch amber display
   CGA graphics, 80 X 25 text

Storage:   Two 360KB 5.25-inch disk drives
Ports:   1 parallel, 1 serial, CGA video
OS:   IBM PC-DOS Version 2.10 (disk)

the display is 9-inch amber display, CGA graphics, 80 X 25 text, so, it seems the video card was connected to an internal monochrome monitor :o :o :o :o
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13833
Re: CGA timing, request for documentation
« Reply #18 on: July 21, 2016, 12:00:03 am »
Trace the input signals from the plug to the monitor PCB.  I'm assuming its got a 9 pin plug.  The H and V syncs are on known pins, so that leaves you with either MDA/Hercules video on pin 7, and intensity on pin 6 or CGA RGBI on pins 3,4,5 & 6 respectively, or just possibly EGA  which also uses pins 2 and 7.   If its CGA or EGA there will be a resistor network (or some sort of DAC chip) to combine the colour signals to get a 'greyscale' before it goes to the CRT cathode driver.
See http://www.repairfaq.org/REPAIR/F_Pinouts1.html#PINOUTS_016
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: CGA timing, request for documentation
« Reply #19 on: July 21, 2016, 12:28:53 am »
I can't think of any portables that actually used MDA. Generally multistandard super-vga cards didn't support it either. Some had BIOS-level MDA emulation so that software that expected MDA attributes (like underline) would work, but they didn't actually support MDA monitors.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13833
Re: CGA timing, request for documentation
« Reply #20 on: July 21, 2016, 12:44:07 am »
I've got a Kangaroo 'portable' (luggable) PC here that had MDA on a built in amber CRT monitor originally.  I upgraded it to a Cyrix Cx486SLC2-50 board and a Hercules graphics card so I could run Windows for Workgroups v3.11 on it.

Also some EGA cards could be configured for a MDA monitor, so its not unreasonable to suppose that might still have been possible on some multistandard EGA/VGA cards.   

However the monitor's pinout will tell all, even if its something weird like Mono VGA on a 9 pin connector as that uses the Green pin for the mono signal which would be pin 2.  Analog input pins will have 75R to ground and digital ones of that era will typically look like a TTL input i.e 2.5V or higher if floating with the monitor powered up.
« Last Edit: July 22, 2016, 01:14:28 am by Ian.M »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: CGA timing, request for documentation
« Reply #21 on: July 21, 2016, 11:07:09 pm »
on this weekend I will try to understand better


guys, the fpga(1) is 3.3V while the CRT input is TTL/5V
assuming the bandwidth won't be greater than 20Mhz
what do you suggest in order to interface the fpga with the CRT ?


(1) Spartan3E-500, Xilinx
 

Offline helius

  • Super Contributor
  • ***
  • Posts: 3717
  • Country: us
Re: CGA timing, request for documentation
« Reply #22 on: July 22, 2016, 01:04:26 am »
You can use a jellybean octal buffer like 74hct244 to raise 3.3v levels to TTL. If you are doing more stuff in the same domain, the Silego parts are very cool and can save a lot of space while also doing level translation, comparators, PLD, reset, etc.
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: CGA timing, request for documentation
« Reply #23 on: July 24, 2016, 02:01:27 pm »
I used to have a Smasung Snycmaster CRT (14"), the monitor had an input connector with only 9 pins. It came with a 15 to 9 pin cable....
 

Offline wblock

  • Regular Contributor
  • *
  • Posts: 239
  • Country: us
Re: CGA timing, request for documentation
« Reply #24 on: July 24, 2016, 04:48:39 pm »
I used to have a Smasung Snycmaster CRT (14"), the monitor had an input connector with only 9 pins. It came with a 15 to 9 pin cable....

Early VGA monitors had 9-pin connectors.  Bad things happened when those monitors were connected to non-VGA cards or vice versa, so they went to the HDD15 connector.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf