In order to protect application code and data, different levels of security can be enabled to restrict access to the on-chip Flash. There are three levels of code read protection (CRP) including CRP1, CRP2, AND CRP3. CRP1 disables access to the chip via the JTAG and allows a limited set of instructions in the systems programming (ISP) commands to update the Flash. This mode allows the Flash to be updated in the field but protects certain sectors from being overwritten. CRP2 also disables access to the chip via the JTAG and also limits the Flash updates to a global erase and update via ISP. CRP3 fully disables any access to the chip via the JTAG and the ISP so that the Flash is fully secured.