ROMBuffer

SwordfishUser.ROMBuffer History

Show minor edits - Show changes to output

August 26, 2007, at 05:11 PM by David Barker -
Changed lines 1-5 from:
This set of modules enables 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 a block erease. 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 shoes 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 (this is a ROM module public constant). Finally, call ''EndWrite()'' to terminate the write sequence. 

You data will now be stored in device ROM, which you can access by calling ''ReadByte()'' with an index value which should range from 0 to ROMBufferSize - 1.
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.