1

In a project, I’m using an EIA485 bus to send encrypted data packets. That works with Arduino’s buffered serial, but it is kind of awkward, and I’m using none of the more complex stuff in that class anyway.

If I do not use Serial anywhere in my Arduino sketch, is it safe to create my own interrupt handlers for USART_RXC etc. and to directly manipulate the USART registers?

1 Answer 1

1

Absolutely. The only interrupt that Arduino takes for itself unilaterally is the timer 0 overflow interrupt, used for timing purposes (delay(), milliseconds(), et alia).

3
  • 1
    Does it only define the ISR (like this one) once you've used the Serial object?
    – Gerben
    Dec 29, 2014 at 19:33
  • 1
    @Gerben: Using Serial causes it to link in two additional vectors on the '328P: USART, RX and USART, UDRE. I have not checked whether using Serial1 et alia is required for the further vectors on the '1280 or '2560. And to be fair I have not verified any of this on ARM. Dec 29, 2014 at 19:46
  • 1
    Hmm 485. FYI if your interested in 9bit. I recently helped a friend and found it much quicker to tweak the existing core library. Rather than rewrite it. See gist.github.com/mpflaga/ebe6aadd20f81de8e970
    – mpflaga
    Dec 30, 2014 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.