Reading a floppy disk manually

Status
Not open for further replies.

mstechca

New Member
For all of you who just adore (and only adore) Windows XP, start laughing at me, because I am going old school style.

What I want to do is be able to actually read any byte I want from a floppy disk. I am using a standard 3 1/2 inch floppy disk drive to help me out.

The problem is that everything I have done so far has lead to failure.

I even tried connecting the output pins to the LED's and the only output pin that seems to work is the write-protect detection pin.

When I plug the floppy drive into the computer, it works normally.

I have searched several websites, and there is not one single website explaining the details on how to manually read a single byte from a floppy disk!

Why do I want to do this? Because it is SAFER, and the risks are somewhat lower.

I want to eventually take raw data from a floppy disk, (from bit 0 to the end) and program a microcontroller from it.

Also, I want to program some bios chips and hopefully get my old bios working again.

I just picked up another motherboard, and I am using it now as part of my computer. The only two drawbacks are loss of speed, and no CD-ROM booting.
 
What do you mean by manually read a single byte?

Are you looking for software to do that for you, trying to write software on the PC that'll do that, using a uC connected to the drive? Your post is not clear on what you are trying to achieve..
 
mstechca said:
For all of you who just adore (and only adore) Windows XP, start laughing at me, because I am going old school style.

It's not 'old school' it's more 'pre-school' :lol:

What I want to do is be able to actually read any byte I want from a floppy disk. I am using a standard 3 1/2 inch floppy disk drive to help me out.

The problem is that everything I have done so far has lead to failure.

As you don't have the faintest idea how disk drives work, why do you find this suprising?.

I even tried connecting the output pins to the LED's and the only output pin that seems to work is the write-protect detection pin.

You need a 'floppy disk controller', these used to be available (30+ years ago?) as a chip set, to connect between the drive and your micro-processor. For many years now they have been part of the large chipsets on PC motherboards.

BTW, a poster on my wall (of my first computer system), shows a picture of the floppy disk controller (which I never had, too expensive!), it has 23 IC's on the board!.

When I plug the floppy drive into the computer, it works normally.

I have searched several websites, and there is not one single website explaining the details on how to manually read a single byte from a floppy disk!

That's because it's not possible! - you can't read a single byte from a floppy drive (or a hard drive or CD-ROM either). The minimum amount you can read is a sector, which varies depending on the size of the drive, large drives have large sector sizes!.

If you do a web search you can find IDE interface details for connecting CD-ROM's to PIC's (and other micro-controllers), but an IDE interface has most of the controller circuitry on the drive, so the external interface components are minimal.

There was a long thread on the PICList years ago about trying to use a floppy with a PIC, as far as I know no one managed it? - an obvious snag is the lack of RAM, as you need to store at least a single sector.
 
IF you were in linux I would suggest "dd" and make a copy of the floppy (byte-wise) and then edit that

OR just go "vim /dev/fd0"

however, since you seem to be a windows user, I suggest
http://www.hexworkshop.com/

I used this back in 95days when I had to learn abt harddrives and the VFAT filesystem. I started with floppies and then carried on from that.
 
As Nigel stated, you cannot read/write just a byte. But only in sectors (for a floppy with VFAT that is 512 bytes)

However, with a sector loaded you can then manipulate the byte you want and write that sector back
 
However, reading your post a bit more..

You want to interface directly with the floppy. IT is possible, just goto a floppy drive manufacturer and they should have the pin-outs as well as access times
 
mstechca said:
Why do I want to do this? Because it is SAFER, and the risks are somewhat lower.
Your motivations are somewhat weird. Why is a floppy disk reader safer? Anyway, I've interfaced MMC cards before. I believe CF interface has also been achieved before, but obtaining a CF socket may be somewhat tricky. I've even implemented the FAT on the MMC. Works fine and "safe". These cards pack many times the size capacity of the humble floppy, are fungus resistant, compact-sized, non-mechanical ...
Next, isnt it much simpler to make a less fancy serial/parallel programmer?
 
Yes, reading compactflash or Secure digital cards with a pic (or any µC) is easy...

Compactflash is the most easy and doesnt require extra memory (like Nigel said , you need to read 1 sector at a time wich is 512 bytes for CF, but the CF card has a 512byte buffer built in) - it does however require a whole lot of µC pins.

SD is a little harder and you need your own 512byte buffer memory (I²C ram would do nicely, or a µC with enough ram to spare), but since it's serial it only requires few pins...

And face it, a memory card slot on your project is a lot better looking then ickky disk drive :lol:

There's lots of info on the net 'bout CF & SD interfacing.
I would also like to add that a memory card is safer then a diskdrive...
I haven't had any data failures on a memory card yet, but my pile of defective diskettes is getting larger all the time...
 

After making a programmer with using a parallel port, I have in the process damaged one parallel port on my old motherboard (which is now trashed). Using removable storage and transferring it to my programmer is IMO a safer approach because then I don't risk damaging another port.

The only other options I have is to interface my own programmer with a CD-ROM drive, or a hard drive. I prefer using the floppy drive because there are only 34 pins to deal with, and from what I have learned, 1/2 of them are grounded.
 
You want to design an interface so that you can connect your microcontrollers to a floppy drive for the purposes of programming them???

I really can't understand why anyone would dream of doing such a thing. You're going to need to design your own file system, and write some firmware to support it. Once you've done that you're going to need to write some software which will take the data you've obtained from your floppy drive and program your required microcontroller with it using the required protocol for that particular microcontroller. If you then decide you want to program a different type of microcontroller, you're going to need to re-write part of your software to support it and you're going to need to do this EVERY time you decide that you want to work with something different. Then you're going to need to build a dedicated system which permanently interfaces to the floppy drive, and a suitable output interface for connecting to the desired microcontroller. This interface would also have to be adapted each time you chose a different type of microcontroller to work with.

Even assuming you're willing to do all that work, and you're capable of doing it, I still don't see how you're the slightest bit better off. Especially since floppy disks are a highly unreliable way to store information. If you've been damaging parallel ports using parallel programmers, you've been doing something wrong.

Hmmm

Brian
 
mstechca said:
After making a programmer with using a parallel port, I have in the process damaged one parallel port on my old motherboard (which is now trashed).

If you've damaged the parallel port it's because you've done something stupid! - from your previous posts when you did it, you did everything ABSOLUTELY STUPIDLY!

Just use a little common sense, respect what a parallel port is, and don't attempt your usual random connections!.

In the same vein, your floppy programmer idea is even more stupid!, there are numerous programmer designs out there, pick one and build it properly!.
 
You want to design an interface so that you can connect your microcontrollers to a floppy drive for the purposes of programming them???
Yes

I really can't understand why anyone would dream of doing such a thing.
Lower Risk taking, Code Portability, Selective programming, etc. :wink:

You're going to need to design your own file system, and write some firmware to support it.
That is easy. I will use DOS interrupts or access the disk by port address and write byte-by-byte.

Once you've done that you're going to need to write some software which will take the data you've obtained from your floppy drive and program your required microcontroller with it using the required protocol for that particular microcontroller.
In this case, I doubt I will need software, because if I just program raw data, sequentially, I think I can get away with a shift register, and a counter. The counter can then terminate disk reading when a set amount of bytes have been read.

If you then decide you want to program a different type of microcontroller, you're going to need to re-write part of your software to support it and you're going to need to do this EVERY time you decide that you want to work with something different.
I'm only using one kind of microcontroller now, so this won't apply to me.

Then you're going to need to build a dedicated system which permanently interfaces to the floppy drive, and a suitable output interface for connecting to the desired microcontroller.
This is the part I need help figuring out. That's why I wanted to know how to read a bit from the disk.

Even assuming you're willing to do all that work, and you're capable of doing it, I still don't see how you're the slightest bit better off. Especially since floppy disks are a highly unreliable way to store information.
I would find it more insane, bulky, and time consuming to create a CD just for 2K of information.

If you've been damaging parallel ports using parallel programmers, you've been doing something wrong.
The programmers I dealt with were all made by myself. Incidentally, one programmer worked nicely, but lacked some functions.
 
Anyway, the main issue is that you have weird notions of "better" that the majority of us feels quite unacceptable, or just a waste of time.
 

We've told you about the risks before. If you use everything like it's supposed to nothing will get damaged. I've been using the same programmer on the same pc for 3 years now...

Code portability normally stands for the ability of code to be ported to another system, but i'll assume you mean actual fysical portability. Like many have said above, there are far easyer, smaller, more reliable systems available then the disk drive, wich belongs only in a museum these days...

selective programming :?:


What target microcontroller are you intending to program using this method? And what system will it be based upon ?
Since you mention dos i'm guessing it's a x86 based system that'll read the drive and program the microcontroller. In this case you're back to square one, using a PC.

Do you even read other ppl's posts?
other systems were already given to you, memory cards, bootloaders, the lot, all better then a disk drive... and certainly far easyer, in case you still dont get it - a diskdrive is HARD to interface...


Perhaps it would be easyer to add functions to that design in stead of persuing something completely sensless...
 
Exo said:
We've told you about the risks before. If you use everything like it's supposed to nothing will get damaged. I've been using the same programmer on the same pc for 3 years now...

Only 3 years? :lol:

I first wrote PicProg under DOS, then ported it to become the worlds first Windows PIC Programmer under Windows 3.1 (before Win95 came out, and while MicroChip were still all DOS), at this time I still did my email via DOS, and only used Windows occasionally for browsing web sites, the web and HTML was still pretty rare back then!.

In all my years of parallel port PIC programmer design I've NEVER damaged a port - a little common sense, and understanding of what you're doing is all it takes.

But you've got to admire mstechca's enthusiasm?, anyone who hopes to program micro-controllers directly from a floppy drive (using just simple hardware) deserves an award for creative thought! - once he's got it working I'll present it personally :lol:
 
Just for laughs. I highly doubt you used the same PC back then and now do you?
 
"selective programming" means choosing a program from the disk and programming the microcontroller with it.

Here is an example of how my disk will be set-up for chip programming:

[start bit]
[data]
[stop bit]
[start bit]
[data]
[stop bit]
[start bit]
[data]
[stop bit]
...
etc etc.

And what I want to do is create the floppy disk on a normal PC, and write it sector-by-sector. The easiest way to do this is to use Norton's DISKEDIT. Once I have done that, I will take it out of the PC and put it in my future microcontroller interface, and then I want to be able to send the data from the disk to the microcontroller.

Next, what has code portability got to do with it.

If I make several programs on a disk and decide 1 month later to use it, I don't have to turn on the computer just to program the chip. Instead, I will use the disk to load the microcontroller with the data.
 
Oops. I'm a slave to my PC. I switch it on everyday, and wouldn't mind switching it on everytime I need to do some programming. I also find it way more convenient to store and retrieve my program flashes on the hdd rather than on floppies.
But besides the rather "tedious" process of switching on the PC and connecting a working programmer, isn't it just as big a hassle to take out your programmer, connect power and insert the floppy?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…