Last time I went through junk in the basement I found old ZX spectrum.This was the time I got the great idea. Have the ZX spectrum implemented in FPGA. So after a bit of searching I found ZXgate project. This is exactly the project I have been looking for. It implements the peripherals of ZX Spectrum, just have to add CPU and some external parts.
In meantime, while I was gathering information. I received a LCD screen from a broken notebook. 17inch TFT LCD screen with resolution of 1024×768 and 18bit colors. Calculated refresh rate 60 Hz. This looked like great opportunity to learn something new, and to create something cool. I decided to use the LCD as ZX spectrum display.
As for the hardware part I had this SparkFun’s Spartan 3 breakout board. 500k gate FPGA that should be big enough most home made projects. This board as such is without any external RAM and Flash ROM, except for the SPI Flash.
I needed to design RAM board that goes with the FPGA breakout board. One of the cheapest SRAM available from Farnell is AS7C3256 – 32kx8 10ns SRAM. I decided to go with 2 chips. 64k doesn’t seem much these days, but is plenty for ZX Spectrum. 64k is the size of Z80 address space.
The IO board was inspired by ZXgate’s zxio board. The original design was using through-hole parts and contained one Reset button, Composite out (B/W only), PS/2 keyboard and Tape connection. I have redesigned it to SMD parts and also added speaker, 2 LEDs and NMI button.
The last board contains LVDS transmitter from TI – SN65LVDS84. This is the key component that sends data to my TFT LCD panel. I am not sure (and not experienced enough) whether the FPGA would be able to drive the LVDS on its own.
If someone is interested in the board designs I have them in eagle format,
The ZXgate project ran by it’s own without any major modifications. I just didn’t like the idea of having external ROM for the Spectrum. I have placed the ROM code in the BRAM of the FPGA, and preloaded the BRAM with the correct data.
After deploying of the VHDL I saw Sinclair copyright. Really great feeling If you ask :-). But the computer behaved strangely – it died after ~5 seconds. After reprogramming of the FPGA same behavior repeated. It turned out to be result of my fight with the FpgaPlanner tool and I forgot to enable pull-ups on the buttons – duh.
Next step was to add the LCD panel controller. The LCD controller is pretty straight-forward once you understand what “DE-mode” is. It turns out that current LCDs don’t need two H/V sync signals and have just one signal – Data Enable. You still need to over-scan the screen by ~300pixels horizontally and ~100lines vertically, but over-scanning means to just keep clock running. DE signal it high only when pixel data is sent to the screen (low when off-screen).
Nice thing about 1024×768 screen is that ZX spectrum’s screen (256×192) fits there 4 times. So each pixel is displayed as 4×4 dot. The border is not displayed on the LCD, as it does not display anything valuable, except for the loading curtain.
The whole screen generator consists of 2 counters – horizontal and vertical and some logic that copies data from the Vram to screen. Both counters are used in address generation. Actual data is transfered even when off-screen, but the LCD panel ignores them.
I have replaced the VRAM and ARAM (video and attribute ram) with Dual port RAM. This way the ZX spectrum works uninterrupted and my display routine works on it’s own.
The result looks something like this:
The FPGA board with the extension boards attached:
There are still many improvements to be done. I plan to store some applications to the SPI Flash that holds FPGA configuration. The FPGA needs about 250k bytes for it’s configuration and the SPI Flash size is ~2MB. Lot of space wasted.
I might reuse the loading menu from SpecyBoot. This project aims to add Ethernet connection to spectrum and uses nice menu to browse the network repository. Of course I will not add network logic to the FPGA as I want the system to be portable.
If you are interested watch for updates, I will post updated when some time is left.
ISE project can be downloaded HERE
Missing ROMs HERE
I am really not sure by the licenses. If there is something wrong with sharing source I should not have, please contact me, and I will remove the offending material asap.
20 comments
Comments feed for this article
December 23, 2010 at 04:34
Tan Yong Lak
Fantastic of you share another variant.
I’ve similar board(s) but with colecovision.
I’ll try yours hopefully soon
Thanks for sharing.
February 8, 2011 at 15:02
Anunakin
Hi can I run it on a Digilent Spartan 3 3E100?
I think this can run with a Digilent Spartan 3 3E500, right?
I have a Samsung LTM150X0-L21 LCD 1024×768 here….
September 19, 2011 at 20:41
me
Hi, could you post the eagle file for the board with the lvds transmitter?
September 20, 2011 at 21:33
Michal
Hi, sorry for the late reply. You can find lvds transmitter here:
http://robot.mysteria.cz/lvds.zip
Hope it will help :-)
September 21, 2011 at 01:42
me
Thank you!
September 21, 2011 at 04:34
me
Last question,
why was SN65LVDS84 chosen over, let’s say, SN65LVDS83? The SN65LVDS83 can output 8 bits per color channel, while the SN65LVDS84 only outputs 6 bits per color. Was the choice made only to match the lvds receiver on the lcd panel?
September 21, 2011 at 09:29
Michal
The datasheet of the LCD panel said that this is the matching chip. My LCD panel only has 18bpp so no need for another LVDS line.
At first I was really worried about the 60Mhz bus to the lvds transmitter. But it seems to be working without problem :-)
March 4, 2012 at 01:41
uMinded
How did you get the backlight working?? I have a bunch of similar samsung panels but the backlights have a wack of wires going to the controller board. Most are parallel for +/- but the few for control I do not know what to do with!
Thanks!
March 4, 2012 at 09:27
Michal
After applying voltage the panel didn’t come on, so i figured one contact needs to be “enable”. I just tried to apply voltage, or ground the pins. Luckily enough, the backlight started to work.
I believe I also traced the contacts on the PCB to see where they connected to. It was more of educated guess than random poking :).
This controller is one of the simple ones. (Voltage, enable, and PWM signal for brightness) There are some that need bunch of wires connected, and it almost seems like they are connected to some digital “bus” and listen for commands.
April 22, 2012 at 01:43
legacy
hi, could you tell what is the lcd you are working with ? could you post any schematic about how it is connected?
thanks
April 22, 2012 at 09:03
Michal
Hi, the LCD is http://robot.mysteria.cz/TM150XG-02L11.pdf It is 18bpp 1024×768 panel from laptop. The schematic and board design is available in eagle format: http://robot.mysteria.cz/lvds.zip
Hope it helps :-)
May 6, 2012 at 01:06
legacy
thank you for replay, the datasheet is teaching me a lot =D, i got a spartan3e board from a local reseller, and now i am looking for your LCD on ebay, which laptop is it from ? I hope i could find it on ebay, also i will have to get the SN65LVDS84 LVDS transmitter … may be the DS90C385A (from national) is goot enough ?
=)
May 6, 2012 at 09:04
Michal
I have no idea which laptop it is from. The LVDS panels are mostly the same they only differ in resolution and bpp. 18bpp panels have 3+1 LVDS channels (3 data + 1 clock), 24bpp panel will have 4+1 (4data + 1 clock). Higher resolution will probably want higher clock (1024×768 I used wants 60Mhz, there are also panels with 87Mhz requirement).
You will need to get chip compatible with the Panel. DS90C385A is a bit different from the one I used. It is for 24bpp panel (It might work with 18bpp, but I am not sure – depends on how the data is packed on the LVDS link)
May 6, 2012 at 23:48
legacy
hi,
it seems your 15″ LCD has been used in the following laptops:
Asus; A2, A2000, A2500H, A3, A3000 series
Compaq Evo; n100v, n1000v, n1014v, n1015v, n1020v series
Compaq Presario; 900, 1500, 2100, 2500 series
Dell Inspiron; 5150, 5160 series
Hp-Compaq Business Notebook; nc6100, nc6110, nc6120, nx5000, nx6100, nx6110, nx6120, nx9000, nx9005, nx9010, nx9030 series
Hp Pavilion; ze4000, ze5000 series
Ibm ThinkPad; A30, A31, R40, R50, R51 series
Toshiba Satellite; A10, A15, A20, A25, A30, A35, A40, A45, L10, L15, L20, 1130, 1135, 2430, 2435 series
Toshiba Satellite Pro M10-M15 series
Toshiba Tecra; A1, A2 series
i hope this list may help who is looking for this lcd =)
could i ask you to post detailed photos about how you have wired it up ? it will be fine =D
and could i ask where do you got the SN65LVDS84 chip ? i’ve got a bit of trouble in finding it around, and i wonder if it may be i will find this chip on the laptop motherboard, in smd package, and how good will be desoldering it to re-solder on the new pcb.
May 7, 2012 at 07:23
Michal
Nice job with the list.
The chip is SN64LVDS84A available from http://www.ti.com/product/sn65lvds84a
I got it as a sample, I am sure you could buy it somewhere (farnell, mouser, etc)
You wont find this chip in the laptop, LVDS transmitters are usually integrated in the graphics chip – desoldering is not an option.
I have made a picture of the lvds board:
The display is connected using the original connector, that was stolen from the laptop. This way I didn’t have to kill the LVDS cable that is going to the panel, and I could keep the LVDS length minimal on the board.
I don’t know how well it will behave when you solder the LVDS cables directly to the board. (Impendance mismatch, signal reflection, etc etc)
You have to understand that the clock channel works at 65Mhz, and the data links at 65Mhz*7 = 455Mhz each!.
May 9, 2012 at 10:29
legacy
ok, lesson understood: do not toy with the LCD cable, get if from a used laptop and use it =D So i’d better find a whole laptop in order to get the lcd, the cable, and the connector-cable, then soldering the connector on a tiny board that i will ask a local pcb-service to build up for me. I will only have to solder the LVDS chip on this board, and then to wire it up to fpga.
It seems easier this way. Thank you for your Tips =)
September 26, 2012 at 20:20
legacy
hi, any progress ?
i am looking for a 1280×800 10″ lcd, to be used with fpga any idea ? the idea is to produce an ebook reader, i also like to have a touch screen layer.
=)
December 12, 2012 at 20:03
legacy
hi, i have bought a spartan3e 500 breakout kit, what do you think about this kit ? http://www.watterott.com/de/LVDS-Adapter-V2-inkl-10-LCD-Touchscreen
December 14, 2014 at 20:05
legacy
are U still there ?
can i email you ?
i have a request
December 15, 2014 at 10:36
Michal
what kind of request ?