Is there an easy and more "accurate" way of turning the LED on and off instead of something like:
open1,8,0,"$"
(wait a moment)
close1
?
I've seen demos even dim the led so it must be possible. The question is how? And if it's easy enough.
controlling the disk drive LED?
Moderator: Moderators
controlling the disk drive LED?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Re: controlling the diks drive LED?
And would it work on an SD2IEC as well?
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Re: controlling the disk drive LED?
Do M-W to $1c00 to control the LED, bit 3 IIRC. No, it won't work without proper 6502/6522 emulation unless there is specific code for it in the firmware.
ETA: Better to read the old value first to not change other bits
ETA: Better to read the old value first to not change other bits
Re: controlling the disk drive LED?
Thanks! And that would be $1c00 in the 1541's memory I reckon? I have no idea how to change memory inside of the disk drive.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
- Mike
- Herr VC
- Posts: 4834
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: controlling the disk drive LED?
You'd use the M-R and M-W commands on the, duh, command channel of the drive to read and write drive memory. With M-E, you can execute code on the drive. The VIA chips of the 1541 are located at $1800 and $1C00 in the address room of the drive CPU. Bit 3 (value 8) of $1C00 controls the drive LED.
- Even with cautious use of AND/OR masking with M-R, M-W, you wouldn't have complete control over the drive LED, as the DOS still does its own business,
- It doesn't work with the 1581, as the I/O chips are located at another address,
- It doesn't work with SD2IEC devices neither, as those don't emulate the CPU nor the VIA chips, and their drive LED is controlled by the Atmel firmware. The M-R and M-W commands are only there to 'trick' fastloaders into doing their job, giving the sd2iec firmware a way to check whether certain fastloaders are being deployed into the drive - and then replicate their protocol within the firmware.
In short, your first two posts made conflicting requirements, and TNT's answer didn't anything to resolve them.
- Even with cautious use of AND/OR masking with M-R, M-W, you wouldn't have complete control over the drive LED, as the DOS still does its own business,
- It doesn't work with the 1581, as the I/O chips are located at another address,
- It doesn't work with SD2IEC devices neither, as those don't emulate the CPU nor the VIA chips, and their drive LED is controlled by the Atmel firmware. The M-R and M-W commands are only there to 'trick' fastloaders into doing their job, giving the sd2iec firmware a way to check whether certain fastloaders are being deployed into the drive - and then replicate their protocol within the firmware.
In short, your first two posts made conflicting requirements, and TNT's answer didn't anything to resolve them.
This is done with PWM (pulse width modulation), by code executed in the drive.I've seen demos even dim the led so it must be possible. The question is how?
Re: controlling the disk drive LED?
Ah, thanks.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Re: controlling the disk drive LED?
Oh yeah, busy loop's stupid tendency to force LED state based on whether there's job in queue or not... However, you can use that feature to blink the LED yourself
If I was you, I would allocate buffer 0 ($0300-$03ff) before overwriting it...
Code: Select all
10 open15,8,15:print#15,"m-w"chr$(0)chr$(3)chr$(1)chr$(96)
20 print#15,"m-w"chr$(0)chr$(0)chr$(1)chr$(208)
30 print#15,"m-w"chr$(0)chr$(0)chr$(1)chr$(1)
40 goto20