6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Jul 07, 2024 6:44 am

All times are UTC




Post new topic Reply to topic  [ 62 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Wed May 18, 2022 11:13 am 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1019
Location: near Heidelberg, Germany
floobydust wrote:

2- I still recommend you split the OE and CS lines on the EEPROM devices and use the qualified read line from the 22V10. connected to OE.



I second that.

I had a long standing problem in one of my boards where I had gated /CS with Phi2. Depending on the chip maker it was creating power supply issues and thus noise on the databus that made the system crash.
Admittedly SRAM not ROM but still.

See here for example http://www.6502.org/users/andre/csa/bios/index.html

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 4:08 pm 
Offline
User avatar

Joined: Mon Dec 20, 2021 3:01 am
Posts: 17
Location: Glasgow, UK
floobydust wrote:
Last... are you really sure on using the W65C51? You have to code around the problem, so why not use a more modern and better UART/DUART. As you're also using a RS-232 level converter to interface to a DB-9 serial port, exactly what are you planning to use that port for? Driving some older device or perhaps as a serial console?

Serial link to PC console.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 4:24 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1378
For a serial console, there's an easier path... as most modern PCs don't have a traditional serial port, so you would need an adapter that would provide a serial port via USB (FTDI devices are big on this) and then that adapter would also handle the RS-232 voltage level transitions. On top of this, you would need a "null modem" cable that would swap the RxD/TxD lines and perhaps the RTS/CTS lines between them, plus the ground connection (a 5-wire null modem cable).

I would recommend you just use one of the FTDI devices and eliminate the Maxim chip entirely. You can connect directly to the 65C51 (or a different UART) and just plug directly into USB and you'll have a serial port up and running.

I suggest looking at their LC234X. Just wire it up directly to the 65C51. You should also tie the DTR, DCD and DSR lines together on the 65C51.

Attachment:
DS_LC234X.pdf [570.48 KiB]
Downloaded 38 times

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


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 6:34 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
alternatively if you only want communication to a modern PC and not bother with a UART at all, i can recommend: the FT240X.
it's basically a UART and UART to USB adpater in a single chip, it's super easy to hook up to any 8 bit system as one side just has the 8 bit data bus and RD/WR inputs, and the other side has the D+ and D- signals that you route to a USB connector (likely USB-B, as there is little reason to use anything else, plus you can use the USB connector for power as well to save a connector).

it technically runs at 3.3V but you can power it from 5V, all the inputs are 5V Tolerant, and the 3.3V that it outputs are enough for the 65Cxx chips to recognize.
there is no setup code required, once powered on and connected to a host it will just work. it has 2 built in FIFOs (1 send 1 receive) with 2 output pins that indicate the state of each FIFO.
when the "TXE" pin is low there is space in the sending FIFO, and when "RXF" is low there is data to read in the receiving FIFO.

one neat little feature is the fact that it has 2 IO pins that can be configured from your PC via the FT_PROG utility, the most interesting function is that you can use them as 6, 12, or 24MHz clock sources in case you don't want to bother with an oscillator on your board.
the only real downside is that it comes in an SMT package which at first looks scary, but even i managed it on my very first PCB using nothing but a regular soldering station, desoldering wick, and a decent amount of flux. (just flood all the pins with solder and use the wick to take away all the excess) so if you decide to go this route you should be perfectly fine.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 6:37 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
Is WolfNet affiliated with Wolftronics? I'm asking for a friend who is also a sheep.

I apologize for some of the regulars who claim your work was obtuse. I found your board layout almost self-documenting. Only minor details required reference to the very tidy schematic and the memory map provided a very concise overview. Indeed, in addition to your memory map being KIM-1 and Apple I compatible, I believe that your design is also W65C265 compatible.

Your double ATX board is possibly the largest design on the 6502 Forum. Correspondingly, it may be the most expensive. I tried getting a similar size board game manufactured as a PCB. Due to the lack of component footprints, JLCPCB rejected the design. PCBWay quoted USD80 per board for a minimum of five boards. It would be very worthwhile to design a single ATX board (or smaller) with hardware compatible fixing holes and slot positions.

I don't recommend expansion cards because they adversely affect maximum clock speed but if you're determined to use a card format, jfoucher's Planck bus is popular and I believe that it is licence compatible with your work. Planck bus is intended to provide 16 byte peripherals in the first half of page $FF and the cards are electrically safe if accidentally reversed. This could be extended with an asymmetric, keyed section to provide more address lines. Suitable cards could work in both systems. In your case, a host may be devised which allows short cards to present one 6522 or similar. Meanwhile, long cards may use a much larger section of the memory map.

It is a pleasure to see someone attempt a full 7805/7812/7912 linear PSU; especially for fully conformant 65SIB. After sparking a switch mode PSU and destroying, I made a bare 7805 and left space for 7812 but never implemented that section. Given that the 5 volt section of ATX PSU is the least likely part to persist future revisions of the standard and the most likely part to get destroyed with experimental hardware, it may be prudent to Buck convert and linear smooth 12V to 5V.

I believe that the self-certified European regulations which were valid until 2017 required 1mm track spacing for mains power. I presume that the spirit of the regulations was to make the separation larger the radius of any condensation. This isn't a problem if a board is lacquered or the tracks are on inner layers. However, I strongly recommend 3mm separation around mains power solder joints.

I like your interrupt mask and you are wise to present even values for JMP (abs,X). One additional signal should be brought to the register such that spurious interrupts may be directed to a ninth vector. Unfortunately, the 74x148 outputs switch asynchronously and may briefly exceed the interrupt threshold. I'm not sure how to fix this. Most people design 74x148 without mask and sample unstable outputs. This can be fixed by holding 74x148 inputs stable during a read cycle by using 74x573. Or using the FPGA "double flop" technique. You may have to drop the comparator and mask each 74x148 input separately with eight OR gates.

The most unique part of your design is the ability to re-write instructions or data. You note that it is possible to re-write opcodes but I believe that it is much more powerful to re-write operands to handle awkward cases such as parity, Gray code or nybble swap. In your current design, you have four unused bits in your write-only interrupt priority latch and four unused address lines on the re-write ROM. While it may be tempting to synchronously set the interrupt priority and re-write pattern, interrupt may occur during the latch write instruction. This would leave your system in a completely mangled state. This can be averted with a latch write to ignore interrupts followed by NOP followed by latch write to begin re-writes. At this point, all operands must be pre-scrambled so that they pass through the ROM as intended. While it would be desirable for parity to be reduced to zero or one, this range of outputs would prevent the re-write latch in page $D0 from being addressed.

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 18, 2022 7:59 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8464
Location: Southern California
DarkestSoul1992 wrote:
So I finally (at the age of 29) finished designing my first computer. It is 65(C)02 based with the following features:
  • Prioritised maskable interrupts.

Probably every interrupt source you'll use will be maskable at the source, so the additional masking ability would be redundant. I continue to be interested in the hardware priority thing, but I keep coming back to the fact that with any IC that can generate interrupts, there are generally several possible interrupt sources within the one IC, and if that IC does generate an interrupt and you have more than one of the sources in that IC enabled, you still have to poll to see which one it was. The 6522 VIA for example has seven possible sources but only one IRQ\ pin.

Quote:
  • 65SIB port.

A few here on the forum have put 65SIB ports on their SBCs. I put one on my workbench computer, and then the first time I made a 65SIB device, without doing a custom PCB, I found that it was a lot of work to wire up all the connections for the two connectors and do the voltage translation for 3.3V parts. I decided right away that I need to make a little board to take care of that and offer it to others as well, and I'm finally getting to it. I have the board laid out but not thoroughly checked and made yet. It will have several stuffing options, incorporating the regulators and optional voltage translation, and have the mounting and connector holes spaced to be friendly to plugging it into perfboard with a .100" grid if desired, also an SPI-10 connector option (so an SPI-10 module could also be a device on the 65SIB chain). There's room for shrouded connectors with ejector hooks. It's completely thru-hole, and with some cramming, got it into 2.850"x1.092". The shrouded 20-pin headers with ejector hooks are the biggest space hogs, taking more than half the board. You could of course also substitute the simpler 20-pin headers with no shrouds or ejector hooks if desired.

Make sure you go through the 6502 primer. It has a lot of material about construction subtleties that will save you a lot of headaches down the road.

_________________
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  
PostPosted: Wed May 18, 2022 9:20 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8253
Location: Midwestern USA
GARTHWILSON wrote:
DarkestSoul1992 wrote:
So I finally (at the age of 29) finished designing my first computer. It is 65(C)02 based with the following features:
  • Prioritised maskable interrupts.

Probably every interrupt source you'll use will be maskable at the source, so the additional masking ability would be redundant. I continue to be interested in the hardware priority thing, but I keep coming back to the fact that with any IC that can generate interrupts, there are generally several possible interrupt sources within the one IC, and if that IC does generate an interrupt and you have more than one of the sources in that IC enabled, you still have to poll to see which one it was. The 6522 VIA for example has seven possible sources but only one IRQ\ pin.

I've got the situation you describe in POC V1.2 and V1.3.

The virtual QUART has a total of nine enabled IRQ sources: four receivers, four transmitters and a counter/timer (C/T). That's quite a few possible interrupts to poll. Fortunately, the 28L92 offers the possibility of setting up four pins as channel-specific, open-drain IRQ outputs. Two are affected by the two receivers and the remaining two are affected by the transmitters. So I've got these outputs of both DUARTs wired to the inputs of a 74ACT540 inverting buffer whose outputs are attached to D0-D7—the ACT540’s /OE inputs are tied to a chip select in the I/O block decoder and the /RD line.

A read of the ACT540 returns the interrupt status of all four channels’ receivers and transmitters. In the vQUART’s ISR, the fetched byte is right-shifted to test each bit. If a bit is cleared, that channel is skipped. Otherwise the relevant code is executed. Other than the C/T, which doesn't have a dedicated IRQ output, the interrupt status registers are not touched at all.

Incidentally, the interrupt priority with this arrangement is C/T, receivers, transmitters, SCSI host adapter.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri May 20, 2022 11:05 pm 
Offline
User avatar

Joined: Mon Dec 20, 2021 3:01 am
Posts: 17
Location: Glasgow, UK
Just out of curiosity, does anyone have anyone here have any experience with the MCP2200 SOIC? It takes 3.3 or 5v logic depending on the voltage source. Seems like a good chip to use but haven't seen anyone mention it yet. Datasheet here: https://ww1.microchip.com/downloads/en/DeviceDoc/22228A.pdf


Top
 Profile  
Reply with quote  
PostPosted: Fri May 20, 2022 11:56 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1378
I've not used it... I've stuck with the FTDI devices, as they've always worked for me and they have drivers for Windoze, Linux and OSX (I use OSX). FTDI also make a nice packaged adapter in a DB-9 casing. You simply install it in place of a DB-9 connector and it has the same pinout for RS-232. They make both Male and Female outline versions, plus interface voltage versions for 3.3V, 5V and RS-232 +/- 12V. I use the 3.3V and 5V versions for my current systems.

Sadly, they've gone up in price over the past couple years, but it's a single part interface, nothing else needed, Datasheet attached.

Attachment:
DS_DB9-USB-15654.pdf [605.73 KiB]
Downloaded 29 times


PS - I'd still recommend replacing the 65C51 with a NXP SC28L91/92 (UART/DUART), which is a much better part. You can also use the counter/timer for a 10ms jiffy clock and not worry about the CPU clock rate changing (like you would with a 65C22 timer used as such).

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


Top
 Profile  
Reply with quote  
PostPosted: Sat May 21, 2022 6:15 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8253
Location: Midwestern USA
floobydust wrote:
PS - I'd still recommend replacing the 65C51 with a NXP SC28L91/92 (UART/DUART), which is a much better part.

I’ll second that.

The 65C51 is mid-1970s UART technology and even back then, was considered inferior to its contemporaries. It’s not like Kentucky bourbon: it hasn’t improved with age. UART technology has progressed by enormous leaps and bounds since those days, but the 65C51 is the same as it was 45 years ago.

WDC’s implementation unfortunately resulted in the “stuck” TxD bit errata that requires software pacing to assure error-free transmission. From my perspective, if that kind of hoop-jumping is necessary just to output some data, better to put the programming effort into a modern UART that doesn’t have defects and a brain-dead design.

Quote:
You can also use the counter/timer for a 10ms jiffy clock and not worry about the CPU clock rate changing (like you would with a 65C22 timer used as such).

That too is advantageous. VIA timers are slaved to Ø2, which is kind of annoying. The counter/timer (C/T) in the 28L92 runs on a fixed clock, which means Ø2 can be anything without affecting the C/T.

Speaking of the C/T, something that is somewhat obscure in the 28L92’s data sheet is the C/T can be driven by an external clock source instead of the 3.6864 MHz X1 clock. Exploiting that feature would open the door to a wide range of timing possibilities.

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


Top
 Profile  
Reply with quote  
PostPosted: Fri May 27, 2022 3:19 am 
Offline
User avatar

Joined: Mon Dec 20, 2021 3:01 am
Posts: 17
Location: Glasgow, UK
Will be looking through alternate UARTs as a lot of people have recommended it.
Quote:
I've not used it... I've stuck with the FTDI devices, as they've always worked for me and they have drivers for Windoze, Linux and OSX (I use OSX).

The MCP2200 is also Linux and MacOS compatible as it uses the native VCP drivers. Looks to be an amazing chip to me. Just wonder why it hasn't been widely used with 6502?
Quote:
Is WolfNet affiliated with Wolftronics? I'm asking for a friend who is also a sheep.

Nope, although I like that you made the association. WolfNet is a non-profit organisation that makes electronics for a multitude of purposes.
Quote:
Your double ATX board is possibly the largest design on the 6502 Forum. Correspondingly, it may be the most expensive.

I have rectified this, the new board is only 305mm x 190mm. This is now smaller than a standard ATX motherboard.
Quote:
I apologize for some of the regulars who claim your work was obtuse. I found your board layout almost self-documenting. Only minor details required reference to the very tidy schematic and the memory map provided a very concise overview. Indeed, in addition to your memory map being KIM-1 and Apple I compatible, I believe that your design is also W65C265 compatible.

Thank you for your encouragement and kind words. I will continue as before and do as I do. Having done systems and controls and IT previously does help with the documenting process but I too feel that most of it was self explanatory.

All in all, you have all been very helpful and given some sound recommendations. I think that now, rather than building out of logic gates, I will document the design as if it had been designed using logic gates but actually use PLDs for the address decoding and logic gates. MCP2200 will be used in place of the MAX235 and I will find another 5v UART for the serial communication with PC. Power supply has been replaced with 20/24 pin ATX PSU. This has been a valuable learning experience and I am very thankful for everyone's help. See here: https://thealmostgenius.geekgalaxy.com/WolfNet-6502-WBC/thanks.html


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 01, 2022 4:26 pm 
Offline
User avatar

Joined: Tue Aug 11, 2020 3:45 am
Posts: 311
Location: A magnetic field
Sheep64 on Wed 18 May 2022 wrote:
74x148 outputs switch asynchronously and may briefly exceed the interrupt threshold.


Since writing this, I've found that I've made a worse mistake in my own design.

_________________
Modules | Processors | Boards | Boxes | Beep, Beep! I'm a sheep!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 27, 2022 12:28 pm 
Offline
User avatar

Joined: Mon Jun 27, 2022 12:08 pm
Posts: 3
Location: Swindon, UK/Chengdu, Sichuan, PRC
Quote:
Quote:
Is WolfNet affiliated with Wolftronics? I'm asking for a friend who is also a sheep.

Nope, although I like that you made the association. WolfNet is a non-profit organisation that makes electronics for a multitude of purposes.

Although it has the support of LoneWolf Enterprises :D


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 27, 2022 1:45 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3366
Location: Ontario, Canada
Welcome, tmd63 ! :)

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 30, 2022 8:59 am 
Offline

Joined: Tue Jul 07, 2020 10:35 am
Posts: 40
Location: Amsterdam, NL
I have found it essentially impossible to get FTDI devices now due to the global chip shortages. My design called for the FT230XS but at one point ship times for those were October...2023! I sometimes see small quantities pop up but because of the shortages I have since switched to the cheaper (and less feature-packed, sure) CH340C which has at a minimum native OS X support. This chip appears in a lot of the cheap USB -> UART breakout boards and has a very low part count. Additionally, the part is physically bigger (SOP-16 vs SSOP-16) so is much easier to solder.

I've attached my (untested) single-board computer design and you can see the CH340C and how it's hooked up to the SC28L92 in the lower right hand corner. You can use the 340C bits with some confidence though as those have been tested independently connected to an older SBC design of mine.

Attachment:
File comment: SBC design using the CH340C and SC28L92
n8 Bit Special.pdf [366.6 KiB]
Downloaded 41 times


PCBs of this design are on the way but i never choose the fastest shipping option :)


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

All times are UTC


Who is online

Users browsing this forum: hoglet and 6 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: