hmm, my ATN code is more like a frame: X_ATN_INIT before the first byte and >X_ATN_DEINIT after the last one. So it is sent as (LISTEN + address, >X_ATN_INIT) and (SECONDARY, X_ATN_DEINIT) so ATN won't go high between them.
Isn't this phase 4 of your diagram? It is there more than once...
send 0x29 (LISTEN + id)
send 0x29 (LISTEN + id)send LISTEN to drive 9 (should be ok if it is really drive 9)
0xff (OPEN + secondary channel 0x0f)send SECLISTEN: can you explain why you send $FF ? if you want to load
$FILENAME : ok.
0x3f (UNLISTEN)UNLISTEN: ok.
send 0x29 (LISTEN + id)send LISTEN to drive 9 (should be ok if it is really drive 9)
0xff (OPEN + secondary channel 0x0f)send SECLISTEN: can you explain why you send $FF ? if you want to load
the directory I would suggest you use $60 as secondary address.
$FILENAME : ok.
0x3f (UNLISTEN)UNLISTEN: ok.
so far so good :-) Go on like this:
send TALK
sen SECTALK
receive data until EOF
send UNTALK
CLOSE_FILE
I have started to explain the serial protocol at my website.
Maybe it will help you a little: http://www.bitcity.de/theory.htm
Kroko
@Kroko: After reviewing my line outputs, it seems all my line settings are upside-down since you write on your page that DATA high means device not present error (in my code it was DATA low). The bit setup looked correct (DATA high for bit set, DATA low for bit not set). Anyway I wonder why it seemed the 1541 accepted the bytes sent under ATN...
"Thomas Mller" <eous@gmx.de> schrieb im Newsbeitrag news:befikf$dru$1@newsreader2.netcologne.de...is
Thanks, I'll have a look at your page!
Btw, my 1581 is dev. 8 and the 1541 is dev. 9. It seems my send routine
pretty much screwed up, although I don't understand why it seemed towork...
I think my documentation isn't that good.
send 0x29 (LISTEN + id)send LISTEN to drive 9 (should be ok if it is really drive 9)
0xff (OPEN + secondary channel 0x0f)send SECLISTEN: can you explain why you send $FF ? if you want to load the directory I would suggest you use $60 as secondary address.
$FILENAME : ok.
0x3f (UNLISTEN)UNLISTEN: ok.
so far so good :-) Go on like this:
send TALK
sen SECTALK
receive data until EOF
send UNTALK
CLOSE_FILE
I have started to explain the serial protocol at my website.
Maybe it will help you a little: http://www.bitcity.de/theory.htm
Kroko
Now I remember where I got that with the lines high: it's described in the >COMPUTE! article by Jim Butterfield... he wrote both lines are initially
high
"Thomas Mller" <eous@gmx.de> schrieb im Newsbeitrag >news:beh221$8fg$1@newsreader2.netcologne.de...
@Kroko: After reviewing my line outputs, it seems all my line settings are >> upside-down since you write on your page that DATA high means device not
present error (in my code it was DATA low). The bit setup looked correct
(DATA high for bit set, DATA low for bit not set). Anyway I wonder why it
seemed the 1541 accepted the bytes sent under ATN...
"Thomas Mller" <eous@gmx.de> schrieb im Newsbeitrag
news:befikf$dru$1@newsreader2.netcologne.de...
Thanks, I'll have a look at your page!work...
Btw, my 1581 is dev. 8 and the 1541 is dev. 9. It seems my send routine >is
pretty much screwed up, although I don't understand why it seemed to
I think my documentation isn't that good.
send 0x29 (LISTEN + id)send LISTEN to drive 9 (should be ok if it is really drive 9)
0xff (OPEN + secondary channel 0x0f)send SECLISTEN: can you explain why you send $FF ? if you want to load >> > > the directory I would suggest you use $60 as secondary address.
$FILENAME : ok.
0x3f (UNLISTEN)UNLISTEN: ok.
so far so good :-) Go on like this:
send TALK
sen SECTALK
receive data until EOF
send UNTALK
CLOSE_FILE
I have started to explain the serial protocol at my website.
Maybe it will help you a little: http://www.bitcity.de/theory.htm
Kroko
Hi Thomas ...
well, at least the C64 is releasing the DATA line and then it
is testing, if DATA is low. A high DATA line at the beginning of the byte-transfer means, that there is nobody pulling it down. Thats why
the C64 thinks the device is not present.
Kroko
theNow I remember where I got that with the lines high: it's described in
COMPUTE! article by Jim Butterfield... he wrote both lines are initially >high
are"Thomas Mller" <eous@gmx.de> schrieb im Newsbeitrag >news:beh221$8fg$1@newsreader2.netcologne.de...
@Kroko: After reviewing my line outputs, it seems all my line settings
notupside-down since you write on your page that DATA high means device
correctpresent error (in my code it was DATA low). The bit setup looked
it(DATA high for bit set, DATA low for bit not set). Anyway I wonder why
routineseemed the 1541 accepted the bytes sent under ATN...
"Thomas Mller" <eous@gmx.de> schrieb im Newsbeitrag
news:befikf$dru$1@newsreader2.netcologne.de...
Thanks, I'll have a look at your page!
Btw, my 1581 is dev. 8 and the 1541 is dev. 9. It seems my send
loadis
pretty much screwed up, although I don't understand why it seemed towork...
I think my documentation isn't that good.
send 0x29 (LISTEN + id)send LISTEN to drive 9 (should be ok if it is really drive 9)
0xff (OPEN + secondary channel 0x0f)send SECLISTEN: can you explain why you send $FF ? if you want to
the directory I would suggest you use $60 as secondary address.
$FILENAME : ok.
0x3f (UNLISTEN)UNLISTEN: ok.
so far so good :-) Go on like this:
send TALK
sen SECTALK
receive data until EOF
send UNTALK
CLOSE_FILE
I have started to explain the serial protocol at my website.
Maybe it will help you a little: http://www.bitcity.de/theory.htm
Kroko
Ahhh, I just read the article by Jim Butterfield again and found this: "When no device puts a ground on a signal line, the voltage rises to almost five volts. We call this the 'false' logic condition of the wire. If any device grounds the line, the voltage drops to zero; we call this the 'true' condition of the line". So your explanation with HIGH and LOW means HIGH = false, LOW = true...
Yo Thomas!
That project sounds very interesting! Keep up working on it, I think a LOT
of people would be interested in a native Win32 application to transfer files!
Just one question: On which OS are you developing?
Best regards,
Stephan
Will this also work with XE1541 cable (the one with diodes) ?
TC
Hi Thomas,"When
Ahhh, I just read the article by Jim Butterfield again and found this:
fiveno device puts a ground on a signal line, the voltage rises to almost
devicevolts. We call this the 'false' logic condition of the wire. If any
=grounds the line, the voltage drops to zero; we call this the 'true' condition of the line". So your explanation with HIGH and LOW means HIGH
false, LOW = true...
Oh, this stuff is a major headache, isn't it? Without any electronical testing equipment and proper documentation, _I_ spent _days_ with experimenting to find out the meaning of 0/1, false/true and low/high
on the Commodore serial bus! 8-)
If I'm not mistaken, there are inverters on the serial bus so when you
put a 0 bit into the serial bus data register then that will result in
a high voltage on the wire. And, vice versa, a 1 bit is a low voltage.
This is, for sure, trivial for the hardware guys but not for me... ;-)
Joe Forster/STA
sta@c64.org
Hi Joe,--
I know what you mean. I really get confused by this TRUE/FALSE, 0/1,
high/low thing. After hours of work spent on the project, it feels like> being drunk... "Hey, wait, what was it with high/low..." - "Isn't high equal
to false?". I wouldn't wonder if the C64 kernal programmers were a bit mad nowadays :D
Thomas
"Joe Forster/STA" <sta@ludens.elte.hu> schrieb im Newsbeitrag news:O9ZijQc$LEXx@ludens...
Hi Thomas,
"WhenAhhh, I just read the article by Jim Butterfield again and found this:
fiveno device puts a ground on a signal line, the voltage rises to almost
devicevolts. We call this the 'false' logic condition of the wire. If any
=grounds the line, the voltage drops to zero; we call this the 'true' condition of the line". So your explanation with HIGH and LOW means HIGH
false, LOW = true...
Oh, this stuff is a major headache, isn't it? Without any electronical testing equipment and proper documentation, _I_ spent _days_ with experimenting to find out the meaning of 0/1, false/true and low/high> > on the Commodore serial bus! 8-)
If I'm not mistaken, there are inverters on the serial bus so when you
put a 0 bit into the serial bus data register then that will result in
a high voltage on the wire. And, vice versa, a 1 bit is a low voltage.
This is, for sure, trivial for the hardware guys but not for me... ;-)
Joe Forster/STA
sta@c64.org
If I'm not mistaken, there are inverters on the serial bus so when you
put a 0 bit into the serial bus data register then that will result in
a high voltage on the wire. And, vice versa, a 1 bit is a low voltage.
This is, for sure, trivial for the hardware guys but not for me... ;-)
If I'm not mistaken, there are inverters on the serial bus so when you
Yes, this is important if you examine code of the 1541 or the C64,
because they both use SN7406 inverter drivers. But if you are
setting the lines from windows, there are no inverters. It really
helps a lot to think in the real line voltages that are on the bus
cables. For the serial protocol, its often hard to say, what "active"
really means. The easiest thing is to just think in line voltages. So
HIGH = 5V and LO = 0V. In most articles, 0V is called "active"
because the serial bus is "active low".
This is not true, I think. The LPT parallel port does contain
inverters on _some_ lines. Check out the page:
Womo
This is not true, I think. The LPT parallel port does contain
inverters on _some_ lines. Check out the page:
Womo
ups ... you got me. I actually don't know anything about the
parallel port. It was just a guess :-)
Kroko.
This is not true, I think. The LPT parallel port does contain
inverters on _some_ lines. Check out the page:
ups ... you got me. I actually don't know anything about the
parallel port. It was just a guess :-)
well, I'm using the routines from cbm4linux for setting and releasing a
line, as I think they are well programmed. Every cable has a "inverter-mask" byte. So these lines which have to be inverted are inverted by this byte - I think that's easier (and maybe faster) than working with function variables.
They are not too hard to understand and work with only one line of code :).
Hi Thomas,"inverter-mask"
Thomas Mller wrote:
well, I'm using the routines from cbm4linux for setting and releasing a line, as I think they are well programmed. Every cable has a
byte - Ibyte. So these lines which have to be inverted are inverted by this
variables.think that's easier (and maybe faster) than working with function
That's true as long as you only use the XM1541 or XA1541 cable.:).
You don't need to swap or shift bits, since they both connect
the same port bits to a dedicated wire.
You would need extend this concept, if you want to add the
XE1541 and X1541 cables. But I'm sure now, that you don't
want to this, because it complicates programming and
especially the timing :-)
They are not too hard to understand and work with only one line of code
The Star Commander worked the same for many years, when
only the X1541 and XE1541 cables were supported. But when
the XM1541 was introduced, we (Joe of course) needed more
flexibility.
One question: Now that you mentioned, that you took parts
of cbm4linux. Are you going to use LPT port generated
interrupts with your programming concept to perhaps
circumvent timing problems and that may result in a rock
solid stable connection (same as with the concept of the
cbm4linux kernel driver)?
Womo
Hi guys,
Just two short notes:
1. I wouldn't be telling the truth if I said I know pretty much
everything about the parallel port. Actually, I still know pretty
much nothing about it but I _experimented_ enough to make the
shit work. So, don't worry about not understanding much... ;-)
2. If you ask me, you really shouldn't bother with supporting the
old X1541 cable. However, support for the XE1541 extended cable
_may_ be a good idea as, according to the statistics of my little
shop, this is by far the most favorite X1541-series serial cable.
Joe Forster/STA
sta@c64.org
Hi,
thank you for this one :).
Does the 1541 always accept data or only if a correct command was sent >before?
My get routine returns TRUE, if the line is low (0 V), for your interest.
2. If you ask me, you really shouldn't bother with supporting the
old X1541 cable. However, support for the XE1541 extended cable
_may_ be a good idea as, according to the statistics of my little
shop, this is by far the most favorite X1541-series serial cable.
I hope, I'm not getting on your nervesno, the serial bus is pure fun :-)
if (atn) <- if X_ATN_INIT is set
{
set (atn) <- pull down
set (clk)
release (data)
wait for 748 cycles
}
release (data) <- again, according to your description
wait for 22 cycles
check data, if it is high (= false) - if it is, -> no device
delay for 18 cycles
release clk
wait for 37 cycles
wait for floppy to release data
wait for 16 cycles
set clk
delay for 11 cycles
<send 8 bits>yes, but the timeout is only checked once before all 8 bits.
wait for 14 cycles
check, if data is low, if it is -> timeout
wait 23 cycles
if bit is set, set data
wait for 22 cycles
release clock (signal data valid)
wait 26 cycles
set clk
release data
delay 7 cycles
<send next bit, if there is any>
delay 30 cycles (the floppy needs at least 30 to respond)
wait 1 ms max. for data to get low
if data is still high -> no ack error
if (atn) <- X_ATN_DEINIT is set
{
release atn (pull it high)
}
delay 200 ms (between-bytes-time)
return
This is what the routine looks like. Before I modified it, it seemed, the >ATN-low bytes were all accepted. Now I modified it to be more "kernal-like", >now it doesn't work at all :-/
It's cruel to work on this for days and still nothing happens :-(
if (atn) <- if X_ATN_INIT is set
{
set (atn) <- pull down
set (clk)
release (data)
wait for 748 cycles
}
sounds good, but you also have to do this, when X_ATN_DEINIT
is set, because this is also a byte under ATN. I don't know your code,
but make sure you call this in both cases.
<send 8 bits>yes, but the timeout is only checked once before all 8 bits.
wait for 14 cycles
check, if data is low, if it is -> timeout
wait 23 cycles
if bit is set, set data
wait for 22 cycles
release clock (signal data valid)
wait 26 cycles
set clk
release data
delay 7 cycles
<send next bit, if there is any>
hmm, my ATN code is more like a frame: X_ATN_INIT before the first
byte and X_ATN_DEINIT after the last one. So it is sent as (LISTEN + >>address, X_ATN_INIT) and (SECONDARY, X_ATN_DEINIT) so ATN won't go
high between them.
its not only ATN, it is
set (atn)
set (clk)
release (data)
wait for 748 cycles
that has to be done before each byte under ATN. So
keeping ATN at 0V is not enough you have to run into
this "if satement" twice.
Kroko.
There's a major bug in my routines and I can't find it... :/
for (a = 0; a < 8; a++)
{
if (!((data >> a) & 0x1)) this->set(X_DATA);
}
for (a = 0; a < 8; a++)
{
if (!((data >> a) & 0x1)) this->set(X_DATA);
}
Can you post the complete byte send routine ?
Maybe I can see someting. Please post the original code,
no the "pseudo code".
Kroko.
if (bit_set(flags, X_ATN_INIT))
One more thing ....Do you still send $FF with seclisten ?
Can you try what happens if you send $F0. As far as I know
you should use secondary address 0 for a load command.
sec adr 15 will access the command and error channel....
or is this what you want to do ?
Kroko.
I sent 0x60 till now (you told me to do so...).
Hi,
hmm, there was something to do to let a device talk, do you have any docs >(otherwise I could check out the C64 programmer's manual..)
Regards,
Thomas
On Wed, 16 Jul 2003 18:56:27 +0000 (UTC), "Thomas Mller"
<eous@gmx.de> wrote:
Hi,
hmm, there was something to do to let a device talk, do you have any
docs (otherwise I could check out the C64 programmer's manual..)
Regards,
Thomas
I am not sure if i understand your question, but TALK works almost
exactly like LISTEN.
you have to send TALK and SECTALK. After the drive accepted
SECTALK, it will send the directory to you. It will signal the last
byte with EOI. This should be on my page ....
If you have any feedback for me, where the description on my page
is misleading or difficult to understand, please tell me and i will
try to change it.
Kroko.
It does not work unchanged. If you want a device to talk, you have to complete SECLISTEN
It does not work unchanged. If you want a device to talk, you have to >complete SECLISTEN with
set DATA
release ATN
wait 30 us
release CLK
Sysop: | Gate Keeper |
---|---|
Location: | Shelby, NC |
Users: | 764 |
Nodes: | 20 (0 / 20) |
Uptime: | 40:51:43 |
Calls: | 11,275 |
Calls today: | 1 |
Files: | 5,288 |
D/L today: |
81 files (10,064K bytes) |
Messages: | 521,283 |