techtravels.org

reworking my uart

Well I rewrote my recv and send uart, and with the help of my logic analyzer, I’ve tuned them up pretty good.

I’m getting some transfer errors, somehow, and I think its related to buffer size.

I read a disk in 2:26, which is my fastest time to date.  If I can get rid of these errors, it will be much much faster.

keith

Amateur Electronics Design Engineer and Hacker

3 comments

  • I’ve got reads happening at 1:19 per disk.

    I added a PurgeComm() function just prior to any reads to flush the buffer.

    While I think this is a reasonable time to read a whole disk, I can’t help but wonder where the rest of the time is going to.

    Here’s the breakdown:

    79 seconds total
    ————–

    42 seconds to read the disk
    + 13 seconds total transfer time
    —-
    55 seconds should be the total, but stepping, communication with the SX, etc is taking another 24 seconds. An extra 150ms of time per track.

    Where’s this time going?

  • Perhaps Amiga’s floppy DMA is a bit faster than your UART code (speaking at 230400 bps right?)
    Again, how long exactly do you wait after stepping, and also between changing disk sides?

  • Nope, I’m at 2mbps again!! That’s how I was able to achieve much faster results. I guess I didn’t mention that. 🙂

    I rewrote the UARTs, and they are much more reliable now.

    I really don’t wait on switching sides…. After stepping, I wait 5ms. It’s always forward stepping for now.

    While I might not be waiting, there is SOME additional time for commands to be read in, to be processed, to return to the main loop, for a function to be called, for another command to be issued, and so on. And remember this is on a multitasking machine, which means my process doesn’t get 100% attention from the CPU, etc.

    Hrrmmm.. Maybe I should force a small delay on switching sides……….but it *is* in fact working, so I guess I’m not violating the specs too much.

    The amiga has an advantage because its being used AS it’s being read. My operations don’t happen simultaneously. First I read and store, and then I transfer. I’m not reading and transferring each track at the same time. Honestly though, 13 seconds of total transfer time across the whole disk is negligible.

    I’m actually pretty satisfied with 1:16 per disk. A “perfect” score is 55 seconds, so I’m only 21 seconds off…….. I’m still going to look to optimize, but there are bigger fish to fry…..

    I’m just not sure which ones yet.