Switch between initialisation, program, test, end of programming, erase mode