Falcon sD|SPi interface idea

Troubles with your machine? Just want to speak about the latest improvements? This is the place!

Moderators: Mug UK, Zorro 2, Greenious, spiny, Moderator Team

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Falcon sD|SPi interface idea

Postby CodeKiller » Thu Jan 10, 2019 12:05 am

Just throwing this idea out if anybody would like to make it possible, IF possible, or maybe I will ... but that would be much later..

The Falcon has a very interesting connector: the DSP connector - it has SPI-like communication with DMA to use quite a high throughput and a programmable clock divider with support for external clock if the internal is not suitable.
So naturally gives the idea Why not connect an SD Card in SPI mode to it?

Electrical interface:
The SD card runs on 3.3V but the DSP port only have a +12V Vcc, so needs some better 3.3V regulator that can handle input up to 15-20V (like AMS1117 3.3 or LM1117 3.3 ). Next is to connect the signals a regular 74HC244 can be used (powered from the 3.3V).
There is a bit other difference: the SD card uses the rising edge of the clock to latch but the DSP port (playclock/recclock) uses the falling edge, so it needs a NOT gate.

Signaling:
The play-/recdata can be the MOSI / MISO. Both SPI and this serial port uses MSB first, so no need to change order.
The playclk can be inverted (rising edge instead of falling one) and used as SCLK (do not connect with the recclk as both are output!)
And finally some special modes. It looks the best way to use the serial in/out is in handshake mode to be synchronized with each other (both starts the same time), but that needs an additional signal. There are 3 GPIO, ex. GP0 can be connected to both SYNC and used to start the transfer.
The SD card still need another signal, the SS (slave select), that is sadly active low, so maybe GP1 could be used for this purpose (or maybe just negate the SYNC and use just that)

Then there are a few problems/uncertainties that needs to be addressed before:
The transfer is based on 2byte words while the SPI is byte based, but doesn't looks that important as the commands are 6bytes long and then read/write is usually 512bytes. Just in some cases when waiting for R1 response does it matter, but that can be done by checking both halves of a word.

And this is the current end of my knowledge.
There are the following questions I need to be answered:
How to check if a serial data has been transferred?
In the Developer manual there is the line: "A minimum of two clock periods will always be inserted between data words."
What does it mean?? Can't produce gapless datatastream? Then how does the diag cart can check the serial in-out with just wire-loopback? Or is it just mean that it needs time to set up again but not the actual signals produced on the output? :shrug:
It may be easy to test, but i don't have the time and knowledge to do by myself...


Then it just needs a driver/program that can init an SD card (preferably with support to SDHC and SDXC) -- don't forget to do it with a clock slower than 400kHz, then it can be ramped up to 32MHz/4 (that's the smallest clk divider), and just need a FAT interface to be included.
For skeleton I think the hxc_sdcp source could be used, it already have some browser-like feature, and a FAT32 library, and available here: http://onorisoft.free.fr/retro.htm?atari/falcon.htm

joska
Hardware Guru
Hardware Guru
Posts: 4419
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Falcon sD|SPi interface idea

Postby joska » Thu Jan 10, 2019 10:03 am

CodeKiller wrote: and just need a FAT interface to be included.
For skeleton I think the hxc_sdcp source could be used, it already have some browser-like feature, and a FAT32 library, and available here: http://onorisoft.free.fr/retro.htm?atari/falcon.htm


You don't need that, TOS already understands FAT (FAT16, MiNT and MagiC handles FAT32 and VFAT) so you only have to add a BIOS driver for this device.

However, not sure what you want to accomplish with this, as you can buy cheap (£5-10) IDE->SD interfaces that works perfectly fine with the Falcon's IDE bus.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Re: Falcon sD|SPi interface idea

Postby CodeKiller » Thu Jan 10, 2019 3:12 pm

joska wrote:However, not sure what you want to accomplish with this,


Cheap, relative fast, accessible interface without hacking the case apart.
I have problems accessing the internal storage after formatted (CF card partitioned and formatted to TOS drives) -- yeah, Drive imager 1.35 can do some transfer but no delete and no recursive copy makes it really annoying and the fact I have to torn down a lot of the machine to have access to the card is not a great way to copy files.
Alternatively I could use the linked hxc_sdcp even with my flashfloppy-gotek but it is painfully slow. (don't even mention to copy floppies/floppy images...)
SCSI card readers are very expensive if even available and needs some modern HDDriver - which also has kinda steep price. (CD/DVDs are a bit hassle and the SD2SCSI also a bit pricey and does not accept regular files on a FAT formatted card)
LocalTalk and Serial are slow and the former needs more special stuffs to even connect to.

So yeah, any better way to copy files i'm not aware of?
(used various Amigas and those are SO MUCH EASIER to deal with: the emulator even mounts real raw drives and directories as drives, a600/1200 can use pcmcia/cf adapters, some ethernet cards.... and don't have to buy expensive device drivers....)

joska
Hardware Guru
Hardware Guru
Posts: 4419
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Falcon sD|SPi interface idea

Postby joska » Thu Jan 10, 2019 4:10 pm

CodeKiller wrote:Cheap, relative fast, accessible interface without hacking the case apart.


Good point. Such a device would probably not be very usable as a primary mass storage device, but well suited for data exchange.

CodeKiller wrote:So yeah, any better way to copy files i'm not aware of?


PARCP-USB is a very good choice IMO. I'm using mine with all my Ataris, a very convenient tool. Very reasonably priced too.

CodeKiller wrote:(used various Amigas and those are SO MUCH EASIER to deal with: the emulator even mounts real raw drives and directories as drives, a600/1200 can use pcmcia/cf adapters, some ethernet cards....


What emulators have you tried? Both ARAnyM and Hatari can mount and access real devices, atleast under Linux (I only use Windows at work).

CodeKiller wrote:and don't have to buy expensive device drivers....)


What device drivers are you referring to? Harddisk drivers?
Last edited by joska on Thu Jan 10, 2019 5:07 pm, edited 1 time in total.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

mpattonm
Hardware Guru
Hardware Guru
Posts: 417
Joined: Mon Oct 21, 2002 8:52 am
Location: Czech republic
Contact:

Re: Falcon sD|SPi interface idea

Postby mpattonm » Thu Jan 10, 2019 5:03 pm

CodeKiller wrote:So yeah, any better way to copy files i'm not aware of?

I am not sure if its any better, but it appearently seems good to some - USB thumbdrive on NetUSBee
On the other hand, every new hardware supported by stable drivers is always welcome!

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Re: Falcon sD|SPi interface idea

Postby CodeKiller » Thu Jan 10, 2019 10:49 pm

PARCP for 40eur and only marginally faster than a serial/hxc raw? nah -- but at least have a nice file manager
NetUSBee looks nice but 60eur -- maybe one day.

If possible, this SD interface could achieve around 1MB/s transfer speed (a bit slower for writing) and could cost around 10eur including the connectors.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12781
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Falcon sD|SPi interface idea

Postby wongck » Fri Jan 11, 2019 1:11 am

This is a nice idea.
The DSP port has nothing connected to my Falcon since day 1.
So it be good to be able to do something with it.

Additional storage and another way xfer files is always good.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1985
Joined: Sun Jul 31, 2011 1:11 pm

Re: Falcon sD|SPi interface idea

Postby Eero Tamminen » Fri Jan 11, 2019 11:18 pm

CodeKiller wrote:SCSI card readers are very expensive if even available and needs some modern HDDriver - which also has kinda steep price. (CD/DVDs are a bit hassle and the SD2SCSI also a bit pricey and does not accept regular files on a FAT formatted card)


Latest EmuTOS release (v0.9.10) added SCSI support, so you don't necessarily need driver to access SCSI storage.

ctirad
Captain Atari
Captain Atari
Posts: 278
Joined: Sun Jul 15, 2012 9:44 pm

Re: Falcon sD|SPi interface idea

Postby ctirad » Fri Jan 11, 2019 11:59 pm

Interesting. That reminds me a simple SD card interface for the 8bit Thomson, that plugs to the joystick port. Perhaps an enhanced joy ports on the F030/STE could be bitbanged fast enough to emulate SPI as well?

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Re: Falcon sD|SPi interface idea

Postby CodeKiller » Sat Jan 12, 2019 12:10 am

ctirad wrote:Interesting. That reminds me a simple SD card interface for the 8bit Thomson, that plugs to the joystick port. Perhaps an enhanced joy ports on the F030/STE could be bitbanged fast enough to emulate SPI as well?


But why bitbang, if there is this fast DMA-capable interface? The STE can't really use hard disks anyway, or you can use the Ultrasatan (satandisk) easier(?).

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Re: Falcon sD|SPi interface idea

Postby CodeKiller » Sat Jan 12, 2019 12:12 am

So back to the questions in the OP, does anyone knows
- how to know if a serial transfer has been completed?
- what does that '2 clock cycle between words' in the manual means?

ctirad
Captain Atari
Captain Atari
Posts: 278
Joined: Sun Jul 15, 2012 9:44 pm

Re: Falcon sD|SPi interface idea

Postby ctirad » Mon Jan 14, 2019 6:26 pm

CodeKiller wrote:But why bitbang, if there is this fast DMA-capable interface?


Because it can be done? ;)

Anyway, DSP port connected mass storage would effectively break any software, that use the DSP and Falcon audio subystem.

The STE can't really use hard disks anyway, or you can use the Ultrasatan (satandisk) easier(?).


I use US regulary with my STE and Megas quite comfortably.

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Re: Falcon sD|SPi interface idea

Postby CodeKiller » Tue Jan 15, 2019 2:08 am

It was not intended to be a permanent storage device but a fast and cheap transfer option between modern computers and the Falcon('s internal storage)

User avatar
CodeKiller
Atari freak
Atari freak
Posts: 51
Joined: Mon Jan 12, 2015 6:48 pm

Re: Falcon sD|SPi interface idea

Postby CodeKiller » Tue Jan 15, 2019 12:50 pm

ctirad wrote:Interesting. That reminds me a simple SD card interface for the 8bit Thomson, that plugs to the joystick port. Perhaps an enhanced joy ports on the F030/STE could be bitbanged fast enough to emulate SPI as well?


SPI is not about the speed, but about the signals. You can SPI as slow as you like but would you?

Forget it man, I have optimized the s*t out of a bitbanging driver for a linux STB running @33MHz and was able to achieve a mere 20-ish kbytes/s.
Even on a stock 16MHz Falcon would it be a slog not to mention the STE. Just remember, every BIT needs at least 4 instruction to be sent (set data_out, set clock, read data_in, reset clock) plus some counters or shifts and branches -- and also these instructions even in asm takes more than a single cpu-clock to be executed.

Better to use the HxC-copy then. It has similar speed and you can use USB mass storage.

But I would like to copy Megs and not just 2600 ROMs :P

ctirad
Captain Atari
Captain Atari
Posts: 278
Joined: Sun Jul 15, 2012 9:44 pm

Re: Falcon sD|SPi interface idea

Postby ctirad » Tue Jan 22, 2019 11:36 pm

CodeKiller wrote:Forget it man, I have optimized the s*t out of a bitbanging driver for a linux STB running @33MHz and was able to achieve a mere 20-ish kbytes/s.


I'm quite sure, the speed of the Thomson interface is like 55kB/s and its an 8bit machine. It can even play video. Pretty impressive for a device without any MCU or PLD, just the SD slot, 3.3V LDO and level shifter.

But it does not matter. I just wanted to say, the ST platform still lacks some really inxepensive mass storage solution. Satandisk is too limited, Ultrasatan is nice, but based on expensive chip and thus not exactly cheap. Cosmosex is an expensive overkill for most users. Thus, some slow, but extremely cheap and easily DIYed SPI based device does not sound like an odd idea to me.

Indeed, for an "highend" soulution, I'd love to see something new, based on the modern lowcost hardware, say 4$ ESP32, connected directly to the ACSI (or SCSI). I was doing a couple projects based on ESP32 at work. It is a nice, powerfull and easy to use platfrom.

Better to use the HxC-copy then. It has similar speed and you can use USB mass storage.


Good point. I own a couple of Goteks with opensource FF firmware. With some effort on the FF and with some help from the atari side, it shloud be possible to extend it to true mass storage device with somewhat acceptable speed.

In any case, I do not want to dissuade you from doing your interface. :cheers:


Social Media

     

Return to “Hardware”

Who is online

Users browsing this forum: No registered users and 6 guests