I moved the DEBUG output after disabling interrupts, so the printed data is always reliable.