blippy
Posts: 141
Joined: Fri Nov 03, 2017 3:07 pm

I'm excited!

Thu Jan 21, 2021 9:59 am

I never got switched on by the Raspberry Pi 4, but this product has me intrigued. I've just got to try it.

It's not quite my dream machine, but I can't resist giving it a try. I've always thought that there was a market for a hybrid MCU and SBC. It's very difficult to do bare metal interfacing between SD cards and USB keyboards, for example. Imagine a scenario where the circuitry was already in place, and you could interface with keyboards as easily as UART. Even a PS/2 keyboard interface would be acceptable.

Sure, SD cards do have SPI interfaces, but they can be a bit picky, and I've often had trouble with them. Imagine simplifying the logic even further.

What's the point, you may ask? Well, the point is that you end up with something that is really accessible as bare metal. I could have a device which is standalone if I want it, but if I wanted, I could say plug a keyboard and OLED into it to perform custom controlling.

Moreover, it would allow users to experiment with OS design, and make them Real Time if we want (which we probably will). Because it's a shame that it's difficult to do that with the previous models of Pis. The hardware is too complicated. You need a complete software stack just to get a flipping keyboard working. Which means that someone who wants to experiment is faced with a mountain to climb, or else has to give up and just use Linux, which isn't real-time.

Just throwing some ideas out there.

LdB
Posts: 1673
Joined: Wed Dec 07, 2016 2:29 pm

Re: I'm excited!

Thu Jan 21, 2021 10:33 am

At the end of the day its a basic dual core M0+ 133Mhz mcu. The problem is it's playing in the big boy space NXP, Renesas, Microchip and samsung all have better micros and at that cost point and they spend serious dollars to support them. Most of them will give you the dev kit if you even remotely look like buying a few pieces , I have a cupboard full of free dev kits :-)

I don't get why they are bothering to be honest.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28363
Joined: Sat Jul 30, 2011 7:41 pm

Re: I'm excited!

Thu Jan 21, 2021 11:49 am

LdB wrote:
Thu Jan 21, 2021 10:33 am
At the end of the day its a basic dual core M0+ 133Mhz mcu. The problem is it's playing in the big boy space NXP, Renesas, Microchip and samsung all have better micros and at that cost point and they spend serious dollars to support them. Most of them will give you the dev kit if you even remotely look like buying a few pieces , I have a cupboard full of free dev kits :-)

I don't get why they are bothering to be honest.
Read the datasheet. Read up on PIO and the rest of the custom HW. That's why we bothered, because at the end of the day it's not just a dual core M0+.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2569
Joined: Thu Jul 11, 2013 2:37 pm

Re: I'm excited!

Thu Jan 21, 2021 11:55 am

LdB wrote:
Thu Jan 21, 2021 10:33 am

I don't get why they are bothering to be honest.
And I don't know why you bothered to make this post.
Rockets are loud.
https://astro-pi.org

BMS Doug
Posts: 4422
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: I'm excited!

Thu Jan 21, 2021 12:06 pm

It adds features that people have bwen screaming were "must have" for years (they weren't really must have but it's nice to see them).

Is this a first step towards integrating these features into a full Pi? Possibly, but baby steps and don't expect any confirmation until such a product is ready to hit the shelves (or just after it hits them really).
Doug.
Building Management Systems Engineer.

blippy
Posts: 141
Joined: Fri Nov 03, 2017 3:07 pm

Re: I'm excited!

Thu Jan 21, 2021 1:01 pm

Many mcus have been touted as Arduino-killers over the years, of course. Perhaps the only one that comes close is the ESP32.

I've messed around with a variety of mcus - although I consider myself very much a beginner - and I've usually found something to like about all of them.

I have good vibes about the Pico though as a highly serious threat to Arduino.

A few points of note:
1. there's a shift towards 3V power, and it helps to have an mcu that is geared to it
2. it has a serial port through mini USB. The Arduino has it, of course, but most mcus don't. Being able to program and communicate with an mcu is a considerable convenience.
3. I haven't read any documentation, but I hear it's excellent. This is exactly what we need.
4. there seems to be interesting third-party hardware out there. I love the thing I saw on Pimoroni that expands the GPIO outputs. Rather than shields, we can plug in modules. It's actually a great idea.

The Pi team has come up, once again, with a killer concept. It's unfathomable! It's a great engineering effort, and just as importantly, it seems to get all the little details right (except for missing out the pin labels on the top of board, grr!). They've really thought things through as a package as a whole.

It's the first time that I've heard of the Pico. I've just ordered one, and what little I've heard about it so far it will live up to the high reputation that the Pi Foundation has.

Great work, guys! I'm sure Arduino are sweating buckets right about now.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2569
Joined: Thu Jul 11, 2013 2:37 pm

Re: I'm excited!

Thu Jan 21, 2021 1:09 pm

blippy wrote:
Thu Jan 21, 2021 1:01 pm
Many mcus have been touted as Arduino-killers over the years, of course. Perhaps the only one that comes close is the ESP32.

I've messed around with a variety of mcus - although I consider myself very much a beginner - and I've usually found something to like about all of them.

I have good vibes about the Pico though as a highly serious threat to Arduino.
[...]
Great work, guys! I'm sure Arduino are sweating buckets right about now.
They aren't, though. Arduino is a platform that makes use of microcontrollers and RP2040 is a microcontroller. Case in point - Arduino are going to use RP2040 in a product.

https://blog.arduino.cc/2021/01/20/welc ... ntrollers/
Rockets are loud.
https://astro-pi.org

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 1:38 pm

I like how this new board supports UART and so in theory can support CAN or RS485 hardware? Might have to be more software based for now at least? Will still need some kind of additional downstream preferably optically isolated hardware but this has some potential applications in industrial type interfaces as a result.

Needs to be an ARM Cortex-M3 or Cortex-M7 but that's a likely next evolution pathway.

User avatar
aallan
Raspberry Pi Trading Employee & Forum Moderator
Raspberry Pi Trading Employee & Forum Moderator
Posts: 154
Joined: Mon Feb 09, 2015 11:30 am
Location: Exeter, UK
Contact: Website Twitter

Re: I'm excited!

Thu Jan 21, 2021 2:10 pm

MicroSDBootFail wrote:
Thu Jan 21, 2021 1:38 pm
I like how this new board supports UART and so in theory can support CAN or RS485 hardware? Might have to be more software based for now at least? Will still need some kind of additional downstream preferably optically isolated hardware but this has some potential applications in industrial type interfaces as a result.
Yup. See the documentation around PIO. It can support pretty much any protocol.
Technical Documentation Manager
Raspberry Pi (Trading) Limited
About me, http://alasdairallan.com

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 2:14 pm

I saw the bits about Various digital peripherals
◦2 × UART, 2 × I2C, 2 × SPI, 16 × PWM channels


No explicit mention of SERCOMs though it does say 2× Programmable IO (PIO) blocks, 8 state machines total
◦Flexible, user-programmable high-speed IO.


So it can physically support it but no drivers are available yet or it can support it and there is existing code to be able to drop it in and just use it? Getting RS485 through SERCOM running hardware UART on an ARM SAMD51 is almost trivial and much of it is already built into the existing codebase.

https://raw.githubusercontent.com/adafr ... SERCOM.cpp

Although somewhat annoyingly on their SAMD51 line, they don't easily let you change some of the default SERCOM without having to change a very small amount of the core code before compiling. Despite there being support for it to default to the code provided, they force it to be a hard driver link. In other words, you have to modify C:\Users\*USERNAME*\AppData\Local\Arduino15\packages\adafruit\hardware\samd\1.6.4\variants\grand_central_m4 if you are using the Grand Central for example to comment out one of the SERCOM handlers to be able to actually use it properly. It took us many hours of head scratching and testing to figure that one out.

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

Code: Select all

void SERCOM0_0_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_1_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_2_Handler()
{
  Serial1.IrqHandler();
}
void SERCOM0_3_Handler()
{
  Serial1.IrqHandler();
}

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28363
Joined: Sat Jul 30, 2011 7:41 pm

Re: I'm excited!

Thu Jan 21, 2021 4:20 pm

The PIO is a Programmable Input Output device. You can program it to do all sorts of crazy different protocols. I cannot see the one you describe as being a problem.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 4:29 pm

So it sounds like we can make it do what we want to (have hardware based UART support RS485 messages here though will still need optically isolating and physical RS485 hardware as well) but the official support to do so might not exactly be present at the moment is what I think you are saying? Took two years or so for this to be relatively "easily" available for the SAMD51 side of things and even then it took some changes to make it actually work. Plus we needed a literal spreadsheet to figure out workable pin combinations although hopefully these are more universal and able to map out to nearly any pin to start with.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 13817
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: I'm excited!

Thu Jan 21, 2021 4:39 pm

MicroSDBootFail wrote:
Thu Jan 21, 2021 4:29 pm
So it sounds like we can make it do what we want to (have hardware based UART support RS485 messages here though will still need optically isolating and physical RS485 hardware as well) but the official support to do so might not exactly be present at the moment is what I think you are saying? Took two years or so for this to be relatively "easily" available for the SAMD51 side of things and even then it took some changes to make it actually work. Plus we needed a literal spreadsheet to figure out workable pin combinations although hopefully these are more universal and able to map out to nearly any pin to start with.
There are 8 (2 blocks, 4 state machines each) hardware PIO engines, that can connect to *any* GPIO pin, and can do RS485 support in hardware (in PIO state machines).

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28363
Joined: Sat Jul 30, 2011 7:41 pm

Re: I'm excited!

Thu Jan 21, 2021 5:16 pm

MicroSDBootFail wrote:
Thu Jan 21, 2021 4:29 pm
So it sounds like we can make it do what we want to (have hardware based UART support RS485 messages here though will still need optically isolating and physical RS485 hardware as well) but the official support to do so might not exactly be present at the moment is what I think you are saying? Took two years or so for this to be relatively "easily" available for the SAMD51 side of things and even then it took some changes to make it actually work. Plus we needed a literal spreadsheet to figure out workable pin combinations although hopefully these are more universal and able to map out to nearly any pin to start with.
You should be able to write your own code for the PIO to implement this. Or you could wait for someone else to do it for you. The PIO is an open specification, fully documented in the datasheet, and there are examples to show you how to do things.

PIO output can go on any GPIO pin.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 5:24 pm

PIO is programmable in the same sense as a processor. There are two PIO blocks with four state machines each, that can independently execute sequential programs to manipulate GPIOs and transfer data.
Unlike a general purpose processor, PIO state machines are highly specialized for IO, with a focus on determinism, precise timing, and close integration with fixed-function hardware.

Each state machine is equipped with:
• Two 32-bit shift registers – either direction, any shift count
• Two 32-bit scratch registers
• 4× 32-bit bus FIFO in each direction (TX/RX), reconfigurable as 8× 32 in a single direction
• Fractional clock divider (16 integer, 8 fractional bits)


https://forum.pjrc.com/threads/65899-Raspberry-Pi-Pico

Nobody told Paul Stoffregen about this?

Looking at the datasheet from https://datasheets.raspberrypi.org/rp20 ... asheet.pdf, it looks like PIO can be programmed in assembly and there's only nine instructions. 3.2.1. PIO Programs. The PIO has a total of nine instructions: JMP, WAIT, IN, OUT, PUSH, PULL, MOV, IRQ, and SET. Interesting idea. Looking forward to seeing a higher powered version of this board although I am pretty sure it is already in the works.

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 7:04 pm

https://hackspace.raspberrypi.org/artic ... ry-pi-pico

Like many microcontrollers, RP2040 has hardware support for some digital communications protocols such as I2C, SPI, and UART. This means that if you want to communicate with something via I2C, you can simply send the raw data to the I2C peripheral and it will control the pins to handle the specific timing requirements for this protocol. However, what happens if you need something a little unusual such as WS2812B LEDs, or more I2C or SPI buses than are available? Pico (and RP2040) has a little trick up its sleeve: Programmable I/O.

blippy
Posts: 141
Joined: Fri Nov 03, 2017 3:07 pm

Re: I'm excited!

Thu Jan 21, 2021 8:02 pm

MicroSDBootFail wrote:
Thu Jan 21, 2021 7:04 pm
Programmable I/O.
I've quickly skimmed the datasheet. It will obviously take me some time before i've really grokked what's going on.

Let's say, for example, that you wanted to use the Pico that converts ADC and offers the readings over SPI as a slave. Would you say that implementing this design via PIO is considerably easier than a more traditional approach?

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 8:29 pm

From the perspective of "will it be better long term" I would say yes, it is significantly better. But over the short (meaning probably months to years) term, I would say no. I see it like LEGO blocks. Except you only really have access to a few 2x2 and 2x4 and 2x6 blocks right now instead of thousands of off the shelf, easy types that are all prebuilt and ready to go. The fact that IO does not have to literally follow an excel spreadsheet now to see what pins can do what when and how and what is and is not being used by other things and so on is a huge help. Take a look at the SAMD51 PMUX Google Sheet if you really want to delve deeply into the ARM side of things (or not even that deeply, arguably).

https://docs.google.com/spreadsheets/d/ ... edit#gid=0

A few people can probably start off the gate and go nuts with this but I would imagine very few people are able to leverage this over the short term. Give it a few years, a few newer more powerful hardware versions and keep the price low and they will have a really impressive ecosystem on their hands. Closed source to a degree but that benefits them here and it makes it harder for people to switch later as well. Remember the move to X64 and the amount of really low level things that had to be rewritten? Similarly to Y2K?

Adafruit for example does some amazing things but deep software development is not their strength. They basically say here is the hardware, here are a few VERY basic examples and here is the datasheet and have at it. Maybe some other customers will offer their time for free to try to help you and like this message, some are willing to do so. But nobody is going to do things like write you drivers and so forth. That's something that we literally have to outsource or do in house when needed and it's neither cheap nor quick to do so.

Anyway, this is all great except for the fact that most people using these platforms are not embedded hardware and software engineers. The whole point is to make them EASY to use. Even for people who don't program. I cannot tell you how long it can sometimes take to literally learn C++ and the Arduino IDE and have no JTAG support and no code stepping and so on to be able to teach someone to write a program that does something simple is not BUT SHOULD BE an easy task. Coding by using literal LEGO like blocks of code to make it easy and visual and easy to step through and virtually run it and debug it if you really need to but ideally just have it work. Enhance the software side to make easy to medium builds something that people who are literally not professional programmers and hardware engineers can create and maintain. That is what they are trying to do here, at least it feels that way to me. At some point, they will probably combine this with their Raspberry Pi platform and make it all embedded together so you get the best of both worlds. Super powerful, possibly multiple and then some core microcontroller along with a powerful Raspberry Pi all in one for $50 or so with a host of variants and a vibrant user base with plenty of libraries and code that just works instead of having to dig into hundred page datasheets for some obscure reason why a certain pin doesn't work as you think it should because you missed one strange hardware quirk that isn't even described well or at all to begin with.

To be fair, Adafruit and Sparkfun and those businesses are doing a much better job of understanding that customers need software support and examples and libraries but given we basically just moved from AVR to ARM as it is, hopefully this affords us all the opportunity to start building a new infrastructure akin to how x86/CISC is now moving to ARM/RISC in many low powered "good enough" and "cheap enough" applications and there are a LOT of those out there.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28363
Joined: Sat Jul 30, 2011 7:41 pm

Re: I'm excited!

Thu Jan 21, 2021 9:43 pm

blippy wrote:
Thu Jan 21, 2021 8:02 pm
MicroSDBootFail wrote:
Thu Jan 21, 2021 7:04 pm
Programmable I/O.
I've quickly skimmed the datasheet. It will obviously take me some time before i've really grokked what's going on.

Let's say, for example, that you wanted to use the Pico that converts ADC and offers the readings over SPI as a slave. Would you say that implementing this design via PIO is considerably easier than a more traditional approach?
Actually, you don't need PIO for that - there are already dedicated ADC's and SPI blocks that you can use. Would be pretty trivial.

But if you wanted, I am sure PIO could do some of the job.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

MicroSDBootFail
Posts: 69
Joined: Sun Dec 27, 2020 7:54 pm

Re: I'm excited!

Thu Jan 21, 2021 10:28 pm

They don't need PIO for that but looking at it from the perspective of exactly how easy it would be to implement specifically in PIO seems to be the question here? There are very likely easier ways of doing something like that but what if either the code didn't exist or the application specifically didn't handle it over more traditional methods?

Trying to use Arduino code now that it has splintered into ARM and AVR is already getting irritating. Please do not do the same thing! Already starting to happen some with EEPROM updates for the Raspberry Pi.

blippy
Posts: 141
Joined: Fri Nov 03, 2017 3:07 pm

Re: I'm excited!

Fri Jan 22, 2021 11:02 am

Well, I got my Pico today from Pimornoni. That was quick! Thanks for that.

No time for more chat. Must blink LEDs.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 28363
Joined: Sat Jul 30, 2011 7:41 pm

Re: I'm excited!

Fri Jan 22, 2021 11:12 am

Have fun! This was my first excursion in to Microcontrollers, and some of the examples in the pico-examples are my first forays in to sensors, and it was indeed fun!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

sonnybalut
Posts: 14
Joined: Fri Apr 17, 2015 2:57 am

Re: I'm excited!

Sun Jan 24, 2021 12:47 am

Just bought 10 pico's from Chicago Electronic Distributors because of the excellent free pdf documentation (pico_c_sdk.pdf, pico_python_sdk.pdf, rp2040_datasheet.pdf), source code examples(c and micropython), and of course the price.

Thanks,
Sonny :)

W. H. Heydt
Posts: 14587
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: I'm excited!

Sun Jan 24, 2021 1:02 am

sonnybalut wrote:
Sun Jan 24, 2021 12:47 am
Just bought 10 pico's from Chicago Electronic Distributors because of the excellent free pdf documentation (pico_c_sdk.pdf, pico_python_sdk.pdf, rp2040_datasheet.pdf), source code examples(c and micropython), and of course the price.

Thanks,
Sonny :)
I just got the four I ordered from them. Clearly just snipped off four from a reel.

BMS Doug
Posts: 4422
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: I'm excited!

Sun Jan 24, 2021 8:24 am

W. H. Heydt wrote:
Sun Jan 24, 2021 1:02 am
I just got the four I ordered from them. Clearly just snipped off four from a reel.
That's how my 3 arrived also (purchased from Pimoroni in the UK).
Minimal handling, perfect for these times.
Doug.
Building Management Systems Engineer.

Return to “General”