13.9 Configuring the Scanner

The scanner module may be used in conjunction with the CRC module to perform a CRC calculation over a range of program memory or Data EEPROM addresses. In order to set up the scanner to work with the CRC, perform the following steps:

  1. Set up the CRC module (See Configuring the CRC) and enable the scanner module by setting the EN bit in the SCANCON0 register.
  2. Choose which memory region the scanner module will operate on and set the MREG bit appropriately.
  3. If trigger is used for scanner operation, set the TRIGEN bit and select the trigger source using SCANTRIG register. Select the trigger source using SCANTRIG register and then set the TRIGEN bit.
  4. If Burst mode of operation is desired, set the BURSTMD bit.
  5. Set the SCANLADR and SCANHADR registers with the beginning and ending locations in memory that are to be scanned.
  6. Select the priority level for the scanner module (Refer to the “System Arbitration” and the “Priority Lock” sections in the “PIC18 CPU” chapter for more details.)
  7. Both EN and GO bits in the CRCCON0 register must be enabled to use the scanner. Setting the SGO bit will start the scanner operation.