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. To set up the scanner to work with the CRC, perform the following steps:
  1. Set up the CRC module (see the “Configuring the CRC Module” section) and enable the scanner module by setting the EN bit in the SCANCON0 register.
  2. Select the peripheral the scanner will interact with (CRC or CLB) by modifying the Scanner Dedicated Peripheral Select (DPS) bit.
  3. Select the memory region the scanner will interact with (PFM or EEPROM) with the MREG bit.
  4. Choose the scanning mode by configuring the BURSTMD and TRIGEN bits.
  5. If Trigger mode is selected for scanner operation, select the trigger source using the TSEL bits.
  6. Set the SCANLADR and SCANHADR registers with the beginning and ending locations in memory that are to be scanned.
  7. Select the priority level for the scanner module (refer to the "System Arbitration" and the "Priority Lock" sections for more details).
    Important: The default priority levels of the system arbiter may need to be changed to ensure the scanner operates as intended and that a memory access request is granted when it occurs.
  8. 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.
Important: When the scanner is used with the CLB peripheral, the CLB must be configured and initialized before the scanner is initialized.