Hello all, first time posting here. I have received a lot of good info here reading past posts. Now, I'm confused...
I am trying to build an old-time floppy disk controller for aligning drives, starting with eight inch Shugart SA-800s. I have the mechanics control all sorted out on both an Arduino Nano and a Teensy 4.1. I can even erase or write all zeros or all ones onto a track with both the Nano and 4.1, using analogWrite at either 250kHz of 500kHz on the 4.1.
What I need now is a way of controlling a "write" pin at a minimum of 2 or 4MHz rate (using interrupts?), and a "read" pin at the same rates, so I can control write or read pulses and their widths, depending on a zero or one data bit. I've looked at the timers, PWM, etc... but am confused by several posts regarding timer interrupts, latency, etc. For reading, I could also measure the time between data/clock bit edges, but that may be affected by any noise picked up.
I've been writing code (assembler or C) since the late 70s (8080 CP/M, PCs, Arduinos, BBB, etc...), but am slightly more of a hardware hacker.
Technically, for reading single sided disks (FM mode), there are 200ns width clock pulses every 8 microseconds, followed by a 200ns data pulse 4 microseconds later if data is a one or no data pulse if a zero. Writing to the floppy follows a similar pattern, with the data pulse width being wider, 500ns or so. Temporarily, I have a 74LS123 expanding the read pulses width to slightly over 500ns.
There were comments here that I've seen about issues with the T4 timers early on, and latency in reading input pins at a very fast rate (with interrupts?). I chose the Teensy 4, due to its fast clock, thinking I could do additional data processing between data acquisition interrupts, AND it has a LOT of RAM (potentially holding a full eight inch disk of image at 241kB). I have several Teensy 3.2, 3.5, 3.6, 4.0, and 4.1 available. I almost used a 3.5, as it's 5V tolerant on inputs. Therefore, I can change Teensy device easily.
Any ideas or recommendations on what I should look at to get sub-microsecond interrupts working, or other methods?
Thank you for any guidance!
Terry. N4TLF
I am trying to build an old-time floppy disk controller for aligning drives, starting with eight inch Shugart SA-800s. I have the mechanics control all sorted out on both an Arduino Nano and a Teensy 4.1. I can even erase or write all zeros or all ones onto a track with both the Nano and 4.1, using analogWrite at either 250kHz of 500kHz on the 4.1.
What I need now is a way of controlling a "write" pin at a minimum of 2 or 4MHz rate (using interrupts?), and a "read" pin at the same rates, so I can control write or read pulses and their widths, depending on a zero or one data bit. I've looked at the timers, PWM, etc... but am confused by several posts regarding timer interrupts, latency, etc. For reading, I could also measure the time between data/clock bit edges, but that may be affected by any noise picked up.
I've been writing code (assembler or C) since the late 70s (8080 CP/M, PCs, Arduinos, BBB, etc...), but am slightly more of a hardware hacker.
Technically, for reading single sided disks (FM mode), there are 200ns width clock pulses every 8 microseconds, followed by a 200ns data pulse 4 microseconds later if data is a one or no data pulse if a zero. Writing to the floppy follows a similar pattern, with the data pulse width being wider, 500ns or so. Temporarily, I have a 74LS123 expanding the read pulses width to slightly over 500ns.
There were comments here that I've seen about issues with the T4 timers early on, and latency in reading input pins at a very fast rate (with interrupts?). I chose the Teensy 4, due to its fast clock, thinking I could do additional data processing between data acquisition interrupts, AND it has a LOT of RAM (potentially holding a full eight inch disk of image at 241kB). I have several Teensy 3.2, 3.5, 3.6, 4.0, and 4.1 available. I almost used a 3.5, as it's 5V tolerant on inputs. Therefore, I can change Teensy device easily.
Any ideas or recommendations on what I should look at to get sub-microsecond interrupts working, or other methods?
Thank you for any guidance!
Terry. N4TLF