What's new

bytestorm

Professional
Joined
Nov 22, 2015
Messages
398
Reaction score
213
Location
Sweden
Hello!

I recently realized that I needed to replace a 6331 PROM on the top board of my Hyper Sports since some of the colors was off.. (changed the C03027 prom with a good one from another Hyper Sports pcb)

Anyhow, I ordered some AM27S19PC proms just to realise the my programmer could only READ them.. not program them DOH!

Then I though, what if I just converted the raw binary data and put it into a ATF/GAL instead?

Obviously I will need to make a small adapter pcb, but I dont mind, would be cool to learn some WinCUPL in the process!

Installed WinCUPL and after some trial and error I got a code going that I think will work..

But I have some small questions..

1. Do I need to define the unused pins as anything?
2. The original PROM has the /OE tied to ground, do I even need to have a /OE in my design then, or can i just force "simple mode"?

This is how the code looks right now.. please let me know what you think? Have I missed anything?

Also, any reason to choose a GAL16V8 over AFT16V8 ?

Here is my code as of now.. It compiles OK, but I am unsure if it really works :). I guess I have to simulate it in WinCUPL but thought I´d check with you experts first.


Name C03_C27;
Partno XX;
Date 30/09/21;
Revision 01;
Designer Bytestorm;
Company Logical Devices Inc.;
Assembly None;
Location C3;
Device G16V8AS;

/**********************************************************/
/** Test to replace the 6331 PROM with ATF16V8 **/
/** Position C3 on top pcb for Hyper Sports **/
/** **/
/**********************************************************/


/** Inputs **/

Pin [2..6] = [A0..4];

/** Outputs **/

Pin [12..19] = [Q0..7];

/** Declarations and Intermediate Variable Definitions **/

field byte = [Q7..0];
field address = [A4..0];

TABLE address => byte {
'b'00000 => 'b'00000000;
'b'00001 => 'b'11111111;
'b'00010 => 'b'10100100;
'b'00011 => 'b'10101101;
'b'00100 => 'b'11111000;
'b'00101 => 'b'11000000;
'b'00110 => 'b'00111111;
'b'00111 => 'b'00111000;
'b'01000 => 'b'00000111;
'b'01001 => 'b'00000000;
'b'01010 => 'b'00010100;
'b'01011 => 'b'00010011;
'b'01100 => 'b'10011110;
'b'01101 => 'b'10110111;
'b'01110 => 'b'10101110;
'b'01111 => 'b'01100110;
'b'10000 => 'b'00000000;
'b'10001 => 'b'11111111;
'b'10010 => 'b'10100100;
'b'10011 => 'b'10101101;
'b'10100 => 'b'11111000;
'b'10101 => 'b'11001001;
'b'10110 => 'b'00110000;
'b'10111 => 'b'01101001;
'b'11000 => 'b'00000111;
'b'11001 => 'b'10100011;
'b'11010 => 'b'01010101;
'b'11011 => 'b'01011110;
'b'11100 => 'b'11110000;
'b'11101 => 'b'00111110;
'b'11110 => 'b'10101110;
'b'11111 => 'b'10101000;
}


To come up with the above code just simply opened the bin file for the original 6331 and checked every line like this (assuming little-endian):

Skärmklipp.JPG


Is this the "way" to do this? I have never worked in WinCUPL before so I am not sure that this is the correct way.. (but maybe there are several ways to achieve this).

I would greatly appreciate some feedback and/or tips on this before I make some adapter pcbs and order parts :).

And oh, heres a snippet from the original schematics on this area (I know that I can / need to change the pinout since the chips differ, I can just re-route that on the adapter pcb):

test.png


Thanks for your time!
 
Last edited:
nope, I just noticed the style used in a example program with alot more functions.. and just tried to understand what I needed. the "Field" function was pure luck that it works as I thought..

Althou very similar, the one you linked was clearly more effective since I had no idea that I could actually write:

table address => byte {
0 => 0;
1 => 0;
2 => 0;
3 => 0;
4 => 0;
5 => 0;
6 => 0;
7 => 0;
8 => 0;
9 => 0;
a => 0;
b => 0;
c => 0;
d => 0;
e => 0;
f => 0;
10 => ee;
11 => dd;
12 => bb;
13 => 77;
14 => ee;
15 => dd;
16 => bb;
17 => 77;
18 => fe;
19 => fd;
1a => fb;
1b => f7;
1c => ef;
1d => df;
1e => bf;
1f => 7f;
}

Which would have saved me alot of typing binary :D
 
it even looks like the 82S123 is a eqvivalent PROM to the 6331! I wonder why the 22V10 was used.. maybe he already tried the 16v8 and did not succeed? :/

no idea what this effectivly does also:

byte.oe = !tristate;
dummyinput = 'b'0;
dummyinput.oe = 'b'0; /** Pin 16 is disabled **/
 
1. Do I need to define the unused pins as anything?
no
2. The original PROM has the /OE tied to ground, do I even need to have a /OE in my design then, or can i just force "simple mode"?
No, that's fine. The PROM is used as look-up table, so by forcing /OE to ground it is always active. You don't need that in your GAL as well.
Also, any reason to choose a GAL16V8 over AFT16V8 ?
They should have identical functionality, so it depends on what you can easily get.
Is this the "way" to do this? I have never worked in WinCUPL before so I am not sure that this is the correct way.. (but maybe there are several ways to achieve this).
That is a perfectly valid way to do this. The optimiser in WinCupl will map that onto the logic gates available in the chip.

I'm using a Python Quine-McCluskey solver to create the equations, that way you can see what they actually do, but the end-effect is the same.
I write the dump out as a .si file as well, that way WinCupl will show me an error if the compiled GAL doesn't match the expected output. (Even though the simulator is not perfect...)
 
it even looks like the 82S123 is a eqvivalent PROM to the 6331! I wonder why the 22V10 was used.. maybe he already tried the 16v8 and did not succeed? :/
Can be any reason, like what he already has available on his shelf. The 22v10 has more input/outputs, allows slightly more complicated equations, and has some extra features.
Though if WinCupl accepts your design for 16v8 it should work fine.
no idea what this effectivly does also:

byte.oe = !tristate;
dummyinput = 'b'0;
dummyinput.oe = 'b'0; /** Pin 16 is disabled **/
byte.oe should switch the outputs to tristate, no idea what he does with dummyinput.

Edit: one quick warning that the pin headers he uses quickly wear out the springs in a socket. I am using the ones with turned pins.
 
Last edited:
i just noticed something,
if you take the gal and flip it 180' the inputs and outputs are on the correct side,
then you leave one pin out of the socket at each corner you just need 2 jump wires for the vcc and ground. :)
 
Wow awesome! Thanks for the responses ! Wincupl is throwing me some errors thou when I try to simulate in winsim:/ not so optimal to use win10 I guess.
 
wincupl is flakey shit in any windows version - they never bothered fixing it.
it actually has a buglist in the archive.

i can run it under Linux using wine just fine though :)
 
i just noticed something,
if you take the gal and flip it 180' the inputs and outputs are on the correct side,
then you leave one pin out of the socket at each corner you just need 2 jump wires for the vcc and
Yeah I saw that too! And the TSSOP miiiiight just fit.. :D
 
wincupl is flakey shit in any windows version - they never bothered fixing it.
it actually has a buglist in the archive.

i can run it under Linux using wine just fine though :)
I poked around in it some time ago - looks like it was written in Visual Basic 6. So it is quite possible that "fixing" it for modern OS would require a full rewrite. Not to mention the actual compiler/optimiser will be locked up with rights of various companies that were sold so many times that nobody knows who owns what...
 
I poked around in it some time ago - looks like it was written in Visual Basic 6. So it is quite possible that "fixing" it for modern OS would require a full rewrite. Not to mention the actual compiler/optimiser will be locked up with rights of various companies that were sold so many times that nobody knows who owns what...
Maybe I should try win XP or 98 instead? Could just make a wmvare .. but do you use it also @Fluffy in win10?
 
i think somebody actually wrote some programmer software that does the conversion for you!
https://github.com/elgendk/u2pa
Indeed he already made that possible it seems :). Thanks for the tip! I will however try to learn how it works to make my own in WinCUPL since I think it may come in handy. But I will download it and compare the results, that way I might get a hint on if my stuff will work. I have several games missing this same 6331 prom, and it bugs me that I can not program em with my batronix Batego 48 II, so if I can make a small adapter pcb for them using a ATF16V8 instead that would be cool :), that might help others out as well!
 
Yes, I'm using it in Win 10, so I am not sure if moving to earlier Windows will improve it.
oh man what a headache.... fixed a wmvare with XP and all goes smooth but I still cant get my head around how to simulate my file. Allways gets some random errors when trying to start the simulation no matter how my vectors look. missing files, "simulation errors encountered", other runtime errors poppin up... what a bad software this is :(. All files needed are made and in the project folder, but still bugs out. Would have been cool to just verify the function with some vectors..

any other software where you can simulate your plds in? (compiling was successful btw)
 
I don't have my files right here, but I think you need to configure outputs as "simulator decided" or "expect high/low". And I never got vectors to work, only single signals.
 
I don't have my files right here, but I think you need to configure outputs as "simulator decided" or "expect high/low". And I never got vectors to work, only single signals.
ert.JPG


grr.... all outputs are *simulator determined, pressed simulate, and BAM, another run-time suprise ;(
 
grr.... all outputs are *simulator determined, pressed simulate, and BAM, another run-time suprise ;(
Yeah, it is nasty. I try to save each file before doing any simulation with it. Nowadays I create the test vectors with a small python script.
 
Back
Top