Hello! I use XC167CI with on-chip Flash module and my task is to provide protection for code and data reading. But I have some variables in one sector which may be modified while unit is in service. In Memtool I set global protection and password. So, when I receive command to modify variables in Flash, I make next sequence: 1. disable write protection 2. disable read protection After it FSR = 0x2C00 (SUL = 1, PROIN = 1, PRODI = 1) 3. erase wordline After it FSR = 0x2C40 (add bit SQER = 1). I have tested my algorithm without Flash protection and it work good. So I can't understand why sequence error occured. Can You help me?