Comments: Adding More SERCOM Ports for SAMD Boards
Looking for answers to technical questions?
We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.
If you've found an issue with this tutorial content, please send us your feedback!
Great tutorial! The example code and tables saved me a ton of time. I have 5 UARTs and i2c running on a Redboard Turbo.
You may want to add a comment in the example code that highlights the fact that at least for UARTs, the call to pinPeripheral() in setup() must come after the call to Uart.begin(). I only tested this on the Redboard Turbo, but if you call pinPeripheral() before Uart.begin(), UARTs using sercom1 and sercom4 will not work. The order doesn't seem to matter with sercom2 and sercom5 and I didn't test sercom0 or sercom3.
Call me crazy, but I thought setting up the MUX by calling pinPeripheral() should happen before calling Uart.begin() so I changed it, and then spent a couple of hours trying to figure out why only some of my new serial ports were working. :(
Hi M-Short,
Thanks for an excellent tutorial. As I asked over here: https://forum.sparkfun.com/viewtopic.php?f=152&t=54064 The choice of D2 for the TX is clear (if I understand it correct, and D4 could just as well have been used). But the "obvious" next choice: "RX should be on D3", I don't follow. Couldn't we just as well have taken D38, D4 or D5? (Any of the unused pins in the sercom 2 row in the chart: https://learn.sparkfun.com/tutorials/ad ... ful-charts)
Do you care to comment?
Thanks
Okay, kuddos to SparkFun for this page. My current project was crying to have another Serial port, as SerialUSB was being used by the Arduino IDE to upload frequent sketch updates, and Serial1 was connected to an LCD. With a new 'Serial2' available, I could now have a TeraTerm session constantly open for sketch output, which not interfering with the Arduino IDE use of SerialUSB. And it worked the first time I tried it! Very Cool.
This is all great information. I do have a question though. For SPI, was the same SPI LCD device tried with the standard SPI port on the ICSP header (With appropriate chip select ping defined)? I ask, because I have an SPI device that I can get to work on a Pro Mini just fine, but on the Turbo, using the ICSP port, it doesn't work. (Figured I'd try here first, rather than the Forums.)
I'll reply to my own post. :-) The answer in this case turned out to be that the Slave Select line for the SPI interface needed a pull-up resistor added to get it to work. It's a good SPI-specific suggestion to keep in mind. Sparkfun's own SPI information page has a link on it that discusses this, and other SPI troubleshooting techniques. Great stuff. The real answer is, of course, "Do your homework."
Hi there, it sounds like you are looking for technical assistance. Please use the link in the banner above, to get started with posting a topic in our forums. Our technical support team will do their best to assist you.