ROMBuffer
SwordfishUser.ROMBuffer History
Show minor edits - Show changes to output
Changed lines 1-5 from:
The following program
You data will now be stored in device ROM, which
to:
These modules enable you to implement a simple ROM buffer which you can read and write to. The 18F series implement a ROM block write strategy, together with block erase. This can make writing to ROM quite tricky. The ROM module handles this for you and supports devices with 8 byte block writes and 64 byte erase blocks. You can set the size of the ROM buffer by adding more elements to ROMBuffer, which is located in the ROM table module (shown later).
The following program shows how it all works. Simply call ''BeginWrite()'' to initiate the write sequence, then call ''WriteByte()'' as many times as you need, up to a maximum ROMBufferSize - 1. ROMBufferSize is a ROM module public constant. Finally, call ''EndWrite()'' to terminate the write sequence.
You data will now be stored in device ROM, which can be accessed by calling ''ReadByte()'' with an index value. The index value should range from 0 to a maximum of ROMBufferSize - 1.
The following program shows how it all works. Simply call ''BeginWrite()'' to initiate the write sequence, then call ''WriteByte()'' as many times as you need, up to a maximum ROMBufferSize - 1. ROMBufferSize is a ROM module public constant. Finally, call ''EndWrite()'' to terminate the write sequence.
You data will now be stored in device ROM, which can be accessed by calling ''ReadByte()'' with an index value. The index value should range from 0 to a maximum of ROMBufferSize - 1.