开发者

What pin does the pySerial interrupt when running?

Since pySerial is a serial communication technique, will it then be interrupting a pin on the Arduino boa开发者_高级运维rd once there is some data to be given to the Arduino board?

Which pin does it interrupt to run the ISR? Or is it using a polling method? Am I understanding the concept right?


pySerial gives access to UART hardware. Reading/writing data doesn't involve any interrupts. You just call read() and write(). read() will block until data is available, with an optional timeout.


On the Arduino board, serial communication usually occurs over the UART, which uses digital pins 0 and 1. The UART is a physical peripheral on the ATmega328P microcontroller that has its own interrupts, UDRE, so you are not using any of the regular or pin change interrupts otherwise available. This interrupt is triggered whenever a full byte has been received. There is also a separate TX interrupt available which signals that a byte has been transmitted.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜