Go Down

Topic: AltSoftSerial Library (Read 4 times) previous topic - next topic

Paul Stoffregen


Quote
It is absolutely impossible from software to make any pin other than 8 on Uno act as a 16 bit timer input capture.
Actually you could use any one of the analog pins as an input for the 16 bit timer. 


Wow, yes, you're right.  The AN1 pin can too.  I didn't notice that before.

The signal will become inverted, so the library would need to handle reverse polarity (on my to-do list), and of course code would need to enable the analog comparator and ADC mux.

Good eye on the hardware's seldom used features!

wayneft

I'm going to have to give this a try now.  My current project uses NSS and as luck would have it I just happened to route those serial signals to 8 and 9 (what are the odds?). 
I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

wayneft

Hey Paul,
I haven't tried this alternative yet but I just wanted to be sure on a couple of things before I implement this library.  I need to use pin change interrupts on most of my IO pins but unfortunately NewSoftSerial ties up all the pin change interrupt vectors even if they're not used so I get multiple vector define errors when I compile.  I could rem out ports C and D in NSS but I still lose PCI for the rest of the IO pins on Port B.

From what I can tell your library does not use pin change interrupts, can you confirm this? 

Also you mention that PWM on pin D10 can't be used.  I assume I can still use D10 for other functions just not PWM?

How does code size compare to NSS?

Thanks again for this library, it will probably save me a lot of time!
I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

Paul Stoffregen


From what I can tell your library does not use pin change interrupts, can you confirm this?


Confirmed, pin change interrupts are not used.

Quote

Also you mention that PWM on pin D10 can't be used.  I assume I can still use D10 for other functions just not PWM?


Yes.  I've added some text to the web page to clarify this point.

Quote

How does code size compare to NSS?


I didn't compare.  Maybe you can tell me?

Just click "Verify", make a note of the size, then change just a couple lines your code to switch to AltSoftSerial, and click Verify again.  Subtract the numbers.... pretty easy!

wayneft

Thanks Paul.  So far so good, it saved me 900 bytes. 
I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

Go Up