kbr-net / sdrive-max

Arduino based Atari 8-bit Floppy Emulator with Touchscreen
http://www.kbrnet.de/projekte/sdrive-max/index.html
GNU General Public License v3.0
95 stars 22 forks source link

Missing Motor-ON line for tape emulation #33

Open TzOk83 opened 4 years ago

TzOk83 commented 4 years ago

There is no control over the emulated tape drive motor, so it doesn't stop when it should.

kbr-net commented 4 years ago

There is no free port for the motor signal...

TzOk83 commented 4 years ago

The Command line is not used in Tape Emulation mode, nor Motor ON line is used in Floppy Emulation mode, maybe it would be possible to use same pin (A5) for both purposes, only with a diode separation?

kbr-net commented 4 years ago

This would be quite not so easy, because COMMAND is active low, and MOTOR is active high!

TzOk83 commented 4 years ago

It would be a little tricky, but not impossible. Motor On is open collector, but it is Hi-Z when inactive, and Vcc when active, so it requires a pull-down. Command is driven directly by PIA, but has pull-up resistor, so it is also open-collector output. This time with "hard" ground, and "soft" Vcc. It has a 100 Ohm series resistor (making it short circuit resistant). Unfortunately ATMega 328P has only switchable pull-up resistors.

kbr-net commented 4 years ago

But not without extra circuit. I'm not sure, if it is worth, because the tape emu is just a gimmick for me, once i had fun to make this :) And because of low on free flash, maybe i will remove it sometime...

TzOk83 commented 4 years ago

Actually pin D10 seems to be obsolete, there is only one SPI device (SD card) on the system, so ~SS could be hard wired to GND, and D10 freed for another (Motor On) use.

Also A4 pin is not really required.

Tape emulation is a very unique feature of SDrive MAX and removing it would be a sad news.

There are SPI equipped LCD screens, and as you already use the SPI for SD card, these screens could be used with no additional programming cost. They use the same ILI9341 controller, just instead of parallel bus, they use SPI.

kbr-net commented 4 years ago

It is necessary to toggle chip select for the SD protocol.

I think, there is no way without hardware modification, so i won't do that.

SPI for the display would be very slow, so i also won't support this.

kbr-net commented 4 years ago

One more idea is to use a display data pin, because this pins are Z, if display is not in use. So we could connect MOTOR over a 1K resistor to one of them, and this should not hurt. The only thing, it could make trouble with the new touchscreen autodetection i am working right now, there i have to check all this pins for resistance...

TzOk83 commented 4 years ago

For touchscreen auto detection you can "inspire" by the TouchScreen_Calibr_Native.ino from MCUFRIEND_kbv library. This one works quite ok.

kbr-net commented 2 years ago

A new idea for this issue is to multiplex the COMMAND and MOTOR lines together, because they would never be used at the same time. Maybe...