This video shows my custom serial file transfer protocol for my homebrew computer. The PC acts as the host and can send a file to the homebrew which saves it according to name and folder path.
I made a custom protocol to keep things simple and optimise for the set up I have - 19200 bps, with the homebrew having a dedicated 256 byte buffer in RAM.
I made a block protocol which is less than 256 bytes per block so it fits in the homebrew serial buffer. The great thing then is that the homebrew can copy from the serial buffer to other memory to write the bytes to the filesystem whilst in parallel the PC can send another block of data which is held in the serial buffer by using interrupts.
I wrote a dflat and machine code monitor version of the received side (on the homebrew). It's interesting to see that I got around 776 bytes/s using dflat but using machine code routines I am up to 1300 bytes/s.
So I can transfer and save a 16KB file in around 12 seconds - not too bad!
I don't think I can go much faster than this as the bottleneck is writing to the SD card.
But this helps me a lot as I am able to create programs and assets on the PC then quickly upload to the homebrew.
16 сен 2024