IntegraB PAL Decoding

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: PAL Decoding

Post by steve3000 » Tue Apr 10, 2018 9:17 pm

Just read through this from the start. Great work getting this far Ken. I hadn't realised the Integra-B connection from the title or I'd have certainly read through earlier.

I've got a fully working Integra-B, so if you can't read one or both of your PALs, let me know and I'll take apart my beeb and desolder the chips from my board, as I have the tools to avoid damage. Happy to deliver, or even post them to someone who can read them, proving they're returned safely :)

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: PAL Decoding

Post by KenLowe » Fri Apr 13, 2018 12:19 am

Thanks for the offer, Steve. Let's see if Rob has any luck with his PALs before starting to pull apart another good working IntegraB!

I think I've managed to make some progress today. I hooked up an eprom programmer to my IntegraB board, and I've successfully managed to read at least some of the PAL18L4. One of the PAL outputs seems to be stuck permanently on so I need to look into that a bit further, but the other outputs seem to be doing logical things based on the status of the input bits. I've dumped the contents into Excel and I've been filtering input / output bits to see what's happening.

So far I've established:
  • PAL output pin 19 seems to be linked to the Private Memory, but I haven't fully worked out what's happening there yet.
  • PAL output pin 18 is driven low when address is in the range 3xxx -> 7xxx, SHEN (shadow enable) is high and MEMSEL (shadow/main ram toggle) is low. That sounds logical.
  • PAL output pin 17 is driven low when address is in the range 8xxx -> Bxxx. Again, that sounds logical.
  • PAL output pin 20 is the one I don't think is working correctly. This output is stuck permanently high. I'm convinced this should be getting driven low when address is set to FE3x, but that's not what I'm currently seeing. There might be an issue with the EPROM programmer, or my wiring, so I'll need to check it again.
I'll do some more work on it tomorrow (later today!)...

Edit: Cracked it. The select lines on one of my 74HCT244 address buffers wasn't being pulled down to 0V! That's sorted, and I can now see that PAL output pin 20 is being driven low when the address is set to FE3x as I suspected it should!

Need to go to bed...

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: PAL Decoding

Post by KenLowe » Fri Apr 13, 2018 1:12 pm

For those who are interested, I've attached a copy of the extracted PAL in raw binary format. I ran this file through the following site https://en.webhex.net/ to get the file in a suitable space delimited format to allow me to import it into Excel. From there, I was able to break down the 18 bit PAL address into discrete logic inputs, and the PAL data byte into the four discrete logic outputs. Note that the upper 4 bits of each data byte were not actually read from the PAL, and should be ignored.
20180413_134225.jpg
I think the next PAL will be a bit more challenging!

Edit 1: Updated the .xls spreadsheet. The 6502Addr conversion wasn't working correctly. Any hex value with the letter E in it was being wrongly interpreted as a scientific notation number. Now corrected. Also saved the workbook as binary to reduce oversize of the file.
Edit 2: Re-uploaded with ROM file. Now with the correct filename.
Edit 3: Removed the files, because there's some corruption happening. I'm not getting exactly the same data each time I read the PAL.

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: PAL Decoding

Post by KenLowe » Sat Apr 14, 2018 1:21 pm

Definitely got it working this time. The extracted logic all makes much more sense now. I decided to make a small daughter board to interface between the EPROM programmer and the IntegraB board, sorted out my grounds, and I'm now getting consistent reads from the PAL.

From this, I've been able to establish the following:
  • Q3 (IC9/17) = n[(0x800x..0xBFFx)]
  • Q2 (IC9/18) = n[(0x300x..0x7FFx).nMEMSEL.SHEN)]
  • Q1 (IC9/19) = n[(0x800x..0x83Fx).PRVEN.PRVS1 + (0x800x..0x8FFx).PRVEN.PRVS4 + (0x900x..0xAFFx).PRVEN.PRVS8]
  • Q0 (IC9/20) = n[(0xFE3x)]
All quite straight forward, really!

It did flag up an error in the IntegraB manual. The IntegraB manual indicates that:
  • &FE34 bit 4 (labelled PRVS1) is used to access 1k private RAM block 0x8000..0x83FF
  • &FE34 bit 6 (labelled PRVS8) is used to access 8k private RAM block 0x9000..0xAFFF
The PAL logic is telling me that:
  • &FE34 bit 4 (IC9/13) is used to access 8k private RAM block 0x9000..0xAFFF
  • &FE34 bit 6 (IC9/15) is used to access 1k private RAM block 0x8000..0x83FF
I've quickly checked the BeebEm source, and notice that this error has been picked up in there and matches what I found in the PAL (it may have been me that picked this up many years ago, as I wrote that code!). In the BeebEm source, they have kept the labels PRVS1 & PRVS8 with &FE34 bits 4 and 6 respectively, but then tied these labels to the 8k and 1k private memory blocks respectively. It looks a bit odd, because the 1k label (PRVS1) is tied to the 8k memory block, and the 8k label (PRVS8) is tied to the 1k memory block! I have decided to swap the labels around in my documentation to correct this.

Updated PAL dump, and spreadsheet attached. I've also updated and attached a revised IntegraB wiring schedule to reflect the label changes, and a couple of other minor corrections that I've picked up along the way.

Replacement 74HCT174s arrived today as well, so I've plugged them in to the IntegraB board, and temporarily put the IntegraB back into my beeb, just to make sure it's still working. It is! Next step will be to start looking at the slightly more challenging PAL12L10!
20180414_131510.jpg
Attachments
IntegraB Wiring Schedule.xlsx
(38.71 KiB) Downloaded 9 times
PAL18L4.zip
(1.72 MiB) Downloaded 8 times

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: IntegraB PAL Decoding

Post by KenLowe » Sun Apr 15, 2018 10:24 pm

I've worked out and reduced the equations and programmed them to a GAL22V10 as a test (I don't have any spare PALs, but I've got a few GALs). After working through a couple of stupid errors (both in the wiring and the equations), I've been able to successfully program the GAL22V10, and then read back as an EPROM and get the same read back as I did with the original PAL18L4. So definite progress. For info, these are the equations that I used:

Code: Select all

	IntegraB - IC9

CHIP INTB_IC9 GAL22V10

A13  A8  A9  A11  A4  A10  A5  PRVEN  A15  A14  SHEN  GND
PRVS8  PRVS4  PRVS1  MEMSEL  /nSWRAddr  /nShAddr  /nPrAddr  /nFE3x  A6  A7  A12  VCC

EQUATIONS

nFE3x    =  A15* A14* A13* A12* A11* A10* A9*/A8*/A7*/A6* A5* A4

nPrAddr  =  A15*/A14*/A13*/A12*/A11*/A10* PRVS1* PRVEN
            +  A15*/A14*/A13*/A12* PRVS4* PRVEN
            +  A15*/A14*/A13* A12* PRVS8* PRVEN
            +  A15*/A14* A13*/A12* PRVS8* PRVEN

nShAddr  = /A15* A14* A13*/A12 * SHEN */MEMSEL
            + /A15* A14*/A13 * SHEN */MEMSEL
            + /A15* A13* A12 * SHEN */MEMSEL

nSWRAddr =  A15*/A14
I think I can safely say I'm done with the PAL18L4 now. I need to take a break from this for the rest of the week, but I'll hopefully get started on the PAL12L10 next weekend.

Edit: Note to self - When trying to read back the GAL as an EPROM, make sure to select an EPROM from the programmer list that will apply 5V to Vcc! I'm using a Genius G540 programmer for both GAL and EPROM programming and reading. I've wasted a few hours trying to work out why the GALs all seemed to program just fine, but would read back as blank when trying to read it as an EPROM. I thought I had a bad batch of GALs. Turns out that the AMD & ATMEL 27C020 EPROMs I was selecting were setting Vcc to 0V! I've now picked the Cypress 27C020, and it's setting Vcc to 5V. All of a sudden the GALs are all reading back correctly. Happy days!
Last edited by KenLowe on Sat Apr 21, 2018 11:07 pm, edited 3 times in total.

User avatar
1024MAK
Posts: 7868
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: IntegraB PAL Decoding

Post by 1024MAK » Mon Apr 16, 2018 10:12 am

Well done :D =D>

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: IntegraB PAL Decoding

Post by KenLowe » Sat Apr 21, 2018 10:32 pm

So, with a bit of confidence that I could replace my PAL12L10 with a new GAL22V10, I decided to cut out the PAL from the IntegraB, and read it as a 2732 EPROM. From this, I was able to generate the equations and program the GAL22V10. A couple of minor corrections later, and I've managed to duplicate the PAL12L10. I've now got the GAL22V10 installed and running in my IntegraB without any problem. Here's the equations I generated:

Code: Select all

	IntegraB - IC8

CHIP INTB_IC8 GAL22V10

zRnW nRSEL03 nFBackIn A3 nFE3x nPrAddr nShAddr nSWRAddr A2 NC D7 GND
zPhi1 /Phi1 /RnW /nDataEn /nFBackOut /nPrCS /nROMDec /nFE34 /nFE30 /nRTC2 /nRTC1 VCC
 
EQUATIONS

Phi1 =      /zPhi1* nShAddr

RnW =       /zRnW* nShAddr

nDataEn =    nFBackIn

nFBackOut =  nRSEL03* nSWRAddr* nShAddr* nPrAddr* nFE3x
             + /nRSEL03

nPrCS =      nShAddr* nPrAddr

nROMDec =   /nSWRAddr* nPrAddr

nFE34 =     /nFE3x* /A3*  A2 * /zRnW* D7

nFE30 =     /nFE3x* /A3* /A2 * /zRnW* D7

nRTC2 =     /nFE3x*  A3* /A2 * /zRnW* /zPhi1

nRTC1 =     /nFE3x*  A3*  A2
That's me now decoded both PALs, so original objective met :)

Edit: Now with a couple of photos showing the extracted PAL with fixed up pins, and the replacement socketed GAL (IC10) in the the IntegraB board:
Attachments
20180422_091332.jpg
20180422_091238.jpg
Last edited by KenLowe on Sun Apr 22, 2018 8:18 am, edited 1 time in total.

User avatar
marcusjambler
Posts: 423
Joined: Mon May 22, 2017 11:20 am
Location: Bradford
Contact:

Re: IntegraB PAL Decoding

Post by marcusjambler » Sat Apr 21, 2018 11:11 pm

Great work Ken =D> =D>

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: IntegraB PAL Decoding

Post by KenLowe » Sat Apr 21, 2018 11:36 pm

1024MAK wrote:Well done :D =D>

Mark
marcusjambler wrote:Great work Ken =D> =D>
Thank you. It helps when you get a bit of encouragement. Next step is to build a prototype board with modern components, just to test everything out.

RobC
Posts: 2299
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: IntegraB PAL Decoding

Post by RobC » Sun Apr 22, 2018 7:01 am

Great work Ken =D>

steve3000
Posts: 1886
Joined: Sun Nov 25, 2012 12:43 am
Contact:

Re: IntegraB PAL Decoding

Post by steve3000 » Sun Apr 22, 2018 9:47 am

Brilliant work and a great write up!

User avatar
KenLowe
Posts: 365
Joined: Mon Oct 18, 2004 4:35 pm
Location: Scotland
Contact:

Re: IntegraB PAL Decoding

Post by KenLowe » Sun Apr 22, 2018 11:00 am

steve3000 wrote:Brilliant work and a great write up!
My own personal blog :lol: :D

Post Reply