6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Jun 30, 2024 8:00 pm

All times are UTC




Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Fri Jul 23, 2021 8:35 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
Twelve years ago, I made my first post here about my POC (Proof of Concept) design I had started, a basic 65C816 circuit that...well...was meant to prove that my concept of how to build a small computer was sound.  POC V1.0 worked well after some patches were made to the original design.  Those patches were eventually rolled into POC V1.1, which had the same memory map, RAM, ROM and I/O as V1.0, but incorporated some additional features to support using the real-time clock socket as an expansion socket.  V1.1 was stable to 14 MHz and by the time I was ready to move on from it, it had SCSI and thus could work with mass storage.

Following the construction of POC V1.1, I started thinking about building something more elaborate, a unit that would have more serial ports, more RAM and programmable logic, which I was going to call POC V2.  Several designs came out of that project, but all had problems that I ultimately decided were due to me leaping ahead too quickly and introducing too many new features at once.  That epiphany prompted me to return to the V1 series and build V1.2, still an all-discrete design.

V1.2 was meant to be a test-bed on which to work out how to get four-channel serial communication working, which was accomplished.  V1.2 was also a test-bed for wait-stating via clock-stretching, a feature that made it possible to run the unit at 20 MHz.  V1.2 led V1.3, which, still all-discrete, is able to use almost the entire address space in the 128KB RAM with which it is fitted.  A planned successor to V1.3, which would have had 512KB of RAM, was on the drawing board, but I decided not to proceed with it, mostly due to the large amount of glue logic that would be required to make it work using discrete gates.  I decided that V1.3 was as far as I would go with a discrete logic system and that it was time to return to programmable logic.

Now I am on to POC V2, but in a new direction, as the original POC V2 project is dead.  This new incarnation will proceed more incrementally than the original V2, which I hope will minimize the difficulty of making it work.  As I have developed a functional "virtual QUART" (vQUART), suitable driver software for it, and wait-stating via clock-stretching—all tested on POC V1.3—the task of designing this new POC V2 series would be less onerous.

V2.0 may be best described as V1.3, but with a CPLD replacing almost all of the glue logic.  This new unit's main purpose will be to refine the use of the CPLD, as well as to experiment with various memory map configurations and make circuit operation observations with the 'scope and logic analyzer.  The knowledge thus gleaned will—I hope—lead to building a system with much more RAM and other features.

Anyhow, here's the schematic for V2.0:

Attachment:
File comment: POC V2.0 Schematic
poc_v2.0.pdf [366.51 KiB]
Downloaded 142 times

...and here's the PCB layout I developed:

Attachment:
File comment: POC V2.0 Printed Circuit Board
v2_pcb.gif
v2_pcb.gif [ 108.74 KiB | Viewed 2420 times ]

New to V2.0 are:

  1. CPLD in place of discrete glue logic.  The CPLD will generate extended addressing (A16 only, since the RAM is 128KB), chip selects, qualified /RD and /WD control signals and a wait-state-enable (/WSE) signal to control the clock generator.  I will be using the Microchip (Atmel) ATF1504AS in PLCC44, which has 64 macrocells and 32 uncommitted I/O pins—all but one of those I/O pins will be used.  V2.0 will include a JTAG port for in-system programming of the CPLD.

  2. Data bus transceiver.  Observation of POC V1.3's behavior has led me to conclude use of a transceiver to isolate the data bus from the MPU while the latter is emitting the bank bits during Ø2 low will be beneficial.  The transceiver will mitigate the potential for bus contention, and will also act as a level converter to "boost" the TTL-level outputs of the SRAM and ROM during a data fetch cycle.

  3. A card-edge socket for expansion.  Interfacing an expansion card to the unit will be easier, as I don't have to deal with long extender pins going into a DIP socket, as was the case with the V1 series.  Also, the card-edge socket has more pins (36 total), which allow me to bring more signals to it, as well as provide more Vcc and ground connections.

  4. More test point headers.  These will make hooking up my test gear more convenient, which may prove to be very useful in the event the unit is DOA or unstable on the first power-up.

V2.0's memory map initially will be the same as V1.3's, which means I can actually use V1.3's firmware for initial testing (initial testing of V1.3 was done using V1.2's firmware—in fact, I "stole" the ROM from V1.2 and plugged it into V1.3 for that first go).  That memory map decodes the I/O block into pages, which requires the glue logic only be aware of the MSB of the address bus, that is, A8-A15.

The observant reader of the schematic will note I've also connected A6 and A7 to the CPLD.  Doing so allows me to make the I/O block decoding more granular, effectively reducing the size of the I/O block by quite a bit.  As the CPLD logic assumes that anything that isn't a ROM or I/O access is a RAM access, shrinking the I/O block frees up RAM that would otherwise be inaccessible.  This RAM will be reserved for use by the firmware: direct page and circular queues for serial I/O (SIO).  The latter use bears some explaining.

Since there are four UARTs, and since each UART needs two queues—received and transmit, a total of eight queues must be provided.  The typical arrangement with a 65xx MPU is to use a page of RAM per queue, which is very convenient from an indexing perspective.  Eight pages is 2KB total.  In the V1 units, the limitations of discrete glue logic restricts bank $00 to 48KB of contiguous RAM, from which direct page, the hardware stack and the SIO queues have to be allocated.

2KB for the SIO queues was more contiguous RAM than I was willing to sacrifice, so I developed queue management code that would allow me to make the queues as small as 64 bytes each.  The management code adds processing time to interrupts, as well as the SIO foreground functions, slowing them down.  Also, a small queue causes frequent blocking if a large stream of data, such as a full console screen repaint, is transmitted.  A small receive queue makes reception more prone to dropped datums should the foreground not retrieve them often enough.

With that in mind, and given the greater address decoding granularity that is possible in a CPLD, I connected A6 and A7 so I can ultimately parcel out the I/O block in smaller chunks.  I/O starts at $00C000 and with it decoded into pages, the address range would be $00C000-$00C6FF, as there are seven I/O devices.  The space from $00C700 to $00CFFF would be seen as RAM, which would amount to 2304 bytes.  I could cram the eight SIO queues in there at 256 bytes each, with one page of RAM left that could be the firmware's direct page, thus making that address range a "reserved" or "system" area.  Doing so would leave almost all of bank $00 RAM from $000000-$00BFFF (48 KB) for user code and data, user direct page and the hardware stack.  I say "almost" because there are firmware vectors that have to be in RAM somewhere, as well as workspace for buffers and such.

Thinking about that for a while, I decided that if I added A6 and A7 to the CPLD's decoding menu I could reduce the size of each I/O slot to 64 bytes, with a corresponding increase in the "reserved" RAM that is above the I/O block.  The new effective address range for the I/O block would become $00C000-$00C1CF.  I'd want to reserve an extra I/O slot...just in case, as well as make sure the system area starts on an even page boundary so direct page accesses don't get penalized.

Accordingly, I'd start the system area at $00C300, extending to $00CFFF, for a total of 3328 bytes.  Subtracting out the space needed for eight 256 byte SIO queues (2048 bytes total) and 256 bytes for system direct page, I'd have 1280 bytes left over.  If I place the top of the stack at $00CFFF and not have it expand more than two pages (which would be a big stack), I'd have 768 bytes left over for vectors, buffers, and other firmware workspace, e.g., the SCSI device table.  All RAM below the I/O block, as well as all RAM at $010000 and beyond would be unencumbered.

So I've got some work to do to build the unit and see if it goes or blows.

———————————————————————————————————
EDIT: Replaced the schematic PDF with a corrected version.  The original had an error in the expansion connector pin-out table.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Fri Mar 22, 2024 9:44 pm, edited 5 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 23, 2021 10:36 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10837
Location: England
Sounds good to me! 48k is a nice big chunk. And, I think, you have 12k of ROM for your OS? Or at least, for the bits needed to boot and load more. Quite an interesting idea to have that separate area of reserved RAM.


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 23, 2021 2:25 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1378
Very nice... liking the design and PCB layout. However, I noticed that the legend showing the I/O expansion pinout doesn't match the schematic on the pins... i.e., 40-pin legend vs 36-pin connector, no A7 on the connector, etc.. Guessing it's just an oversight.

How soon do you plan on having the first PCB built up?

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 23, 2021 7:21 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
BigEd wrote:
Sounds good to me! 48k is a nice big chunk. And, I think, you have 12k of ROM for your OS? Or at least, for the bits needed to boot and load more. Quite an interesting idea to have that separate area of reserved RAM.

12KB for ROM is correct. That has been my setup since POC V1.2. The 8KB I had in V1.0 and V1.1 had gotten very crowded—there were only 190 bytes that were unused, effectively preventing further firmware development.

The reserved RAM was theoretically possible in V1.2 and V1.3 but in practice, would have been tough to efficiently implement in discrete logic.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 23, 2021 8:02 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
floobydust wrote:
Very nice... liking the design and PCB layout.

Thanks!

Quote:
However, I noticed that the legend showing the I/O expansion pinout doesn't match the schematic on the pins... i.e., 40-pin legend vs 36-pin connector, no A7 on the connector, etc.. Guessing it's just an oversight.

Yeah, I keep forgetting to update the legend to agree with the actual circuit. Originally I was going to use a 40 pin socket. However, after giving it more consideration, I concluded I didn't need more than what is in the present circuit. I updated the schematic that is in my original post.

Quote:
How soon do you plan on having the first PCB built up?

I haven't decided. I usually "sleep on it" for a couple of days and then review my work before ordering PCBs.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Sat Jul 24, 2021 9:23 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 24, 2021 12:06 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
Is it worth connecting the un-used CPLD pin 37 to the expansion connector in place of one of the grounds. Just in case it comes in handy at a later point ?


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 24, 2021 9:16 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
Martin A wrote:
Is it worth connecting the un-used CPLD pin 37 to the expansion connector in place of one of the grounds. Just in case it comes in handy at a later point ?

I don't want to permanently wire that pin to anything. If I develop a use for it I can bodge-wire it as needed.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 1:26 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
BigDumbDinosaur wrote:
floobydust wrote:
How soon do you plan on having the first PCB built up?

I haven't decided. I usually "sleep on it" for a couple of days and then review my work before ordering PCBs.

Well, I've slept on it and have concluded I've found all the errors. (Now, where have we heard that before?) Looks like I'm ready to send the Gerbers to the board house. 8)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 1:33 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1378
BigDumbDinosaur wrote:
BigDumbDinosaur wrote:
floobydust wrote:
How soon do you plan on having the first PCB built up?

I haven't decided. I usually "sleep on it" for a couple of days and then review my work before ordering PCBs.

Well, I've slept on it and have concluded I've found all the errors. (Now, where have we heard that before?) Looks like I'm ready to send the Gerbers to the board house. 8)


Nice! I need more sleep than you do on ordering PCBs... oddly, my best PCBs are always a 1.01 version (dream) versus the 1.00 version (nightmare).... who knew?

Post some pics when you get them... also, be interesting to see what the costs are ;-)

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 2:31 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
floobydust wrote:
Nice! I need more sleep than you do on ordering PCBs... oddly, my best PCBs are always a 1.01 version (dream) versus the 1.00 version (nightmare).... who knew?

Due to "corporate inertia" around here, I continue to use ExpressPCB's software to do the schematic and PCB layout. I also have a copy of XCheck, which was written by Marty Flickinger (formerly of Xetec, who made eight bit Commodore accessories such as printer interfaces) and is design-checking software for use with the ExpressPCB design files.

After laying out the schematic, I run XCheck against it, which can identify errors such as forgetting to connect one of a component's pins, or two components with the same name, e.g., U1 and U1. After fixing any errors, the PCB can be designed. The PCB layout is linked to the schematic in a way that allows you to highlight connecting points for any given net. That helps to avoid silly mistakes, e.g., missing or incorrectly-connected traces.

Express PCB's software only does limited checking for DRC violations, and does no checking for outright layout errors, such as accidentally cross-connecting two nets. This is where XCheck becomes very useful. XCheck will verify that the PCB's "wiring" exactly agrees with the schematic, as well as verify that the board layout doesn't have DRC violations or questionable layout conditions, such as unconnected device pins. The DRC parameters can be customized according to the preferred board house.

Once the PCB design is done and checked, I use another piece of software called Copper Connection to generate Gerbers and pack them into a ZIP file.

The only part of this workflow in which undetected errors are likely to pop up is in the actual circuit design and the accuracy of the resulting schematic. Obviously, the software can't think for you. If you wire VCC and ground together in the schematic the error will be propagated to the finished PCB if not caught. A similar error happened in POC V1.2, in which an incorrectly-formed LED symbol in the schematic with its pins reversed showed up in the PCB layout—and in the finished product. I had to hack up the unit before I could even power it to see if it would work. Fortunately, that was the only error.

Quote:
Post some pics when you get them... also, be interesting to see what the costs are ;-)

Will do with the pics.

As for cost, I really don't keep track of it too much. It's a hobby, so I expect to spend some money. I look at it as an investment in my mental well-being—such as it is. :shock:

The lion's share of the money will be in the PCBs. I'm going to order a stencil with this one so I can play around with reflowing. Some time ago, I did some reflow experimentation, but the project got pushed aside by other things, and in any case, it was clear I needed a stencil in order to properly apply solder paste.

The prototype of V2.0 will be manually soldered and once I've got it working, I will see if I can duplicate it via reflowing. As with POC V1.3, I have to get someone to solder the SOIC packages, since I can't see well enough to do those.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 12:01 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1084
Location: Albuquerque NM USA
I just received my first 4-layer pc board in 5 years from JLCPCB. It is 100mm X 100mm and cost $8 for 5 pc board. Design rule is 7mil trace and 7 mil space with 16mil drill holes. Beautifully fabricated, I don't know how they can build it at $1.60 per board.

2-layer and now 4-layer pc boards are so cheap, I hardly double check the designs anymore; just draw out the schematic, manually place, autoroute, and email out the design files. It normally took no more than an evening to design a board, which explains some spectacular mistakes like connecting VCC to ground and ground to VCC!
Bill


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 1:45 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1378
Thanks for the info on your process... I'm also continuing to use ExpressPCB for schematic and PCB layout. I got hooked on their Miniboard Pro 4-layer format some years ago. I've also created a fair number of parts for both schematic and PCB. I don't mind the cost of the 3 boards so much... albeit it is quite expensive compared to what others are getting from JLCPCB.

My next SBC will be mostly SMT, with much of it being very small formats and fine pitch, so building it will be a bit of a challenge. I still need to get a stereo microscope before I attempt the next PCB build. I still don't need glasses at my age, but certainly need some magnification for 0.3mm pitch. I'm also switching to 3.3V parts across the board, and will hope to modify an existing PCB to run a basic system for testing and such. I'm hoping to work on this next month... too much on the retirement work schedule this month!

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 6:37 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
floobydust wrote:
I still don't need glasses at my age...

Not to worry. Father Time will see to it that you will need them at some point. :D

Quote:
I'm also switching to 3.3V parts across the board...

Should be interesting to see how well it performs. Evidently the WDC processors with cores made from TSMC 0.6µ wafers can run much faster at 3.3V than the specs say they will. The question is can the 65C21/65C22/65C51 keep up on 3.3V?

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 7:00 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8236
Location: Midwestern USA
plasmo wrote:
I just received my first 4-layer pc board in 5 years from JLCPCB. It is 100mm X 100mm and cost $8 for 5 pc board. Design rule is 7mil trace and 7 mil space with 16mil drill holes.

On POC V2.0, signal traces are 0.006" wide on a nominal 0.025" center-to-center spacing. The smallest via is a 0.008" hole, with a 0.026" overall diameter. The board size for V2.0 is 6.375" × 4.000", 25.5 in² area.

Quote:
Beautifully fabricated, I don't know how they can build it at $1.60 per board.

I too wonder how they do it. I recall in the not-too-distant past when getting a prototype PCB made cost at least $500. These days, $500 can get you a whole pile of boards if you choose the right board house and your design isn't too big. I'm guessing the charges for hobby-quantity orders are little more than a break-even price that is readily absorbed by the orders for production quantities that are JLCPCB's bread and butter. The shipping charge for the POC V2.0 board with a template is nearly as much as what I'm being charged for the parts themselves.

Quote:
2-layer and now 4-layer pc boards are so cheap, I hardly double check the designs anymore;

Not me. The frugal (my wife says "cheap") Irishman in me compels me to repeatedly go over my layouts looking for anything that might be questionable. I try to get it as close to perfect as possible before I send in the Gerbers.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Sat Oct 23, 2021 5:01 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Jul 27, 2021 8:40 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8460
Location: Southern California
Yeah, going through a lengthy list of very thorough checks takes less time than having to troubleshoot and then get second and third revisions made. Depending on the errors, a lot of parts could be damaged, too. I am extremely cautious, and as a result, a revision is very rarely necessary.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 86 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 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: