SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions about processor boards have here!
#223705
Are pins D0 and D1 on the MicroMod "MEGA" style All The Pins (ATP) Carrier Board actually able to be used by the RP2040 module as the basic initial hardware UART serial? Trying to check the software definitions and make sure we can assign downstream serial devices that you almost always see using pins D0 and D1 but looking at how this is talked about in hardware documentation is currently very confusing is all since it is not labeled as RX0 and TX0.

https://learn.adafruit.com/assets/78438 with Image for example, shows it as pin 0 is RX and pin 1 is TX. Not clear how exactly this seems to differ in pinout and how it is labeled exactly.
Last edited by TsunamiQuestion on Fri Mar 05, 2021 2:23 pm, edited 1 time in total.
#223706
D0 and D1 are Arduino pins, Micromod uses a different pin numbering/naming scheme although it is very similar to Arduino.
RX and TX on the ATP carrier connect to micromod pins 19 and 17. Those pins are assigned to RP2040 UART_TX1 and UART_RX1.
It would be very odd for Raspberry Pi to name those pins UART_TX and UART_RX if they didn't have serial capability, I think you're safe assuming they will work as advertised but if you want confirmation, Raspberry Pi should be able to tell you for sure.
#223708
Just a bit confused due to the fact that many Arduinos fail to have a separate RX/TX on pins 0 and pins 1 as some didn't have a separate USB access point but many are moving in that direction now at least such as the ARM M4 and so forth style. Will check the RP2040 literature and see if we cannot figure out exactly how pins 19 and 17 from the MicroModule (M.2) Pinout v1.0 maps out to the actual pins on the MicroModule unit.
#223720
https://learn.sparkfun.com/tutorials/sa ... rial-ports

Example: Serial Ports

One of the SAMD21's most exciting features is SERCOM -- its multiple, configurable serial ports. The Arduino IDE equips the SAMD21 with two hardware serial ports, by default, plus a third "USB serial port" for communicating between the serial monitor.

Each of these serial ports has a unique Serial object which you'll refer to in code:
Serial Object Serial Port RX Pin TX Pin
SerialUSB USB Serial (Serial Monitor)
Serial Hardware Serial Port 0 31 30
Serial1 Hardware Serial Port 1 0 1


We understand that the ATP isn't the same as the SAMD21 but you can always add a SAMD51 main chip to it.

https://learn.sparkfun.com/tutorials/ad ... amd-boards

SERCOM (Serial Communication) is a multiplexed serial configuration used on the SAMD21, SAMD51 and other boards. It allows you to select various serial functions for most of your pins. For example, the ATmega328 which has UART (RX/TX) on one pair of pins, I2C (SDA/SCL) on another set, and SPI (MOSI, MISO, SCK) on another set. The SAMD21 has 5 different internal ports which you can configure to use any combination of UART, I2C, and SPI. The SAMD21 and SAMD51 boards are becoming increasingly popular in part because of this feature.

Plus the RP2040 can swap the positions around pretty substantially compared to needing to literally chart it all out for even the ARM SAMD21 and SAMD51 chips. Just not quite following how easy it is in both hardware or programming needed or provided by SparkFun to be able to use ports D0 and D1 or which ports are easily able to be used as Serial or Serial1, meaning actual hardware serials (or even PIO style RP2040 serial ports). One of the big annoyances is the difficulty of trying to use anything other than the "assigned" serial port and existing code provided. Because defining extra ports despite the hardware being able to support the SERCOM there varies so much and also just doesn't work by default.

https://www.arduino.cc/en/Tutorial/SamdSercom in theory tries to help but in practice it doesn't do a great job and doesn't migrate over well to SAMD51, let alone RP2040 either.

Will do more testing after hardware arrives but still unclear where the Serial and Serial1 hardware is with the ATP devices and does the code support them or do we need to modify the Arduino IDE hardware code in order for it to properly use the hardware?

Here's a SparkFun SAMD21 and you can see how it has a RX and TX port as the basic serial ports that are default ones. It appears that the ATP just doesn't do that?

Image
#223768
I guess the main issue is why is it called D0 and D1 and then over a bit after RX1 and TX1, there is another set of pins labeled just TX and RX?

Typically pins D0 and D1 are labeled RX and TX and obviously it can have multiple RX and TX pins since it is typically SERCOM now anyway but I guess very, very typically things are setup for the first set to be RX and TX and then other ones have a different name is all to keep things a bit more straightforward and clear.

RX, TX then RX1, TX1 then RX2, TX2 and so on.

Instead it is D0, D1 then RX1, TX1 then RX, TX?

Reasonably sure that there are at least 3 specific RX and TX sets of pins here plus the CAN ones which are separate as well? You could likely setup more than that as well depending on what connecting main chip you are using but that's a separate consideration here.

Anyway, this all means that pins D0 and D1 are actually RX and TX pins that are effectively UART compatible? Just technically called RX1 and TX1?

One of the main reasons to be checking here is due to this code requirement:

https://github.com/adafruit/ArduinoCore ... ariant.cpp

The main issue is that you cannot change this without changing the actual variant.cpp files ahead of time and then compiling and keeping those changes each time outside of your specific code base. Basically you are having to change the entire compiling environment as well for it to work. Here is an example of how some of the Serial1 was setup on this particular ARM based SAMD51 chip. It differs on each one and it only defines Serial1 here and that's it.
Code: Select all
Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ;

void SERCOM0_0_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_1_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_2_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_3_Handler()
{
  Serial1.IrqHandler();
}
#223905
You keep jumping between different products and each product has it's own set of rules and limitations and are a discussion all on their own.

The MicroMod ATP Carrier Board is just a breakout for the M.2 processor board connector and since multiple different processor boards can be attached, the rules are going to change slightly for the labeled pins depending on what processor is attached. Due to the complexity of each processor, you're going to have to refer to the schematics to see what processor pins connect with which carrier board pins. Generally, TX and RX should work across any processor you use but you will need to consult the schematics and documentation for the processor you choose to see what connects where.

D0 and D1 are arbitrary names that were assigned long, long ago on the first Arduino board and those just so happened to coincide with RX and TX on that particular board. (They could just as easily been called Bob and Sue rather than D0 and D1) What that means is those are digital I/O pins that can also be used as UART pins. Many Arduino boards since then have stuck RX and TX on Do and D1 but it's possible other boards might not have RX and TX on them.
#223931
Any way to confirm that the RP2040 version of the ATP chipset can in fact use D0 and D1 as RX and TX for UART / SERCOM serial that by definition is already part of the backend of programming by SparkFun? Almost 100% sure it is by default and worst case by simply letting you reconfigure the pins yourself as the RP2040 is much more open to letting you do that but the hardware we ordered is still a few days out so we cannot test it just yet. Figured out a while ago that both Adafruit and Sparkfun don't always really configure the prior Arduino code in a way that really thoroughly defines things outside of the most default serial port once things moved to M0 or M4.

Things like the Adafruit example of code located at \AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.6.4\variants\feather_m4 for example. Specifically the variant.cpp file.

Notice how they defined SERCOM5 for Serial1 and that's it? You would need to manually define more than Serial1 if you want to use a second UART, basically. It's not something that you can just add to your main file and have it suddenly work, unfortunately.

Here is the other relevant code in that file. Serial2 is not defined there at all for example. It certainly can be done but you will not only have to modify that above file but also continue to modify it once you update the IDE or other environment prior to updating your code each time, otherwise it will not compile correctly.

This code, again from the variant.cpp file is what basically defines the RX/TX pins.

// 0..13 - Digital pins
// ----------------------
// 0/1 - SERCOM/UART (Serial1)
{ PORTB, 17, PIO_SERCOM, PIN_ATTR_PWM_G, No_ADC_Channel, TCC0_CH4, NOT_ON_TIMER, EXTERNAL_INT_1 }, // RX: SERCOM5/PAD[1]
{ PORTB, 16, PIO_SERCOM, PIN_ATTR_PWM_G, No_ADC_Channel, TCC0_CH5, NOT_ON_TIMER, EXTERNAL_INT_0 }, // TX: SERCOM5/PAD[0]

also

Uart Serial1( &sercom5, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ;

void SERCOM5_0_Handler()
{
Serial1.IrqHandler();
}
void SERCOM5_1_Handler()
{
Serial1.IrqHandler();
}
void SERCOM5_2_Handler()
{
Serial1.IrqHandler();
}
void SERCOM5_3_Handler()
{
Serial1.IrqHandler();
}

Again, we get that those examples are, well, examples for M4 hardware and not RP2040 but is there a similar codebase for the ATP hardware that is specifically RP2040 chip related? Looking at https://github.com/sparkfun/MicroMod_Processor-RP2040 there isn't anything similar there. Are we still waiting for Arduino to push things over, at least for the Arduino side? But what about CircuitPython code for this ATP hardware? Is that currently available?

There is one https://datasheets.raspberrypi.org/pico ... on-sdk.pdf datasheet that talks about the Raspberry Pi Pico Python SDK (2.66MB) - A MicroPython environment for RP2040 microcontrollers but that's pretty much it and that's not really helpful here for anything related to anything Arduino based and nothing CircuitPython or really anything even MicroPython either for that matter?

Adafruit at least has some code for their CircuitPython but this is a Sparkfun product so not entirely sure if any of the CircuitPython side is likely to apply at this point in time yet?

https://github.com/adafruit/circuitpython
https://github.com/adafruit/Adafruit_Ci ... hon_Bundle

Not exactly much of any code or items for the Adafruit Feather RP2040 yet though either. Maybe this is all just waiting on code to be either created or available and also waiting for Arduino to figure out what they are doing as well?

Feeling like your point of the original labels D0 and D1 being used to label the current ATP hardware are starting to get a bit irrelevant for more modern hardware but it was sort of how things were done back then and nothing has changed since then so it continues to be labeled like that?
#224004
Alright but when or how can SparkFun give support to it's RP2040 products so that CircuitPython can be used with them? It would not need to be extensive but it would at least ideally need to define the boards and allow the Adafruit based CircuitPython to be able to easily select them. Basically trying to use CircuitPython with your RP2040 but it appears that at the moment at least, even the ATP ones don't seem to support this. Plus we want to use a number of Adafruit products with yours and they have migrated the code over for a few hundred of them to be able to use CircuitPython as well.

The other semi related element here is the fact that Arduino seems to be out doing it's own thing still. Would like to see them offer their IDE 2.0 to support anything RP2040 and by definition allow users to select each specific unit, not just the basic official 2 MB RP2040 Pico but rather the 8 MB Addafruit flagship or the 16 MB Sparkfun flagship(s). I get that SparkFun can only do so much to make that happen but would still very much like to see that happen and unclear why they are not even allowing it to be beta tested at the moment despite the IDE 2.0 being widely beta tested.
#224006
Sorry for the repost but it did not let me edit the above one? I guess feel free to remove the duplicate one. No idea why I cannot delete it or even edit it?

Alright but when or how can SparkFun give support to it's RP2040 products so that CircuitPython can be used with them? It would not need to be extensive but it would at least ideally need to define the boards and allow the Adafruit based CircuitPython to be able to easily select them. Basically trying to use CircuitPython with your RP2040 but it appears that at the moment at least, even the ATP ones don't seem to support this. Plus we want to use a number of Adafruit products with yours and they have migrated the code over for a few hundred of them to be able to use CircuitPython as well.

https://github.com/adafruit/circuitpyth ... ypi/boards
Appears to be the current status but it only incorporates

adafruit_feather_rp2040 from 10 days ago
pimoroni_keybow2040 from 18 days ago
pimoroni_picosystem from 18 days ago
pimoroni_tiny2040 from 18 days ago
qtpy_rp2040 from 12 days ago
raspberry_pi_pico from 11 days ago

They need to add their own two boards that are not out yet and there are starting to be a few more as well now. Here is a list of what is or will be released using the RP2040 chip.
https://www.raspberrypi.org/forums/viewforum.php?f=147

Here is where CircuitPython is including boards at this point or intends to do so.
https://github.com/adafruit/circuitpython/issues/4042

These are the relevant and as far as we can tell only released items which are the PIDs for the three SparkFun RP2040 items.
SparkFun Thing Plus – RP2040 (SparkFun USB PID: 0x0025)
SparkFun MicroMod RP2040 Processor (SparkFun USB PID: 0x0024)
SparkFun Pro Micro – RP2040 (SparkFun USB PID: 0x0026)

The other semi related element here is the fact that Arduino seems to be out doing it's own thing still. Would like to see them offer their IDE 2.0 to support anything RP2040 and by definition allow users to select each specific unit, not just the basic official 2 MB RP2040 Pico but rather the 8 MB Adafruit flagship or the 16 MB Sparkfun flagship(s). I get that SparkFun can only do so much to make that happen but would still very much like to see that happen and unclear why they are not even allowing it to be beta tested at the moment despite the IDE 2.0 being widely beta tested.
#224069
Not sure anyone is going to respond further here but want to briefly point out these relevant new updates in progress so the ThingPlus RP2040 can be added to CircuitPython. It would be great if SparkFun could at the very least update on if they ever intend to support it or are just waiting on it being embedded and supported first before doing so? Not following exactly and also not entirely sure why RPi only seems to want to do the MicroPython version only despite it seeming to be worse in most ways, not just the official character drawings that represent it but also the ease in the boot ability for the CircuitPython but not the MicroPython and so forth.

https://github.com/adafruit/circuitpython/pull/4411

Added board configuration files for the Sparkfun ThingPlus RP2040
Builtin NeoPixel, LED, QWIIC port and build-in micro-SD slot all tested and working with the updated pin definitions.

https://github.com/mintakka/circuitpyth ... lus_rp2040 if someone wants to take a closer look at the ThingPlus RP2040 version code. Basically pulls out the specific pin layouts and also calls out the specific memory on this SparkFun RP2040 part.

There is a similar version for the SparkFun Pro Micro - RP2040 which is as of literally now finally in stock for the first time. 2 have already literally been sold. https://github.com/adafruit/circuitpython/pull/4419

Still in progress of being merged into the official CircuitPython code but should be done here fairly soon. Likely before SparkFun ships and the relevant postal delivery company physically delivers them.

Slight suggestion to update the description on the product page that says important: The SparkFun Pro Micro - RP2040 is available for back-order. We expect to have the next round of physical stock ready to ship by mid April if it is actually currently in stock or at least will be for probably a fairly short period of time.
#224114
Support for the SparkFun Thing Plus RP2040 seems to have been integrated into the CircuitPython side of things as of now. The SparkFun Pro Micro RP2040 as well.

https://github.com/adafruit/circuitpyth ... lus_rp2040
This branch is 10554 commits ahead, 2841 commits behind micropython:master.

Makes us wonder when we will see the SparkFun MicroMod ATP Carrier Board (DEV-16885) when using the SparkFun MicroMod RP2040 Processor (DEV-17720) have CircuitPython support as well? Most likely yes given the SparkFun MicroMod RP2040 Processor is identified as (SparkFun USB PID: 0x0024).

Also the link above (https://github.com/mintakka/circuitpyth ... lus_rp2040) has been changed to https://github.com/mintakka/circuitpyth ... lus_rp2040

Very small change. Would edit the post but it not only does not let one do so and secondly, forum admins do not seem to fix things like that or even read many of the posts either?

Lastly, any particular reason why the "links" at the bottom of the forum are completely fake in origin and what they do if anything?

long long title how many chars? lets see 123 ok more? yes 60
- By Admin

We have created lots of YouTube videos just so you can achieve [...]

as well as

Do you need a super MOD? Well here it is. chew on this
- By Jane lou

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

When you click on READ MORE it doesn't do anything and all 4 of them are basically fake. Even briefly thought that your forum was being abused! We get that these forums are not exactly buzzing with constant posts or responses but that seems fairly odd is all.

The SparkFun Pro Micro - RP2040 is still in stock with 187 items currently in stock. The Pico still not in stock and the SparkFun Thing Plus - RP2040 is backordered and then some now it looks like.

Also realized that the RP2040 MicroMod shorts RTC_3V directly to 3.3V. Awkward.
It was carried over from the Artemis (including the blocking diode). Then, after discussions with RPi, it became obvious the RP2040 Micromod really doesn't have low power modes. So they removed the diode but failed to remove the 3.3V RTC connection.
viewtopic.php?f=182&t=55303 and https://github.com/sparkfun/MicroMod_Pr ... -799603389

Lastly, if you have indeed read this far, there is an error on https://learn.sparkfun.com/tutorials/rp ... okup-guide
Computer with the an operating system (OS) that is compatible with all the software installation requirements:
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]