I've got a 0017 sketch that outputs to the UART (connected to a radio transceiver). I just need a one-shot thing that reacts to a button press, and the last thing the sketch needs to do is serial.write(). So I'm thinking put the whole sketch in setup() and leave loop() empty. But the serial.write doesn't work when it's coded in setup(). If I move the serial.write inside the loop() function it works. Of course it loops too, so it gets written forever.

My question is, are there any constraints on what code can run in setup(). Like, are global interrupts turned off for that section?