Arduino Filestore

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
flynnjs
Posts: 757
Joined: Tue Jul 06, 2010 9:33 pm

Re: Arduino Filestore

Postby flynnjs » Tue Nov 14, 2017 4:58 pm

myelin wrote:
crj wrote:That assumes that, without the 6854, you have some alternative form of serialise/deserialise logic (with at least a couple of bytes of FIFO) so that you can operate byte by byte rather than bit by bit.

That's exactly what I have in mind (using a small CPLD to handle clocking bits onto and off the wire, flag matching, and zero insertion/removal) :) I'm curious about operations that have to happen in less than 1us, though, because as far as I can tell, nothing should be anywhere near as latency sensitive as that.


That's what it done on the USB Econet project. The hardware is done, it just needs someone to finish the
host software. The libusb code is tested and working so there's not much more to do.

User avatar
myelin
Posts: 203
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Arduino Filestore

Postby myelin » Tue Nov 14, 2017 5:11 pm

flynnjs wrote:That's what it done on the USB Econet project. The hardware is done, it just needs someone to finish the
host software. The libusb code is tested and working so there's not much more to do.

I'm interested -- will send you a PM.
SW/EE from New Zealand, now in San Francisco: http://myelin.nz/
Having fun making hardware projects for the Electron!
So far: 32k flash cart, USB cart interface, 3-cart expansion, Elk PiTubeDirect. Later: Dual ported ram cart.

User avatar
flynnjs
Posts: 757
Joined: Tue Jul 06, 2010 9:33 pm

Re: Arduino Filestore

Postby flynnjs » Tue Nov 14, 2017 10:01 pm

The CPLD code basically bit stuffs (and unstuffs) so you can connect to an 8bit SPI port.
Obviously as the Econet has a clock the CPLD is the master and the MCU is the slave.

The code is very ugly with some extremely dubious async clock stuff going on to
squeeze the functionality ouf of the 9500 which doesn't support dual edge FFs.

I'll see what I can dig out.

User avatar
myelin
Posts: 203
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Arduino Filestore

Postby myelin » Tue Nov 14, 2017 10:46 pm

flynnjs wrote:The CPLD code basically bit stuffs (and unstuffs) so you can connect to an 8bit SPI port.
Obviously as the Econet has a clock the CPLD is the master and the MCU is the slave.

The code is very ugly with some extremely dubious async clock stuff going on to
squeeze the functionality ouf of the 9500 which doesn't support dual edge FFs.

I'll see what I can dig out.

I'd love to see it. For my "Econet from scratch" board, I was planning on generating a 24MHz clock using one of the USRT peripherals on the ATSAMD21, and having synchronization inside the CPLD to deal with the two clocks. The fast serial port does this, and it was a bit hairy to write, but works. The XC9500XL doesn't support dual edge FFs, but by triggering some FFs off the rising edge and some off the falling edge of a clock, you can sometimes fake it...
SW/EE from New Zealand, now in San Francisco: http://myelin.nz/
Having fun making hardware projects for the Electron!
So far: 32k flash cart, USB cart interface, 3-cart expansion, Elk PiTubeDirect. Later: Dual ported ram cart.

User avatar
myelin
Posts: 203
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Arduino Filestore

Postby myelin » Wed Nov 15, 2017 9:33 pm

gazzaD wrote:These are only considerations if you are using a real ADLC though. And having now discovered them, i am considering a step back to try bit banging the Econet bus from the Arduino via a LM319 / 75159 combo instead of using the Econet card. Although I'm a bit short of time for my various projects at the moment.

I was just thinking about this, and realized this might actually be quite feasible. I haven't looked at the the timing diagrams on the 68B54, but if they're compatible with SPI, you might be able to just configure the SPI port in slave mode, to send or receive 8 bits at a time. It should be possible to use DMA to keep the buffers full (or copy received data into a buffer), or if SPI doesn't work but you can trigger a DMA channel off the Econet clock, you might be able to use DMA to handle pretty much everything.

This is an exciting idea... if you can get a microcontroller speaking Econet without a ton of extra interface hardware, all sorts of interesting stuff might be possible :)
SW/EE from New Zealand, now in San Francisco: http://myelin.nz/
Having fun making hardware projects for the Electron!
So far: 32k flash cart, USB cart interface, 3-cart expansion, Elk PiTubeDirect. Later: Dual ported ram cart.

User avatar
flynnjs
Posts: 757
Joined: Tue Jul 06, 2010 9:33 pm

Re: Arduino Filestore

Postby flynnjs » Thu Nov 16, 2017 12:10 am

I don't know anything about the SPI unit on Atmels but the MCU I was using only transferred
multiples of 8-bits so external stuffing/unstuffing is required to make sure all frames in/out
of the SPI are so.
If you have the cycles to spare I'm sure you could do all this in an software every Econet
clock cycle.
The other tricky bit is storing a whole Econet frame to do a checksum. Most cheap MCUs
have very little RAM and an Econet frame is in theory unbound in length and in reality
usually less than 32k which still busts many smaller MCUs.

User avatar
myelin
Posts: 203
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Arduino Filestore

Postby myelin » Thu Nov 16, 2017 1:25 am

flynnjs wrote:I don't know anything about the SPI unit on Atmels but the MCU I was using only transferred
multiples of 8-bits so external stuffing/unstuffing is required to make sure all frames in/out
of the SPI are so.
If you have the cycles to spare I'm sure you could do all this in an software every Econet
clock cycle.
The other tricky bit is storing a whole Econet frame to do a checksum. Most cheap MCUs
have very little RAM and an Econet frame is in theory unbound in length and in reality
usually less than 32k which still busts many smaller MCUs.

Yeah, this approach would require lots of bit stuffing/unstuffing. My gut feeling is that would be less work for the processor than having to bit bang the whole thing, but I couldn't say for sure.

I haven't looked at the checksum algorithm, but they're usually possible to compute byte by byte, so you can calculate them as the data gets pushed onto the wire, without having to store the entire frame. Once again more work for the MCU, but anything modern should be able to handle it.
SW/EE from New Zealand, now in San Francisco: http://myelin.nz/
Having fun making hardware projects for the Electron!
So far: 32k flash cart, USB cart interface, 3-cart expansion, Elk PiTubeDirect. Later: Dual ported ram cart.

gazzaD
Posts: 20
Joined: Sun Jun 18, 2017 11:37 am

Re: Arduino Filestore

Postby gazzaD » Sun Dec 10, 2017 2:32 pm

Suppose it's time for a bit of an update, now I've had a chance to look at the code again:

Of the main file server function codes now only 1 (Save File) and 11 (Put Bytes) have not had any work done on them. I've also not implemented the user database yet, and so the login accepts any username, and consequently things like managing user details (password, URD, boot flags, privs, quotas, access control etc.) are also untouched code wise. But I can log in and open files on the Risc OS desktop, BBC B and Master, which means I'm most of the way there. Directory creation, traversal and object deletion is also working (other than access control), and I can create and write files - albeit one byte at a time with function 9.

Despite the long conversation above about what to do with attributes and load/exec addresses, I've come to the conclusion that ALL possible methods of storing them suck for different reasons! If you have file extensions (like NFS) then you have to be really careful you don't create test,fff test,aff and a folder called test at once, which would be legal on the Fat filesystem but causes major confusion for the client. Having the info in a separate file means you not only have to keep it in sync, but then hide that file from the client and put protection in place to stop it being accessed or overwritten by the client. Ideally I'd keep them with the file somehow, but I've not managed to scavenge enough bits in the FAT directory structure just yet - but I'm still working on it. At the moment the code quietly discards changes to object attributes, and generates a set using a data filetype and the last modified date when they are requested.

I'm probably not going to get much opportunity to touch the code again before Christmas, but during the Christmas break I'm hoping to get the fileserver code to a 'functionally complete' stage when it can be released, and then start work on some slightly more exciting things - like a HTTP gateway.
Gareth

gazzaD
Posts: 20
Joined: Sun Jun 18, 2017 11:37 am

Re: Arduino Filestore

Postby gazzaD » Sun Dec 10, 2017 2:35 pm

And apologies to anyone who has PMed me about this, I'm not able to send replies at the moment.
Gareth

User avatar
sydney
Posts: 1987
Joined: Wed May 18, 2005 9:09 am
Location: Newcastle upon Tyne

Re: Arduino Filestore

Postby sydney » Sun Dec 10, 2017 4:02 pm

gazzaD wrote:And apologies to anyone who has PMed me about this, I'm not able to send replies at the moment.


You can now!


Return to “hardware”

Who is online

Users browsing this forum: BigEd, pbw72 and 4 guests