You can select to “Freeze on Halt”, which allows you to freeze selected peripherals on a halt. For more on these functions, see Freeze Peripherals.