|
|
Re: CB030 Compact flash (mostly a SW ?) [message #9266 is a reply to message #9264] |
Wed, 20 October 2021 22:50   |
curbie
Messages: 55 Registered: June 2021
|
Member |
|
|
Bill,
Don't worry about the delay, I know you're busy and this is probably a stupid question, I just can't seem to relate some small lines of code the documentation and I hate loose ends, then the question becomes, am I using the correct documentation, or am I missing something.
This code that is perplexing me, comes from "CBBIOS", located under the "init1:" routine six lines down:
move.b #$E0,CF2427 * set Logical Address addressing mode
move.b #1,CFerr * set feature register to 8-bit interface
move.b #$EF,CFstat *set feature command
bsr readbsy
move.b #$40,CF2427 * set Logical Address addressing mode
my issue is I can't find the documentation of #$E0 to CF2427. #1 to Cferr or #$40 to CF2427, I assume sending $E0 and $40 to CF2427 don't both "set Logical Address addressing mode" and is just some legacy commenting but without the proper documentation, I'm having trouble following this.
I'll look for the "AT Attachment for Disk Drives ANSI X3.221-199x" spec tomorrow, to see if it will clear thing up for me.
Thanks.
Curbie
|
|
|
Re: CB030 Compact flash (mostly a SW ?) [message #9271 is a reply to message #9266] |
Thu, 21 October 2021 06:10   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Curbie,
Well, it is good you are going over my code. You've found a bug (one of many, I'm sure); the "move.b #$40,CF2427" is redundant. It doesn't do anything since LBA mode is already enabled 4 lines prior.
The section numbers are referring to sections in "CF+ and CompactFlash Specification Revision 3.0"
First line is change the addressing mode of CF disk, see section 6.1.5.7. The default is cylinder/head/sector mode, by writing 0xE0 to drive/head register, it is now Logical Block Address mode.
Second and third lines are the "Set Feature" command, see section 6.2.1.29. By writing to feature register with 0x1, and issue "set feature" (0xEF) command to command register, the CF data bus is now 8-bit wide.
5th line is redundant and should be removed.
Bill
|
|
|
Re: CB030 Compact flash (mostly a SW ?) [message #9272 is a reply to message #9271] |
Thu, 21 October 2021 09:12  |
curbie
Messages: 55 Registered: June 2021
|
Member |
|
|
Bill,
The code runs fine with no "bug" related glitches that I'm aware of, I don't view what I've found as "bugs", just "turds" that annoy when you step on them as you walk through the code, I'm just crazy and experience dictates that I need to be sure I thoroughly understand the purpose of every line.
Curbie
|
|
|