author: bocianu bocianu@gmail.com
Set of procedures to erase and write data onto MaxFlash 1Mbit cartridge.
Based on Steven Tucker's routines, placed into the public domain.
Now it works only with Am29F040 (or compatibile) modules, with sector size of 64K, but in future it might get extended for another chips.
Be notified that during erase and write operations all nonmaskable interrupts are disabled, so be careful, and enble them after, if they are needed.
This library is a part of 'blibs' - set of custom Mad-Pascal libraries.
https://gitlab.com/bocianu/blibs
name: | value: | description: |
---|---|---|
MF_ZPLOCATION | $D8 | starting location of reserved 4 bytes used by BurnPages routine |
name: | description: |
---|---|
SetBank | procedure SetBank(bank: byte);Switches cart to requested bank.
parameters: |
SetSector | procedure SetSector(sec: byte);Switches to first bank of specified sector.
parameters: |
EraseChip | procedure EraseChip;Erases whole Maxflash memory. |
EraseSector | procedure EraseSector(sec: byte);Erases specified sector (8 banks = 64KB) of Maxflash memory.
parameters: |
BurnByte | procedure BurnByte(bank:byte;addr:word;val:byte);Writes one byte into Maxflash memory:
parameters: |
BurnBlock | procedure BurnBlock(bank: byte; src, dest, size: word);Writes block of data from computer memory to Maxflash cart.
parameters: |
BurnPages | procedure BurnPages(sec, src, dest, pages:byte);Fastest procedure that copies whole memory pages from RAM into MaxFlash cart.
parameters: |