[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No Slot Clock - Damaged?
Gus Vilomar <gvilomar@bellsouth.net> wrote:
> I thought the battery was dead on the chip but it actually had corrupted
> data. David sent me some code he wrote in a few minutes that actually
> resets the clock on the chip. It worked perfectly!! I'll list the code
> below but if anybody needs the "bin" file, let me know and I'll be happy to
> email it to them.
>
> thanks,
> Gus
>
> FROM DAVID EMPSON:
>
> CALL-151
> 300:A2 00 78 2C 04 E0 BD 30 03 A0 08 4A B0 08 2C 00
> 310:E0 88 D0 F7 F0 06 2C 01 E0 88 D0 EF E8 E0 10 90
> 320:E5 58 60
> 330:C5 3A A3 5C C5 3A A3 5C 00 00 00 00 16 01 10 99
> 300G
> BSAVE FIXWATCH,A$300,L$40
>
> As you are on a IIc+, I'd strongly suggest disabling the accelerator
> before trying this.
>
> (I'm assuming the SmartWatch is installed under the CF ROM on the
> motherboard. I don't think it can go anywhere else.)
I'm glad to hear that I was able to help Gus.
Note that for this to work in a IIe, the SmartWatch must be under the EF
ROM, not the CD ROM. (The program would have to be patched to refer to
D000, D001 and D004 if the SmartWatch is under the CD ROM.)
In case anyone is interested, here is a source listing of the program
(which may need a little tidying up to actually work, e.g. by removing
the spaces in the HEX line). This is for the Merlin assembler.
* SmartWatch I/O lines are as follows:
* A2 = read/-write
* A0 = data to SmartWatch
* D0 = data from SmartWatch
* The following locations trigger the desired one-bit access,
* assuming the SmartWatch is under the chip addressed when
* accessing the range E000-E00F.
* Read E000: write a zero
* Read E001: write a one
* Read E004: read (data returned in bit 0)
ORG $300
LDX #0
SEI
BIT E004
BYTELOOP: LDA DATA,X
LDY #8
BITLOOP: LSR
BCS WRITE1
BIT E000
DEY
BNE BITLOOP
BEQ NEXTBYTE
WRITE1: BIT E001
DEY
BNE BITLOOP
NEXTBYTE: INX
CPX #16
BCC BYTELOOP
CLI
RTS
ORG $330
DATA: HEX C5 3A A3 5C C5 3A A3 5C
HEX 00 00 00 00 16 01 10 99
A final point: this program can easily be modified to set the SmartWatch
to an arbitrary date and time. The last eight bytes are the time
written to the chip, which are in BCD (binary coded decimal). The
registers are in the following order:
Tenths and hundredths of seconds
Seconds
Minutes
Hours (leave the top three bits clear for 24-hour mode)
Day of week (1 = Sunday, 7 = Saturday, make sure the high digit is 1)
Day of month
Month
Year (2 digits)
Note that the day of week values are a convention only. The No Slot
Clock driver might assign a different day of the week as 1.
The OSC and RST bits are in the day register. Using a value of 1 in the
high order digit of the day register ensures that OSC is 0 (enabled) and
RST is 1 (disabled).
The SmartWatch also supports 12-hour mode, with an AM/PM indicator in
the hour register, but that wouldn't be compatible with the No Slot
Clock driver.
--
David Empson
dempson@actrix.gen.nz
Snail mail: P O Box 27-103, Wellington, New Zealand