Add AT28, as a companion to AT28!

This word, suitable to plug to A, , increases HERE before doing its
verification to minimize waiting time: While we increase HERE, the
AT28 has the time to do its programming, and thus we'll need to idle
for less time afterwards.

Also, made the mismatch check silently ignore MSB. Previously, writing
a value larger than 0xff with AT28! would always result in a mismatch.
This commit is contained in:
Virgil Dupras 2020-12-07 12:28:48 -05:00
parent 1e8f957910
commit 06b71a6906

10
blk.fs
View File

@ -2204,11 +2204,10 @@ XCURRENT @ _xapply ORG @ 0x04 ( stable ABI BOOT ) + !
':' X' _ 4 - C! ( give : its name ) ':' X' _ 4 - C! ( give : its name )
'(' X' _ 4 - C! '(' X' _ 4 - C!
( ----- 400 ) ( ----- 400 )
( With dst being assumed to be an AT28 EEPROM, perform ! ( With dst being assumed to be an AT28 EEPROM, perform C!
operation while doing the right thing. Checks data integrity operation while doing the right thing. Checks data integrity
and ABORT on mismatch. ) and ABORT on mismatch. )
: AT28! ( n a -- ) : _ ( n a -- wait until addr is "stable", err on mismatch )
2DUP C!
( as long as writing operation is running, IO/6 will toggle ( as long as writing operation is running, IO/6 will toggle
at each read attempt. We know that write is finished when at each read attempt. We know that write is finished when
we read the same value twice. ) we read the same value twice. )
@ -2217,8 +2216,9 @@ XCURRENT @ _xapply ORG @ 0x04 ( stable ABI BOOT ) + !
OVER C@ ( n1 a n2 n3 ) OVER C@ ( n1 a n2 n3 )
= UNTIL = UNTIL
( We're finished writing. do we have a mismatch? ) ( We're finished writing. do we have a mismatch? )
C@ = NOT IF ABORT" mismatch" THEN C@ SWAP 0xff AND = NOT IF ABORT" mismatch" THEN ;
; : AT28! ( n a -- ) 2DUP C! _ ;
: AT28, ( n -- ) H@ 2DUP C! DUP 1+ HERE ! _ ;
( ----- 401 ) ( ----- 401 )
Grid subsystem Grid subsystem