8.1 Four-Wire Interface

The setup sequence to enter Four-Wire JTAG programming must be done while asserting the MCLR pin. Once the programming mode is entered, the MCLR pin can be released to allow the processor to execute instructions or drive ports.

The following are the steps required to check the device status using the Four-Wire interface:
  1. Set the MCLR pin low.
  2. SetMode (6’b011111) to force the chip TAP controller into Run Test/Idle state.
  3. SendCommand (MTAP_SW_MTAP).
  4. SetMode (6’b011111) to force the Chip TAP controller into Run Test/Idle state.
  5. SendCommand (MTAP_COMMAND).
  6. statusVal = XferData (MCHP_STATUS).
  7. If CFGRDY (statusVal[3]) is not ‘1’ and FCBUSY (statusVal[2]) is not ‘0’, go to step 5.
Note: If using the 4-wire interface, the oscillator source, as selected by the Configuration Words, must be present to access the Flash memory. In an unprogrammed device, the oscillator source is the internal FRC allowing for Flash memory access. If the Configuration Words have been reprogrammed selecting an external oscillator source then it must be present for Flash memory access. See the “Special Features” chapter in the specific device data sheet for details regarding oscillator selection using the Configuration Word settings.