climatex / MegaFDC

Arduino floppy disk controller interface.
12 stars 0 forks source link

mb8877 ??? #1

Closed gilmod714 closed 6 months ago

gilmod714 commented 6 months ago

Hello Jozef,

Could you please help me adapt this to a different FDC chip mb8877? data-separater(wd9216) and (7406) inv-buffer? .. I'm trying to adapt this project to my 8bit-computer and see if that'll work .. yes, I know this is NOT a one-chip solution like yours, but these are the chips I already have in my pile .. and also, I can't get the specific chip(s) you have in your design .. (too expensive to mail-order from where I live) .. Thank you!

Schematic_FC05-ARDUINO_2024-05-21

.. I have also added 4Mhz PWM on pin11 of the MEGA (simulating the Z80 bus freq for now) to feed into 8877 & 9216 in "main.cpp" , but still need more code-tweaks for MOTOR & SSEL and also for (A0,A1) instead of 3 address lines ..

//MAIN.CPP // MegaFDC (c) 2023 J. Bogin, http://boginjr.com // Entry point

include "config.h"

// user interface Ui* ui = NULL;

// floppy disk controller FDC* fdc = NULL;

// 4Mhz pwm const int freqOutputPin = 11; // OC1A output pin (Arduino Mega2560) const int ocr1aval = 1; //0,1,3,7 --- 0=8mhz, 1=4mhz, 3=2mhz , 7=1mhz

void setup() { // 4Mhz pwm pinMode(freqOutputPin, OUTPUT); TCCR1A = ( (1 << COM1A0)); TCCR1B = ((1 << WGM12) | (1 << CS10)); TIMSK1 = 0; OCR1A = ocr1aval;

//org ui = Ui::get(); fdc = FDC::get(); InitializeDrives(); }

void loop() { ProcessCommands(); }

climatex commented 6 months ago

I'm afraid you won't be able to even utilize the data communication routines of MegaFDC. The MB8877 does not follow the NEC uPD765 (PC-compatible FDC) commands syntax which MegaFDC is reliant on, so it's not a simple matter of adapting the circuit. Your best bet here is to start from scratch, or fork the project and rewrite all fdc.cpp routines to fit. If you have old ISA PC cards you can sometimes salvage PC floppy controller chips off them as I did, there's no need to mail order anything.

gilmod714 commented 6 months ago

ok , I kinda hoped it would be an easy task to do, but I was unaware of the major differences between the two controller chips and the major code-rewrite required. Thx Jozef