Enterprise Forever

:UK => Hardware => Display => Topic started by: gflorez on 2018.June.03. 19:25:08

Title: External colour tests
Post by: gflorez on 2018.June.03. 19:25:08
Yesterday I attended a closed doors retro-computer convention. It was a reunion of Retrowiki members on Navia, near Oviedo at north of Spain, just at the Cantabrian sea, about 500Km from Madrid.

Of course I was the only assistant who carried Enterprises, not the others fault, as it is considered a very complete computer, but it was scarcely sold on our country. On the other side, most members of the Spanish website are interested in more than one computer model, not like me....

There was a variety of micro-computers displayed, from  Spectrums on all their many incarnations(even Timex-Sinclair),  to Amstrads CPC PCW CPC+, Oric, MSX, Amiga, Atari, Mac, Silicon Graphics, Raspbwrry-pi, and a lot more that I can't remember now.

But the main intention of the annual reunion is to present, debug and develop new gadgets for the computers, like memory, SD adapters and other peripherals.

I brought my humble contribution, the bus expander and the M-Slot prototype. One of my friends, Dandare, showed a preliminary version of the Dandanator for CPC, that consist on a cheap card(less than 15 Euro) with 512KB FlashRom, able to hold 10-15 games. It is able to load a game instantaneously, and save/load its progress. Nearly 1500 Dandanators for Spectrum have been created up-to-date. Another friend, Habi, presented a card that provides colour and sound to the Amstrad PCW(a silent, only green phosphor monitor CP/M computer, intended only for business).

Talking with Habi  about how a FPGA interprets the colour of the only green screen, the conversation turned to how the microcomputers of that era codified the colour, halving the resolution when doubling the colours. This though lead us to how clever is the design of the LPT table on the Enterprise. Habi himself owns an Enterprise, and asked me how the colour inputs on the expansion connector works. I answered what I know about the tests (https://enterpriseforever.com/hardver/teszteles/) made by Balaguesz. Then he said so quiet: "what if we try to do the same with my 20 euro FPGA? I can take advantage of the already written core for the PCW."

I showed him the Nick description document on Zozo's page an he read it briefly.

The main problem interfacing FPGAs with retro-computers is that they work on 3.3v, but fortunately he has a bridge card that makes the signal conversion.  He gave me some Dupont cables and asked me to connect the required signals to the rear connector of my bus expander.

He needed:

-14MHz clock
-Horizontal and Vertical synchronisms
-Ground only, as the FPGA has its own power supply
-EC0 to EC3
-/EXTC

After a few problems with the Dupont cables connection, soon we had reception of the output signals on the FPGA. Then he made some corrections on the code and tried to compile it. Take in account that the code of a FPGA describes how the real hardware is emulated inside, so it has some strict rules that must be observed. It took about 2 minutes to completely compile the code. But we repeated the procedure several times, because at first time it didn't work as expected. Soon he discovered the real resolution of the Enterprise, did some corrections and after only one hour trying we started to see the effects on the screen.

[attach=1]

[attach=2]

[attach=3]

There is some noise on the injected data, probably due to the proximity of other retro-computers.

Title: Re: External colour tests
Post by: Zozosoft on 2018.June.03. 19:48:48
There is some noise on the injected data,
It is also can be due the wire lenght. Look the schematic of the original expansion board (http://enterprise.iko.hu/schematics/A3PER-12_Enterprise_64-128_Expansion_Motherboard_Schematic.jpg). The video signals only connected to the first slot which is closer to the machine. (Probably due same reason the audio inputs only at the first two slots.)
Title: Re: External colour tests
Post by: gflorez on 2018.June.03. 20:29:20
As always you are right... 

My friend says that it can be very easy to make an expansion card to attach the cheap FPGA. It has a lot of memory and two long headers of all configurable input/output pins.  Imagine the new projects that could be made with it....
Title: Re: External colour tests
Post by: geco on 2018.June.03. 22:18:12
As i see what you did is similar to 1st tests by Balagesz :-) , it is very impressive that it was made within some hours. A very good sprite card could be done, éven a full screen could be displayed with it with 2 color resolution with 16 colors.
Title: Re: External colour tests
Post by: gflorez on 2018.June.04. 09:31:28
Yes the SymbOS screen has 4 colours, but the injected signal has 16 colours at full resolution. The limitation is, the signal can only be injected on displayed zones, not on border zones.

The next weekend he will try to digitalise a graphic to play with it. But then  I need to explain him how the first eight colours of the palette are organised, and how to change the other eight byas colours.

I remember  a chart of colours on some thread.
Title: Re: External colour tests
Post by: geco on 2018.June.04. 10:25:20
And there will be other limitation, colors for external color input are defined by LPT.
Title: Re: External colour tests
Post by: gflorez on 2018.June.04. 10:58:32
Yes, but that is because in the experiment the FPGA is autonomous, its task is very easy, it only admits synchronisms and returns the colours bits and /EXTC. This takes very little of the complete possibilities of this FPGA, not so big as the MIST, but at the side with the ZX-ONE. You can put inside a complete computer, so we can define the needed ROM and RAM segments and communicate the module with the Enterprise buses to take total control. You can, for example, define one or two AY sound chips, like in the other Balagesz project, and inject the output to the Enterprise sound inputs....  It is incredible but possible. We only have to learn how.
Title: Re: External colour tests
Post by: Tutus on 2018.June.04. 11:43:28
This is very promising!
At last someone seriously deals with developments ...

:smt038 :smt038 :smt038
Title: Re: External colour tests
Post by: gflorez on 2018.June.04. 18:34:27
I want a colour chart to show to my friend Habi. Can some one give me a link?
Title: Re: External colour tests
Post by: Zozosoft on 2018.June.04. 18:35:20
I want a colour chart to show to my friend Habi. Can some one give me a link?
http://ep.lgb.hu/colors.html
Title: Re: External colour tests
Post by: gflorez on 2018.June.04. 21:56:16
Thanks!
Title: Re: External colour tests
Post by: gflorez on 2018.June.05. 00:09:11
Habi said:

"I do not think the noise is due to the length of the cables. Probably the color input pins where only in the first slot because only one expansion should access those signals; more than one would make a short."

Later he realised the real cause:

"The noise on the signal is due to wrongly injecting the pixel on the opposite flank. This makes unstable the colour border".
Title: Re: External colour tests
Post by: Zozosoft on 2018.June.06. 20:40:51
With the Balagesz test hw we got nice stable picture, there is a example of full resolution graphics (Istvanv made the pic with epimgconv)
http://enterprise.iko.hu/video/DSCF7972.AVI

Other possible problem: which Nick chip used?
I discovered during the testing, the 08-04 Nick problems still present with external colors :-( Then it is somewhere at the color outputs...
Example on one of worst machines:
http://enterprise.iko.hu/video/DSCF7929.AVI
Title: Re: External colour tests
Post by: szipucsu on 2018.June.07. 11:49:30
http://enterprise.iko.hu/video/DSCF7972.AVI
http://enterprise.iko.hu/video/DSCF7929.AVI
You can embedd the videos on your site. Upload the videos to the Youtube, get the code there under the video and put the code into the html of your site. It looks smarter.
---
Egyszerűen meg lehet csinálni, hogy a videókat az oldalon meg lehessen nézni. Feltöltöd a videót a Youtube-ra, ott a videó alatt van pár opció, ott ki lehet választani a beágyazást. Onnan ki kell másolni a kódot és az oldalad html-jébe betenni, így már az oldaladról megnézhető a videó.
Title: Re: External colour tests
Post by: gflorez on 2018.June.07. 19:04:02
You are right, the first test where made on my old EP that has a defective Nick. But Habi claims to have fixed the noise on his Enterprise at his home, so I don't know what to think...

Meanwhile I have ordered one of these FPGAs to replicate the tests. I have to learn fast.
Title: Re: External colour tests
Post by: gflorez on 2018.June.09. 13:57:17
More tests from Habi on video. Now he has put his logo on the screen, by now  static.

https://www.youtube.com/watch?v=--j_XXJ0MME

The texts that appear on the screen are:

-External video on a Enterprise(sprites).

-Source code on VHDL.

-By now static position.

-Elements of the set.(TV, Enterprise, FPGA, Laptop).

-Starting.

-Sprite active only where there is no border.

-The EXOS palette varies according to the video mode of the Enterprise.

-Transparency test.

-Let's see the real colours.

-End.



The transparency is made programming the FPGA to put high the /EXTC signal on colour 0 when its button is pressed.
Title: Re: External colour tests
Post by: Zozosoft on 2018.June.09. 14:24:13
Nice! :smt038
Title: Re: External colour tests
Post by: geco on 2018.June.11. 08:28:33
cool :smt041
Title: Re: External colour tests
Post by: gflorez on 2018.July.08. 14:35:32
[attach=1]
[attach=2]
[attach=3]

Where is Wally?


I have replicated the FPGA interface. Thanks to Habi for his patience...

[attach=4]
Title: Re: External colour tests
Post by: geco on 2018.July.08. 19:52:59
coool :smt041
Title: Re: External colour tests
Post by: dangerman on 2018.July.09. 00:19:52
Wow - this is amazing. Never seen anything like this on the Enterprise before. I always wondered if the sprite signals actually worked.

16 colour sprites in high resolution - exciting stuff!!!
Title: Re: External colour tests
Post by: gflorez on 2018.July.09. 10:36:03
Yes, very exciting...

But these are very preliminary tests, only a proof of concept. Bad news are that perfect superposition is only possible on Enterprises with a healthy Nick chip. On my older EP, affected  by the defective Nick, a lot of artefacts are produced on the transition colour zones, worse with some combinations. Probably this error have degrees, the very same like the defective flashing pixels on some heavy coloured screens.

But let's continue with good things. The next test I will do is to move the sprite all over the screen, not real computer controlled graphics... only a simulation of a joystick port on the FPGA that will change the coordinates where the sprite is drawn.

Also I will try to put a multicoloured picture other than the mad scientist, the avatar of my friend Habi...

Less than 1% of the space of the FPGA is used by now. But to full exploit it is necessary to connect all the Enterprise bus to it and create ports on the code to communicate the two engines. There are an excess of space and programmable pins to do it, even some to create external interfaces. For example, there is a description of the WD1772 chip that can fit inside the FPGA....

But it is a pity that only Balagezs or Habi (and now I, with all my skill lacks....), can test this approach. Is for that my friend Wilco plan to design a development extension card to fit onto a bus expander or Bridge board, instead of having all the involved parts scattered on the table.

So what we need now is an accelerated  VHDL programming tutorial.
Title: Re: External colour tests
Post by: gflorez on 2018.July.10. 11:22:23
https://youtu.be/lw1e0pD4EmE

This is me controlling the sprite with a joystick on the FPGA. Habi implemented it yesterday.

Sorry for the bad image and sound(I forgot I was whistling....)
Title: Re: External colour tests
Post by: Tutus on 2018.July.10. 12:30:33
:smt041 :smt041 :smt041
Fantastic!!!
Title: Re: External colour tests
Post by: gflorez on 2018.July.10. 13:18:07
Main code is simple:

Code: [Select]
Library IEEE;
Use IEEE.Std_Logic_1164.All;
Use IEEE.Numeric_Std.All;

Entity PCWVid Is
Port (
-- Entradas vídeo (sincronismos)/ Video input (syncs)
HSync : In Std_Logic;
VSync : In Std_Logic;
-- Entrada reloj  / Clock input
Clk14 : In Std_Logic;
-- Salidas vídeo  / video output
ExtN : Out Std_Logic_Vector(3 DownTo 0); -- Los 4 bits a inyectar
ExtC : Out Std_Logic; -- Strobe colores externos
-- Desarrollo (placa)  /development FPGA
Led0 : Out Std_Logic;
Led1 : Out Std_Logic;
Btn0 : In Std_Logic; -- Usado de momento para la transparencia
Btn1 : In Std_Logic;
Clk50 : In Std_Logic;
-- Joystick
Joy : In Std_Logic_Vector(3 DownTo 0) -- Joystick
);
End PCWVid;

Architecture Behavioral Of PCWVid Is
Signal CuentaH : Std_Logic_Vector(9 DownTo 0); -- Posición horizontal /horizontal position
Signal CuentaV : Std_Logic_Vector(8 DownTo 0); -- Posición vertical  / vertical position

Signal LatchH  : Std_Logic;
Signal LatchV  : Std_Logic;

Signal SprAddr : Std_Logic_Vector(12 DownTo 0);
Signal Color : Std_Logic_Vector(3 DownTo 0);

Signal X : Std_Logic_Vector(9 DownTo 0) := "0110010000"; -- 400
Signal Y : Std_Logic_Vector(8 DownTo 0) := "001100100"; -- 100

Begin

-- Para que no queden sín usar; no me gustan los warnings ;)/ I don't like warnings ;)
Led0 <= Btn1;
Led1 <= Clk50;

-- Mapeo ROM / Rom map
MiRom : Entity Work.Rom
Port Map (
    clka => Clk14,
    addra => SprAddr,
    douta => Color
);

ExtN <= Color;

-- Tratamiento sincronismos / sync management
Sync: Process(Clk14)
Begin
If Rising_Edge(Clk14) Then
-- Contador horizontal / horizontal counter
If (LatchH = '1') And (HSync = '0') Then
CuentaH <= (Others => '0');
-- Contador vertical / vertical counter
If (LatchV = '1') And (VSync = '0') Then
CuentaV <= (Others => '0');
Else
CuentaV <= Std_Logic_Vector(UnSigned(CuentaV)+1);
End If;
LatchV <= VSync;
Else
CuentaH <= Std_Logic_Vector(UnSigned(CuentaH)+1);
End If;
-- Latcheo de sincronismos / Syncs latch
LatchH <= HSync;
End If;
End Process;

-- Dibujo sprite / drawing the sprite
Sprite: Process(Clk14)
Begin
If Rising_Edge(Clk14) Then
If (Unsigned(CuentaV)>=Unsigned(Y)) And (Unsigned(CuentaV)<Unsigned(Y)+64) Then
If (Unsigned(CuentaH)>=Unsigned(X)) And (Unsigned(CuentaH)<Unsigned(X)+128) Then
-- Transparencia  / transparency
If (Btn0 = '0') And (Color = "0000") Then
ExtC <= '1';
Else
ExtC <= '0';
End If;
-- Dirección  / address
SprAddr <= Std_Logic_Vector(UnSigned(SprAddr)+1);
Else
ExtC <= '1';
End If;
Else
ExtC <= '1';
SprAddr <= (Others => '0');
End If;
End If;
End Process;

-- Movimiento / movement
Joystick: Process(Clk14)
Begin
If Rising_Edge(Clk14) Then
If (LatchH = '1') And (HSync = '0') Then
If (LatchV = '1') And (VSync = '0') Then
If (Joy(0) Xor Joy(1)) = '1' Then
If Joy(0) = '0' Then
X <= Std_Logic_Vector(UnSigned(X)+2); -- Horizontal is slower than vertical movement
Else
X <= Std_Logic_Vector(UnSigned(X)-2);
End If;
End If;
If (Joy(2) Xor Joy(3)) = '1' Then
If Joy(2) = '0' Then
Y <= Std_Logic_Vector(UnSigned(Y)+1);
Else
Y <= Std_Logic_Vector(UnSigned(Y)-1);
End If;
End If;
End If;
End If;
End If;
End Process;

End Behavioral;
Title: Re: External colour tests
Post by: geco on 2018.July.10. 13:23:00
promising :smt041
Title: Re: External colour tests
Post by: gflorez on 2018.July.11. 22:37:58
I have loaded another mask, guess it....:

[attach=1]
Title: Re: External colour tests
Post by: geco on 2018.July.12. 08:40:09
I have loaded another mask, guess it....:
:ds_icon_cheesygrin: :ds_icon_cheesygrin:
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 11:45:12
I want to open here a small debate about how to take real advantage of the colour input.

What uses could it have?

I think it is easy and perfect for overlaying on the screen any external information. Think for example on a Gotek or HxC connected to the EXDOS without the little screen, instead the image disk information shown on the Enterprise screen. Or I also have though about the external screen on the Dream Turbo Card from Pear. He has took it in consideration, but not for the present version.

Theoretically, several video inputs can coexist at the same time if they are protected with diodes. I want to test this, but at the moment I only have one way to inject colour.

Of course I don't forget the initial purpose of the colour input... a hardware sprite generator or video input. Using the same system that my friend has used to add colour to the only green PCW Amstrad computer, can serve to easy inject a digital video source, but I think it would be very limited quality due the way the 8 high colours of the palette have been implemented, through the Nick register Bias.

Soon(I still don't know when...) I will receive a GFX-NINE from TMTLogic. It is a clone of the renowned Sunrise GFX-9000 MSX graphics cartridge that Prodatron supports on the MSX, and now CPC, versions of SymbOS. Sure it will work on the Enterprise interfaced with the M-Slot, but new software has to be written for it, or at least adapted. The Z80 ports it uses have not been used before on any Enterprise hardware extension, so this is new terrain.... Hans says that this is not a straight copy of the classic GFX-9000 card, it has been completely redesigned and fixed maintaining its original operation.

As you already know, this cartridge uses its own video output, but the V9990 chip has a few interesting modes that can suit our Enterprises if we discover a way to digitise the output video. Also, a interesting characteristic of the chip is that it accepts superimposing an external video output.... Think, not on injecting colour to the Enterprise, but injecting the Enterprise output video signal on the V9990... But this is nothing more than a dream by now...

Returning to the Hardware Sprite Generator and the basic tests shown in this thread, you must understand that they will not go further than to understand completely the mechanism. But... it may be we can find an easy way to inject the whole screen of the V9990 in pattern mode P2(see the data sheet (http://www.msxarchive.nl/pub/msx/docs/datasheets/v9990.pdf) page 13), offering 128 sprites on 16 colour, more than 15000 8x8 pixel tiles and omnidirectional scroll....
Title: Re: External colour tests
Post by: pear on 2018.July.26. 12:17:27
I think it is easy and perfect for overlaying on the screen any external information. Think for example on a Gotek or HxC connected to the EXDOS without the little screen, instead the image disk information shown on the Enterprise screen. Or I also have though about the external screen on the Dream Turbo Card from Pear. He has took it in consideration, but not for the present version.
You inspired me and I am just thinking about the OSD module, connected instead of the LCD display :)

I'm still wondering how to mix several external video signals (priorities, layers ?).
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 12:28:46
The colour input signals go from 0 to +5v, so my friend thinks that five diodes on every video source will be enough. But I haven't still proved it.

I can explain you the system used if you want to test it this summer...
Title: Re: External colour tests
Post by: pear on 2018.July.26. 12:38:15
I understand the principle of operation.
I organize myself a test environment.

You tested the display of a fixed image.
At the beginning I have to solve the problem of changing the memory content of the image to be displayed.
For now I have an idea for a dual-port RAM, but I hope that it will be simplified.
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 13:38:12
Yes, my friend Habi implemented a little Rom inside the FPGA. But creating a Ram is the same procedure, and I think that you don't need dual port if it is the FPGA itself who modifies the content between synchronising signals.
Title: Re: External colour tests
Post by: pear on 2018.July.26. 13:56:46
I have a lot of CPLD chips.
I'll try to use it instead of FPGA, but I'll need to use external RAM memory.
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 15:51:25
This Spartan6 FPGA board cost only 17 Euro, post included. But you have to wait a month....
Title: Re: External colour tests
Post by: pear on 2018.July.26. 16:12:51
The FPGA chip needs an external ROM for configuration.
Two chips on the PCB are still needed.
But the Spartan6 is not compatible with TTL 5V logic.
CPLDs that I have do not require any additional buffers.
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 18:14:23
Of course, you are right.... I forgot that the Wing buffer cost me more than the FPGA.... But the chip used on the buffer is inexpensive.

The Spartan works at +3,3v.

On the other side, the Rom is being emulated inside the FPGA.
Title: Re: External colour tests
Post by: pear on 2018.July.26. 18:44:50
An FPGA requires an external ROM in which its configuration is remembered (loaded into the FPGA after power on).
You can use part of the FPGA structure for ROM emulation, but its contents must be also loaded from the ROM configuration.
Title: Re: External colour tests
Post by: ergoGnomik on 2018.July.26. 19:06:19
An FPGA requires an external ROM in which its configuration is remembered (loaded into the FPGA after power on).
You can use part of the FPGA structure for ROM emulation, but its contents must be also loaded from the ROM configuration.
Well, not necessarily. Nowadays, AFAIK, there are instant on FPGAs with integrated Flash storage.
Title: Re: External colour tests
Post by: pear on 2018.July.26. 19:16:29
Cheap Spartan6 has not.
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 19:37:43
An FPGA requires an external ROM in which its configuration is remembered (loaded into the FPGA after power on).
You can use part of the FPGA structure for ROM emulation, but its contents must be also loaded from the ROM configuration.

You mean reloading the core. Yes, this board has a FlashRom to reload the core at start-up, but I still have not used it(I am still learning...)
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 19:53:37
I have a lot of CPLD chips.
I'll try to use it instead of FPGA, but I'll need to use external RAM memory.

And has also a good amount of static Ram.

https://www.aliexpress.com/snapshot/0.html?orderId=506118864314676&productId=32818384452

Specs(on Chinese English...):



Master FPGA:XC6SLX16-2FTG256C;

Master FPGA external clock source frequency: 50MHz;

The XC6SLX16-FTG256 chip comes with rich Block RAM resources;

The number of logic units in XC6SLX16-FTG256 chip is 14579;

M25P80, SPI, Flash chips, 1MB bytes of storage capacity;

32MB micron SDRAM model MT48LC16M16A2;

Provides 3.3V power for core board chips, using MPS's MP2359 wide range input DC/DC;

Brings out the two row 64p and 2.54mm spacing blocks, which can be used for external 24Bit TFT LCD screen, CY7C68013 USB module, high-speed ADC Acquisition module or CMOS camera module, etc.;

Draws the 3 button of the chip for testing;

Leads to the chip's 4 way LED lamp for testing;

Leads the JTAG chip debug port, the single row 6p, 2.54mm row spacing;
Title: Re: External colour tests
Post by: pear on 2018.July.26. 20:07:51
At the beginning I will use my exists project.
This is the interface of the 3D display controlled by ZX Spectrum.
It has a CPLD with 108 macrocells and 4KB of dual-port RAM.
Just reconfigure a bit. It's enough for tests.
Title: Re: External colour tests
Post by: gflorez on 2018.July.26. 20:28:59
And about the buffer, I bought the same board to replicate exactly my friend Habi's approach:

http://store.gadgetfactory.net/io-buffer/

But the chip inside (http://www.ti.com/lit/ds/symlink/sn74cbt16245.pdf) is inexpensive.

https://www.mouser.es/Texas-Instruments/Semiconductors/Switch-ICs/Digital-Bus-Switch-ICs/SN74CBT16245-Series/_/N-7590e?P=1yxz7gvZ1z0zls6


---------

Yes, it is better if you use your chips. I remember your 3D display...