6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 5:56 am

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: PC/ISA 65832 computer
PostPosted: Sun Aug 02, 2020 12:46 pm 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
I’ve been planning on using an PC ISA bus backplane for a 65816/65832-style computer. The ‘832 would be located as an ip core in an FPGA carrier board. The ISA bus will be repurposed with 40 address lines and 32 data lines in a multiplexed address / data fashion. However, when the /REFRESH signal is high it will be used to indicate an 8-bit ISA compatible access. This allows 8-bit ISA cards to be used by the computer. For a new style bus access /SMEMR, /SMEMW, /IORD, /IOWR will be inactive, but /MEMR, /MEMW in the extended bus will be active.

Unfortunately, there are not enough I/O’s on the FPGA board to support the full ISA bus as desired. So, I’m left with trying to come up with a means of multiplexing I/Os to support everything. There are about 50 I/Os available.
24 address + 16 data takes up 40 I/Os. Also needed are reset, read/write, and ready. One idea is to have IRQ’s and DMA lines multiplexed onto the data bus periodically so they can be sampled when safe to do so. This would require inserting an extra clock cycle every few bus cycles. Rather than having IRQ’s respond at the beginning/end of an instruction it would end up every fourth instruction for instance.
A second possibility is to use fast shift registers to read the IRQ / DMA signal lines. This is appealing because multiplexors on the data bus are then not required. It may also offer lower latency than the previous idea.

I think I’m just going to have the processor read a specific address to get at the interrupt / DMA request lines. So, periodically the core outputs $FF…FFFC as the address. This address is internally decoded to form a select signal /IDS. So for one osc period (31 ns) /IDS will be active and the interrupt / DMA signals placed on the data bus. There will be a control register in the processor to specify the frequency of IDS in terms of bus cycles. Since a bus cycle is 122ns IDS would consume 20% of the bus bandwidth if active on every cycle.

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 02, 2020 12:59 pm 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
Bus Signals
Attachment:
File comment: Bus Signals 'A'
BusDescA.png
BusDescA.png [ 29.5 KiB | Viewed 1741 times ]

Attachment:
File comment: Bus Signals 'B'
BusDescB.png
BusDescB.png [ 33.16 KiB | Viewed 1741 times ]

Attachment:
File comment: Bus Signals 'CD'
BusDescCD.png
BusDescCD.png [ 39.35 KiB | Viewed 1741 times ]

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 02, 2020 1:33 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Nice one Rob - I keep forgetting that you've already tackled the '816 as a core for FPGAs.
Doing the '832 could be interesting!


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 03, 2020 7:59 pm 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
I have already an ‘832 core (called FT833) but it’s got only an 8-bit data bus, Interfacing to the bus isn’t very well done so I’ll be improving it and modifying it to allow 32-bit data transfers. It needs to be modified to poll for interrupts and DMA as well for this project. The core does make use of an instruction cache so it fetches all the bytes for an instruction in a single cycle. The ‘832 core is about 11,000LUTs so it fits in many newer FPGA parts.

While it follows the '832 spec closely the '832 core has additional features such as extra-long data addressing modes, allowing the use of 32-bit addresses.

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Tue Aug 04, 2020 3:04 am 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
Deviating from the idea of using an FPGA based '832 core after looking at how much work would have to be put in to modify the core for use.

Tonight, for a cpu board I’m thinking of using an 82C206 chip which is an PC AT motherboard chip that includes most of the peripherals for an AT machine. This 82C206 chip would be used in combination with a 65C816, so would require a little bit of logic for interfacing. The 82C206 would take care of the interrupt and DMA signals on the bus. Only 8-bit DMA would be supported as the 65c816 has only an 8-bit bus. A hold acknowledge and an interrupt acknowledge signals would need to be generated for the chip.
Fortunately, these can be done with relatively simple state machines.
On a hold the RDY line to the 65C816 would be pulled low. The next cycle the BE line would also be pulled low to tri-state the 65C816 signals and HLDA signaled active. The DMA transfer would then take place. When the HOLD request line goes inactive RDY will go high and BE will go high enabling the 65c816 accesses.
Two INTA pulses are required to release the interrupt byte from the controller. To read the byte a memory load instruction would be executed at the I/O address of the controller. The INTA signal would be pulled low and RDY pulled low for the first cycle. For the second cycle when INTA is low ready is high allowing the byte to be read. I think this can be done with just a counter or shift register.

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Wed Aug 05, 2020 6:25 am 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
After last night’s diversion, I started working on the bus interface unit for a 64-bit core. Everything for this project seems to be revolving around the bus at the moment. With a good bus interface unit, a number of different processing cores could be interfaced. It’s somewhat tricky as the interface has to provide access to both an external system bus and internal bus, so there’s some code replication. The external bus is a multiplexed address / data bus, Data bus is 32-bits. The internal bus is non-multiplexed, 64-bit data. It’s made trickier again by the need to support both data and instruction access. And again by the need to support dram access as well as ordinary access.
The bus interface unit also takes care of unaligned access by running multiple bus cycles, and takes care of sign extending read data.
There may be issues with unaligned access read / writes spanning a 4GB boundary depending on how slaves are implemented. The upper 8-bits of the address (32 to 39) outputs the previous value when data is placed on the databus. This may not be the current value if this part of the address bus incremented due to a 4GB boundary crossing. If the slave is using ALE to latch these address bits it doesn’t matter it’ll get the correct address, however if the slave assumes these address bits remain the same and doesn’t latch them then it will have an effect.
The module is about 560 LOC.
Attachment:
File comment: Pic: ISA Motherboard partially built
ISAMotherboardPart.jpg
ISAMotherboardPart.jpg [ 1.45 MiB | Viewed 1611 times ]

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 09, 2020 2:53 am 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
Mapped out the bus signals onto the FPGA board signal lines. It turns out significantly more FPGA I/O’s are available than I though initially. I was able to map all the bus signals using separate signal lines for IRQ’s and DRQ’s. This is good because it will simply things. There are some signal lines still available so I’m wondering about the distribution of components. It’s conceivable that an SBC computer card could be made with video, keyboard, and mouse all on the cpu card.
However, I’d prefer a separate video board in the system that would house it’s own GPU and accelerator components.

Got most of an 8-channel DMA controller coded. About 300 LOC. All eight channels operate identically. It’s fairly rudimentary, nothing fancy. It supports the three modes of operation available with the 8237 chip for each channel. One-off transfer, block transfers and demand transfers. Each channel has base and current registers for the address and transfer count. Transfer addresses may either increment, decrement or remain constant.

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Fri Aug 21, 2020 12:09 pm 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
Spent some time studying and coming up with a circuit interfacing interrupts for an '816 processor.
In emulation mode interrupts are handled via ROM vectors as normal. The interesting part occurs for interrupts handled in native mode.
The encoded interrupt level (one of sixteen) is used to form part of the vector address. Vector targets are spaced four bytes apart. This
then gives a target area of 64 bytes. The upper 8 bits of the vector address are stored in a latch. This allows any page in the lowest 64k
bank of memory to be used as a target address.
Bits 6,7 of the vector are fed from an external eight-bit addressable latch which serves multiple purposes.
I think the following circuit should work. (Sorry about the color, I haven't figured out how to get the CAD program to output mono.)
Attachment:
File comment: ISA65816 Interrupt control logic
IntCtrl2.png
IntCtrl2.png [ 34.3 KiB | Viewed 1383 times ]

_________________
http://www.finitron.ca


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 24, 2020 7:34 am 
Offline
User avatar

Joined: Tue Oct 25, 2016 8:56 pm
Posts: 362
Rob Finch wrote:
(Sorry about the color, I haven't figured out how to get the CAD program to output mono.)


It looks to me like you took a screenshot of the Kicad schematic window?
If you instead go to File -> Plot, you can create a PDF of the schematic, and one of the options is "Output mode" (Color | Black and white).
Then you can either attach the black & white PDF directly, or you can take a screenshot of the open PDF if you only want to show a subset.

_________________
Want to design a PCB for your project? I strongly recommend KiCad. Its free, its multiplatform, and its easy to learn!
Also, I maintain KiCad libraries of Retro Computing and Arduino components you might find useful.


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 31, 2020 3:34 am 
Offline
User avatar

Joined: Sun Dec 29, 2002 8:56 pm
Posts: 460
Location: Canada
Yes, it is a KiCAD schematic. Thanks for the suggestion, I was able to plot a monochrome image of the board schematic so far. I still need to add RAM, ROM, and a uart to make it a SBC.
Attachment:
File comment: ISA65816 Schematic
ISA65816.pdf [222.99 KiB]
Downloaded 84 times

_________________
http://www.finitron.ca


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 10 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: