Replies: 5 comments 1 reply
-
The code compiles fine with the core and the RPi Pico/W boards (replacing
For #1 you can manually instantiate a arduino-pico/libraries/SPI/src/SPI.cpp Lines 468 to 474 in 28b0eda For #2, well, re-select the |
Beta Was this translation helpful? Give feedback.
-
Thanks for your quick reply! I will check out your solution #1 once I have some time. Thanks again for your fast help! |
Beta Was this translation helpful? Give feedback.
-
The pinout diagram for the Pimoroni Tiny2040 only shows that SPI0 can be mapped to one of two sets of pins, either GP0-3 or GP4-7: Looking at the one for the standard Pi Pico, SPI1 could be mapped to the analog input pins, GP26-29 (the Pico doesn't have GP29 on a header pin): I don't know if that breaks any rules for pin assignments in Arduino, but it looks like that would be the only option. |
Beta Was this translation helpful? Give feedback.
-
I now see that #define PIN_SPI0_SS should have been 5 (GP5). I failed to understand that CSn, on the pinout, was meant to represent SS. I freely admit I don't know enough about the rules to make these choices and the limited number of pins on the Tiny2040 makes it harder. I think my reasoning was that Rx and Tx are on GP0-1, so it was better to put the default pins for SPI0 on 4-7. Since everything has to be somewhere, I also put the default pins for I2C0 on 4-5, like on the Pi Pico since there isn't a choice that doesn't overlap something else, as far as I can see. Maybe there's a better way to arrange it all though. |
Beta Was this translation helpful? Give feedback.
-
@TheLardos Here's a proposed new variant file for the Pimoroni Tiny2040. I've zipped it so github can allow me to attach it. This defaults to SPI0 on GP4-7, as before, but puts the SS pin on GP5. It also allows SPI1, and defaults to using the four analog input pins - which is the only place you'd be able to set it, but it doesn't stop your code setting those pins explicitly, so long as it assigns each function to the correct pin. Here's your test code, with some #defines so that it can be compiled, using this variants file;
Place the unzipped variants file in your equivalent of; C:\Users\andy\AppData\Local\Arduino15\packages\rp2040\hardware\rp2040\3.4.1\variants\pimoroni_tiny2040 This is from my Windows 7 machine, which as an older copy of the arduino-pico core installed, so you'll have a different version number instead of 3.4.1. You can get part of the way to this folder by using File->Preferences in the Arduino IDE then clicking on the link for preferences.txt, near the bottom. That gets me to C:\Users\andy\AppData\Local\Arduino15. From there, you open the packages folder, then rp2040... and so on. You'll see a pins_arduino.h - rename that, e.g. to pins_arduino.hOLD, then paste in the new, unzipped pins_arduino.h You should now be able to use it without having to wait for a new release, and you can test it for us. I've only checked that it now compiles. I can't currently find my Tiny2040 from last year but I might still get lucky. Here's the contents of that new (as yet untested) file:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm trying to get my second SPI interface to work. I include the
#include <SPI.h>
header and in the setup I use:
and I run into the error:
undefined reference to
SPI1'`I'm probably missing something quite obvious but I couldn't figure out what it is...
I'm glad for any hel I can get.
Cheers,
Luca
Beta Was this translation helpful? Give feedback.
All reactions