The softwareserial library saids any digital pin can be used:
Do they really mean ANY digital pin, or only the PWM capable digital pins? How does that work - that the Arduino can do serial comms over a non-PWM pin? That seems too good to be true?
The softwareserial library saids any digital pin can be used:
Do they really mean ANY digital pin, or only the PWM capable digital pins? How does that work - that the Arduino can do serial comms over a non-PWM pin? That seems too good to be true?
What has PWM got to do with it?
Mark
SoftwareSerial uses a pin change interrupt to detect the leading edge of a character. It will work on any pin that has a pin change interrupt capability, which is all of them I believe. The transmit side just has to be a digital pin, any digital pin.
Maybe you're thinking of AltSoftSerial? It uses PWM and only works with specific pins.
arusr:
How does that work - that the Arduino can do serial comms over a non-PWM pin? That seems too good to be true?
SoftwareSerial disables interrupts for the entire time it takes to send or receive a character. This is how it maintains the proper timing. The downside is that while its sending or receiving your Arduino is basically a UART with few cycles to spare for other processing.