6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 8:45 am

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Display controller
PostPosted: Fri Sep 27, 2019 2:46 pm 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
I am looking for some way to add a display controller (with either composite or VGA output) to my 6502 retro computer design. My basic requirement is to do not use any modern microcontrollers or FPGAs doing the job. Only classic, retro chips. It would be also nice, if it wouldn't be required do use any of the "mystery pins" of the 6502. I already created my CPU board some time ago, with serial terminal operation in mind. So pins like SYNC or RDY are not present on system bus connector.
Is there any "simple" chip, that I can use? I do not need any sophisticated features. Most basic text interface will be fine.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Fri Sep 27, 2019 4:29 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Many people have interfaced the Texas Instruments TMS9918 to 6502, 6809, and Z80 systems. As a bonus it uses its own memory which simplifies integration with existing systems. While it can use DRAM's, many people have interfaced it with SRAM as well. See this page: https://hackaday.io/project/160851-tms9 ... deo-memory

It was used on the Ti 99/4a and MSX systems during the eight bit era, so it's definitely an authentic VDP.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Sat Sep 28, 2019 12:45 pm 
Offline

Joined: Sat Aug 19, 2017 1:42 pm
Posts: 35
Location: near Karlsruhe, West-Germany
Atlantis wrote:
I am looking for some way to add a display controller (with either composite or VGA output) to my 6502 retro computer design. My basic requirement is to do not use any modern microcontrollers or FPGAs doing the job. Only classic, retro chips.

What about an 80column card as built for the Apple II? The controller is a 6845/6545. Some examples are listed here:
http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Interface%20Cards/80%20Column%20Cards/
The "standard" is the Videx Videoterm. The Videx Ultraterm has more RAM and better resolution.

Regards
Ralf


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Sat Sep 28, 2019 1:14 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
The SYNC and RDY pins aren't normally needed for operating a display controller. You might only need RDY as a wait-state while accessing the registers of a slow I/O chip.

You should probably look at Ben Eater's "World's Worst VGA" project to nail down the basics of generating vsync, hsync, and pixel outputs. Then I would recommend you make use of the 6502's quirk of only performing RAM access during the Phi2 phase of each clock cycle, and use the remaining Phi1 phase to pull video data out of RAM. This means, trivially, you can pull 1 byte per CPU clock cycle to generate pixels with. This is an authentic technique used by, for example, the BBC Micro and the C64.

As a point of reference, if you're happy with roughly QVGA resolution (320x256) and 50Hz refresh rate, you can generate that with an 8MHz pixel clock - that's what the BBC Micro did in Modes 1 and 4. Such a signal is PAL TV compatible, so you can feed it to a Composite output. At 1 bit per pixel (enough for text), you will need to feed it with 1MB/s, and you will need to reserve 10KB for the display bitmap. If you reserve 20KB and increase the dot clock to 16MHz, feeding it with 2MB/s of data, you can have 640x256, enough for 80-column text with a typical 8x8 font. Reserving 40KB and turning on interlacing, you can push it to 640x512, though this will then flicker noticeably on a CRT; LCDs probably won't care, as long as they will actually sync to such an archaic signal.

If you can source a 6845 CRTC, that will give you a lot of help in generating sync signals and address sequencing, or you can build a sufficient replacement with discrete logic as Ben Eater does. Combine that with a parallel-to-serial shift register to turn bytes into pixels, and some glue logic to switch the memory bus between "display" and "CPU" modes for each phase of the CPU clock, and you'll be golden.

You have a lot of flexibility in how you map that RAM into your address space, and in how you generate pixels from each byte of video data. If you don't want to permanently give up 10 or 20KB of address space, you can attach a separate RAM chip with a toggle to overlay it in place of some of your conventional RAM, and thus map it in only when actively updating the display. I recommend you make it a straight bitmap, and do all text rendering in software; this not only simplifies the hardware, but will also make it relatively easy to add simple graphics capabilities.

However, if you want to strictly minimise RAM consumption, you could instead store one character code per cell. This requires you to read each row of characters multiple times, once for each video scanline it covers, and pass the character data through a character generator on its way to the pixel shift register. The character generator could itself be a 2KB RAM, ie. 256 character codes each with 8 rows of 1-byte pixel groups, and you can then store an 80x32 character matrix in 2.5KB of RAM. With some mildly clever glue logic, you can conveniently map that onto a 4MHz CPU clock.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Mon Sep 30, 2019 5:35 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
EF9345 can do 40*25 and 80*25 text in color.

The chip is out of production, but it still shows up at ebay.
Datasheet starts at page 14 of the PDF.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Mon Sep 30, 2019 10:03 am 
Offline

Joined: Sat Aug 19, 2017 1:42 pm
Posts: 35
Location: near Karlsruhe, West-Germany
ttlworks wrote:
EF9345 can do 40*25 and 80*25 text in color.

A similiar but elder chip is the Thomson EF9364: 64*16. Eltec used this chip with their Eurocom 1. The name of this additional board is VIC-1. A German documentation.

This is the board:

Code:
Broken external image link
http://www.ralf-kiefer.de/VME/ELTEC/E1VIC1BSklein.JPG

Regards
Ralf


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Mon Sep 30, 2019 11:39 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
Ralf, thanks for digging this out, nice picture of the PCB.

EF9364, now this reminds me to the NKC (NDR Klein Computer). //No 6502, only Z80 and 68K, sorry.
Module 'CRT' was EF9364 based.
Some documentation about NKC text\graphics video hardware is here.

Since we are at it, something about displaying graphics:
I remember to have had built a EF9367 based "graphics card" for a 6502 system back in 1987, inspired by the GDP64K graphics module of the NKC.
Of course, EF9367 is more interesting for CAD than for implementing video games, and scrolling text with that sort of chip certainly is an issue.
//SN74F538 seems to be a replacement for the exotic AM25LS2538 used in the GDP64k.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Tue Oct 01, 2019 6:03 am 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
Martin_H wrote:
Many people have interfaced the Texas Instruments TMS9918 to 6502, 6809, and Z80 systems. As a bonus it uses its own memory which simplifies integration with existing systems. While it can use DRAM's, many people have interfaced it with SRAM as well. See this page: https://hackaday.io/project/160851-tms9 ... deo-memory

It was used on the Ti 99/4a and MSX systems during the eight bit era, so it's definitely an authentic VDP.


Thank you for suggestion. I will take a closer look, it looks interesting.
I see there TMS9918 is a NTSC only chip. There is an another version - TMS9929 - which requires additional circuitry to generate either PAL or SECAM signal. Will it be difficult task to make it into PAL composite output?

BTW, ppeaking 6809... Is there some easy to implement version of BASIC for Motorola MC68xx CPUs? I was able to get some MC6802 chips and I consider using them to make another 8bit computer. It is almost pin compatible with 6502, so it will need only minor changes to the existing design of CPU board and should be compatible with existing peripheral boards. Is there something like EhBasic fot this CPU family?


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Tue Oct 01, 2019 8:08 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
(although OT) you may look at AnyCPU.org and look for 6800 / 6802 and MiniFlex what was an FDOS for 6800 and most likely offers a BASIC (TSC I think).
There may be somewhere an MiniFlex archive like there is (was?) a Flex archieve (for 6809).


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Wed Oct 02, 2019 5:46 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1431
The 'Matra Alice' (sold in France beginning in 1983) had a 6803 and Microsoft BASIC.
There is an emulator with ROM images in the internet, but I'm not sure if a disassembly listing of the ROMs does exist.

Compared to the 6800, the 6802 and 6803 had some on chip peripherals and 10 additional instructions.

BTW: 6809 is not binary compatible to the 6800, some of the OpCodes went to a different place in the instruction map, take care.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Wed Oct 02, 2019 1:21 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Atlantis wrote:
I see there TMS9918 is a NTSC only chip. There is an another version - TMS9929 - which requires additional circuitry to generate either PAL or SECAM signal. Will it be difficult task to make it into PAL composite output?

I don't know that much about the TMS9929, but a google search shows that other people have built adapters for RGB monitors.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Wed Oct 02, 2019 9:08 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1250
Location: Soddy-Daisy, TN USA
For what it's worth, I have collected a lot of documentation on the TMS9918 series chips.

I highly recommend this chip if you are looking for that vintage, CRT goodness.

https://github.com/cbmeeks/TMS9918

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Fri Oct 04, 2019 7:09 am 
Offline

Joined: Tue Jun 19, 2018 8:28 am
Posts: 122
Martin_H wrote:
I don't know that much about the TMS9929, but a google search shows that other people have built adapters for RGB monitors.


Unfortunately at this point I do not have any RGB monitor. Ten years ago it wouldn't be an issue - most of CRT TVs in Europe had SCART connector, with RGB signals. Now I have only one CRT TV set with composite input.
If it will be possible maybe I will try to generate both signals. But for as for now, composite is a priority for me.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Fri Oct 04, 2019 8:35 am 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
For initial testing at least, you could just go with the Y luminance output.

The 9918A outputs sync at 2v, black at 2.3v and white at 3v. The 9928/29A output sync slightly lower at 1.8v but the same for black to white levels.

If you subtract 2v from 9928/29 output levels you have a 1v peak to peak composite output.

Exactly how to do that is another google search away, but I might be tempted to try using a voltage divider to put 2v on the "ground" and leave the Y signal as is.


Top
 Profile  
Reply with quote  
 Post subject: Re: Display controller
PostPosted: Fri Oct 04, 2019 1:53 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
It should be sufficient to just AC-couple the signal to the output. You do that by inserting an unpolarised capacitor in series with the signal, plus a high-value resistor in parallel with the capacitor to ensure it drains harmlessly when not actively connected to anything.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 56 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: