6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 10, 2024 9:24 pm

All times are UTC




Post new topic Reply to topic  [ 43 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Sun May 23, 2021 2:49 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Good plan on following BDD's guide.... however, if you're planning on using one channel of the 28L92 as a console, you might want to consider using a FTDI USB-UART adapter. This will simplify getting a basic console running on any modern machine which, rarely has anything like an older style RS-232 serial port. My current SBC uses one of these (FTDI interfaces) and it's been flawless in operation.

PS - take the luck twice... it's small :wink:

and do post your progress!

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


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Mon May 24, 2021 6:23 am 
Offline

Joined: Tue Jan 22, 2019 4:47 am
Posts: 18
Location: Louisiana
floobydust wrote:
Good plan on following BDD's guide.... however, if you're planning on using one channel of the 28L92 as a console, you might want to consider using a FTDI USB-UART adapter. This will simplify getting a basic console running on any modern machine which, rarely has anything like an older style RS-232 serial port. My current SBC uses one of these (FTDI interfaces) and it's been flawless in operation.

PS - take the luck twice... it's small :wink:

and do post your progress!


Will do :)

What FTDI USB-UART IC do you recommend?

_________________
-------------------------------
Have an awesome day!


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Mon May 24, 2021 7:51 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8539
Location: Southern California
ashtons wrote:
What FTDI USB-UART IC do you recommend?

Whatever you do, make sure it's a genuine FTDI. There are Chinese copies which, when you use FTDI software on the PC, get bricked. I have an FTDI USB-COM232-PLUS1, and the driver that came with it definitely did not make it as easy as having a COM port on the PC. I got it quite a few years ago though, so it's possible their software has improved since then.

_________________
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  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Mon May 24, 2021 12:03 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
So far, I've used a couple different ones. As all of their IC products are SMT, the newer ones are quite small and some are BGA, so putting one of these together might be a challenge if you don't have the right soldering equipment.

Fortunately, FTDI also make some pre-built modules... I've used two over the years. One is assembled as a DB-9 connector which is very convenient and designed to interface directly to a UART via RS-232 levels, 3.3V or 5.0V signals. I use this one on my Pocket SBC:

https://www.mouser.com/ProductDetail/FT ... PQ7A%3D%3D

The other one I've used is their newer LC-234X module... which is a more classic PCB with a mini-USB connector.

https://www.mouser.com/ProductDetail/FT ... 9qZ0PwY%3D

As Garth noted, there are clones of FTDI parts, which may not work correctly in all situations. There are also other modules based on other chips that perform the same basic function. I still prefer the FTDI parts that have the RTS and CTS lines available, as I wire these for 5-wire operation. My BIOS uses RTS/CTS handshaking and the FTDI devices work perfectly in this configuration.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Tue May 25, 2021 8:27 pm 
Offline

Joined: Tue Jan 22, 2019 4:47 am
Posts: 18
Location: Louisiana
Alright, I think I've got somewhat of a schematic ready. I wouldn't say it's complete though, as it probably lacks the circuitry to make sure everything can work together properly in terms of timing (and by probably I mean definitely). It also lacks the priority interrupt circuitry because I forgot to add that in before making the PDF... as well as the clock oscillator... and the power source...


Attachments:
PC32_schematic.pdf [13.29 MiB]
Downloaded 63 times

_________________
-------------------------------
Have an awesome day!
Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Wed May 26, 2021 3:48 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
As an aside, I've read the rumors of 'bricked' USB-serial adapters - on the Internet. I haven't come across any USB-serial adapters that don't work, and I've bought hundreds of very cheap ones from AliExpress and EBay for various projects over a decade or so.

Back in the day they used to come with a little Windows/Mac driver CD which gave me another reason to be a happy Linux user. Microsoft's USBSER.SYS drivers were full of bugs for an entire decade! The corporate world was happy to blame all malfunctions on 'Cheap Chinese counterfeits' and manufacturers were 'invited' to ship drivers with their driverless USB hardware. Some were tempted to make drivers that disabled older/competitor's devices to force upgrades and inflate profits. I don't think that is an issue today.

We must be careful of this Internet phenomenon, where a statement gets repeated often enough to be deemed true. Skepticism is our only hope.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Wed May 26, 2021 4:57 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
ashtons wrote:
Alright, I think I've got somewhat of a schematic ready. I wouldn't say it's complete though, as it probably lacks the circuitry to make sure everything can work together properly in terms of timing (and by probably I mean definitely). It also lacks the priority interrupt circuitry because I forgot to add that in before making the PDF... as well as the clock oscillator... and the power source...


Well, that's quite a lot of chips for something portable running on battery. However, I don't really think of it as a schematic. Fritzing really isn't a good schematic tool, but more for a small breadboard project where you just insert DIP chips and jumpers to wire bits up. When you get more than a few chips, it's difficult to read and determine what goes where in a true schematic sense.

Is this a design you've been working on from scratch or is a compilation of a bunch of disparate bits and pieces you found? Also, have you built up anything previously, i.e., a simple breadboard system, kit based PCB, etc.? Also, note that the FTDI 232 chip uses TTL level signals, so you shouldn't pass these thru the MAX RS-232 level converter. Also, many bits and pieces missing, so not a true picture of what you're trying to build (no resistors, capacitors, diodes, etc.). Also, some signal names like MISO and MOSI are generally SPI signal definition names, so using them on the VIA port lines seems confusing.

Having such a large project in the works, you may want to look at a more appropriate schematic tool... using actual schematic parts for gates, inverters, flip-flops and other common glue logic (versus multiple DIP chips with cryptic labels) would make it easy to read and follow signals.

I would also suggest doing some basic prototyping of parts of the circuit... get something minimal working first, then start adding other hardware components for I/O, etc.

Last... for a nice descriptive format of a hardware design and schematic layout, take a look at BDD's recent POC V1.3 PDF, which can be downloaded as a PDF at the following link:
viewtopic.php?f=4&t=1457&start=435#p83948

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


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Wed May 26, 2021 5:08 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
enso wrote:
As an aside, I've read the rumors of 'bricked' USB-serial adapters - on the Internet. I haven't come across any USB-serial adapters that don't work, and I've bought hundreds of very cheap ones from AliExpress and EBay for various projects over a decade or so.

Back in the day they used to come with a little Windows/Mac driver CD which gave me another reason to be a happy Linux user. Microsoft's USBSER.SYS drivers were full of bugs for an entire decade! The corporate world was happy to blame all malfunctions on 'Cheap Chinese counterfeits' and manufacturers were 'invited' to ship drivers with their driverless USB hardware. Some were tempted to make drivers that disabled older/competitor's devices to force upgrades and inflate profits. I don't think that is an issue today.

We must be careful of this Internet phenomenon, where a statement gets repeated often enough to be deemed true. Skepticism is our only hope.


In general, I prefer to stick with the FTDI devices... they provide good quality drivers for Windoze, Linux and OSX (which is based on a Unix kernel). I have a couple inexpensive USB-UART devices (CP21xx something or others) which work fine, but they show up to the OS as the same serial number, etc., so if you plug the second in, neither will work! With the FTDI devices, I've had 4-5 SBCs plugged into one machine and have Serial (OSX terminal app) with a window session open for each one... and they all work flawlessly. I'm a happy OSX user... but run Windoze, Linux, BSD, etc. under Fusion (and at the same time). 8)

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


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Wed May 26, 2021 9:03 pm 
Offline
User avatar

Joined: Sat Sep 29, 2012 10:15 pm
Posts: 904
Linux comes with opensource VCP drivers that support FTDI chips among other things... I am not sure if FTDI authored them, but I believe they were at least cooperating in the effort (as they should). Thankfully I haven't had to "load a munfacturer's driver" in ages, and with luck never will.

I've plugged in multiple CP21xx devices into my Linux box, and other than the usual 'which port will USB map me to this time', had no problems. Perhaps your issues were fixed.

There is really no problem with Silicon Labs as far as I can tell. I believe CP21xx devices have GPIOs configurable for handshaking. I am not promoting them in any way, but it is good to have competition.

Sorry about going off-topic.

_________________
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Sat Jun 11, 2022 2:55 pm 
Offline

Joined: Tue Jan 22, 2019 4:47 am
Posts: 18
Location: Louisiana
I've redone my schematic in KiCAD. I've also simplified the glue logic to the best of my ability, primarily by ignoring A7 and A6 in the address decode logic when it comes to the I/O devices, and using a series of OR gates to select between either the built-in I/O on page $80 or any expansion I/O on pages $81 through $8F. There's still probably more simplification that can be done, but that can be figured out after I fit the CF card reader into the address decode logic. Also, I hope the CF card interface doesn't require more than 10 registers because if so I'm going to need to rework the address decode again.


Attachments:
File comment: Work-in-progress KiCAD Schematic for the Neutron PC32
PC32.pdf [101.42 KiB]
Downloaded 51 times

_________________
-------------------------------
Have an awesome day!
Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Sun Jun 12, 2022 3:01 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
You might want to take a closer look at your schematic. There are (obviously) some missing components and such, but some basic things you should be doing would include:

- adding pullup resistors to CPU lines: Reset, NMI, IRQ, BE, RDY and SO.
- using the CPU Clock2 line to qualify your memory write line at a minimum.

Looking at your I/O decoding, it's overly complicated and far too many gate delays. Also, the way it's showing, it won't work either.

On the second page, you're using a 74HC137 (3-to-8 decoder) with a 'HC04 inverter to create a main I/O select line at $8000 (pin 15). This is an active low signal for I/O.

One the third page, you're using a 74LS32 quad OR gate cascaded to drive a 'HC04 inverter to provide an I/O select to the 74HC139 (2-to-4 decoder).

The problem here is, the IO_SEL line driving pin 2 of the 'LS32 is active low, and the signal needs to be active high. Also, all of the address lines (A8, A9, A10, A11) driving the OR gates are active high, so if ANY of those address lines are active, the output at pin 11 will be high, which feeds the 'HC04, which will drive an active low to the 'HC139. Also, when the IO_SEL line is inactive (high), your EXPIO_SEL line will be active. In short, you will be driving an I/O device active pretty much all the time, except when you have an active IO_SEL line and address lines A8 thru A11 are inactive.

I suggest you draw out your full memory map and include which lines need to be active high or low and the memory range they are active for. Also, not using A6 and A7, you would have 4 echoed selects at different memory ranges. You should also consult the various datasheets and start adding up the average propagation delays with all of the gates, inverters and decoders you're using. It's getting to be a pretty big number. You might want to simply come up with the list of I/O selects and widths you need for the various devices and work backwards from there.

Finally, a CF card in true IDE mode can present the same set of I/O registers as a standard IDE disk device. Here's the definitions for my interface which includes the upper latch for 16-bit data lines:

Code:
; Adding BIOS definitions for 16-bit IDE interface
; uses two addresses for Upper Byte Latch read / write
; uses eight addresses for Command Block Registers
; uses two addresses for Control Block Registers
;
IDE_16_READ     .EQU    RTC_IDE_BASE+$14        ;Upper byte Read address
IDE_16_WRITE    .EQU    RTC_IDE_BASE+$15        ;Upper byte Write address
;
; Adding BIOS definitions for IDE Controller (HARD DISK, Flash Module, etc.)
; Hardware Adapter provides a 16-bit IDE Port per:
;  Seagate ATA Interface Reference Manual 36111-001, Rev. C (21st May 1993)
;
; Control Block Registers
IDE_ALT_STATUS  .EQU    RTC_IDE_BASE+$16        ;Alternate Status Register (READ)
IDE_DEV_CTRL    .EQU    RTC_IDE_BASE+$16        ;Device Control Register (WRITE)
IDE_DRV_ADDR    .EQU    RTC_IDE_BASE+$17        ;Drive Address Register (READ)
;
; Command Block Registers
IDE_DATA        .EQU    RTC_IDE_BASE+$18        ;Data Register (R/W)
IDE_ERROR       .EQU    RTC_IDE_BASE+$19        ;Error Register (READ)
IDE_FEATURE     .EQU    RTC_IDE_BASE+$19        ;Feature Register (WRITE)
IDE_SCT_CNT     .EQU    RTC_IDE_BASE+$1A        ;Sector Count Register
IDE_SCT_NUM     .EQU    RTC_IDE_BASE+$1B        ;Sector Number Register
IDE_CYL_LOW     .EQU    RTC_IDE_BASE+$1C        ;Cylinder Low Register
IDE_CYL_HIGH    .EQU    RTC_IDE_BASE+$1D        ;Cylinder High Register
IDE_DRV_HEAD    .EQU    RTC_IDE_BASE+$1E        ;Drive/Head Register
IDE_STATUS      .EQU    RTC_IDE_BASE+$1F        ;Status Register (READ)
IDE_COMMAND     .EQU    RTC_IDE_BASE+$1F        ;Command Register (WRITE)
;


Hope this helps.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Mon Apr 22, 2024 10:40 am 
Offline

Joined: Sun Dec 14, 2003 11:34 pm
Posts: 8
Location: Eindhoven - Holland
Hello Kevin,

Hope everything is alright with you!

I'm finally starting to build the CF-Card and I was wondering what kind of part Q1 is.


Best regards,


Edzard


Top
 Profile  
Reply with quote  
 Post subject: Re: CF-Card/RTC adapter
PostPosted: Mon Jun 10, 2024 8:51 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Edzard wrote:
Hello Kevin,

Hope everything is alright with you!

I'm finally starting to build the CF-Card and I was wondering what kind of part Q1 is.


Best regards,


Edzard


Hi Edzard,

Sorry for the delayed response... I can no longer access 6502.org when I'm home due to an odd internet issue with AT&T fiber that started in November 2023.

As I'm traveling, I have access ;-)

Q1 is just a standard MOSFET... as the interrupt line from an IDE device is active high (and open drain), it needs to be inverted so it can be used with the 65C02 IRQ input. I used a typical BS170 part which is readily available. Hope this helps.

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


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

All times are UTC


Who is online

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