Jump to content
IGNORED

"Pi Pico 2" - Pre-Development projects discussion


Recommended Posts

4 minutes ago, Duewester said:

https://www.raspberrypi.com/news/raspberry-pi-pico-2-our-new-5-microcontroller-board-on-sale-now/

Just as this wonderful project is starting to come to the counter...

The Pico 2 with 30 or 48 gpio. More ram, faster,...

 

Yes. I was reading the news this morning. Going to try to get a preorder in at the Canadian Pi Shop before it's sold out.

  • Like 2
Link to comment
Share on other sites

52 minutes ago, Gary from OPA said:

Yes. I was reading the news this morning. Going to try to get a preorder in at the Canadian Pi Shop before it's sold out.

Try Pimoroni. They have some variants in stock already. I especially like the breakout board.

Link to comment
Share on other sites

1 hour ago, Duewester said:

Try Pimoroni. They have some variants in stock already. I especially like the breakout board.

sadly, there only two places in Canada, and both are pre-order, and its risky to import them from other places as "customs" here in Canada looks at them as "hacking" devices so you might not get your order unless its from a big place like Mouser, which doesn't have them yet. From the official PiShop in canada, it comes to $20.63 with shipping for pre-order, so I may just wait until Amazon or Mouser has them in stock, hopefully, Raspberry has solved their production problems.

image.png.8c99a1d907012f824de32eef50294a3f.png

Link to comment
Share on other sites

32 minutes ago, Gary from OPA said:

sadly, there only two places in Canada, and both are pre-order, and its risky to import them from other places as "customs" here in Canada looks at them as "hacking" devices so you might not get your order unless its from a big place like Mouser, which doesn't have them yet. From the official PiShop in canada, it comes to $20.63 with shipping for pre-order, so I may just wait until Amazon or Mouser has them in stock, hopefully, Raspberry has solved their production problems.

image.png.8c99a1d907012f824de32eef50294a3f.png

So wait... Aren't Canada and England in the British Empire? I buy from Pimoroni all the time. The shipping to the states is only slightly higher than orders from Adafruit and not much longer time to get. 

"Hacking devices?" Seriously?

 

Pimoroni Order

 

Order summary

 Raspberry Pi Pico 2 × 2

£8.00

 

 Pimoroni Pico Plus 2 × 2

16MB

£20.00

 

Subtotal £28.00

Shipping £7.50

Taxes £0.00

 

Total £35.50 GBP

 

Probably cost me about $40 after the conversion and bank fee.

Oh well, it is what it is.

Link to comment
Share on other sites

26 minutes ago, Duewester said:

So wait... Aren't Canada and England in the British Empire? I buy from Pimoroni all the time. The shipping to the states is only slightly higher than orders from Adafruit and not much longer time to get. 

"Hacking devices?" Seriously?

 

Pimoroni Order

 

Order summary

 Raspberry Pi Pico 2 × 2

£8.00

 

 Pimoroni Pico Plus 2 × 2

16MB

£20.00

 

Subtotal £28.00

Shipping £7.50

Taxes £0.00

 

Total £35.50 GBP

 

Probably cost me about $40 after the conversion and bank fee.

Oh well, it is what it is.

i decided to risk it and see how it goes and ordered, just one of these:

 

https://shop.pimoroni.com/products/pimoroni-pico-plus-2?variant=42092668289107

 

With shipping and conversion to our crappy loonie we have in canada, it only came to $26.28 CAD in total, decided against the actual Raspberry Pi Pico 2 since its still pre-order, and why not have the better version with more features.

 

A mod @OLD CS1should moved our posts from this thread into a "New Pi Pico 2" Pre-Development Stage thread -- as it might be fun to see how the pi pico w sidecar works better with this new pico 2 as well, plus open up discussion about these devices with attaching datasheets, and tools and what could be done.

  • Like 4
Link to comment
Share on other sites

41 minutes ago, Gary from OPA said:

A mod @OLD CS1should moved our posts from this thread into a "New Pi Pico 2" Pre-Development Stage thread -- as it might be fun to see how the pi pico w sidecar works better with this new pico 2 as well, plus open up discussion about these devices with attaching datasheets, and tools and what could be done.

Make sure this thread owner agrees, make a new a new thread, and PM me a list of messages to move.

Link to comment
Share on other sites

Now we got our own thread. I want to brainstorm with others what we might be able to use this for.

 

I have ordered this version listed below and when it gets here I going to be looking mainly at using the Risc-V cores of it, as I have more experience with them compared to Arm and I want to try out my hand in doing some direct assembly programming as well on it.

 

Quote

Pimoroni Pico Plus 2 is powered and programmable via USB-C and comes with an upgraded 8MB RAM, 16MB of flash storage and easy to read pin labels. It's super easy to connect up to things without soldering, with a Qwiic/STEMMA QT connector (for adding I2C sensors and breakouts), a SP/CE connector (for hooking up SPI/serial devices) and a debug connector (for if you like to program using a SWD debugger). We've also added a reset button, and a BOOT button - this can also be used as a user switch.

Features

  • Powered by RP2350B (Dual Arm Cortex M33 running at up to 150MHz with 520KB of SRAM)
  • 16MB of QSPI flash supporting XiP
  • 8MB of PSRAM
  • USB-C connector for power, programming, and data transfer
  • Qw/ST (Qwiic/STEMMA QT) connector for attaching breakouts
  • Intriguing SP/CE connector
  • 3 pin debug connector (JST-SH)
  • Reset and BOOT buttons (the BOOT button can also be used as a user button)
  • User LED indicator
  • On-board 3V3 regulator (max regulator current output 600mA)
  • Input voltage range 3V - 5.5V
  • Compatible with Raspberry Pi Pico add-ons
  • Measurements: approx 53mm x 21mm x 9mm (L x W x H, including connectors)

 

ppico_plus_2_pinout_diagram.png

pico-plus-2-oak-1.jpg

rp2350-datasheet.pdf

Edited by Gary from OPA
  • Like 2
Link to comment
Share on other sites

9 hours ago, Gary from OPA said:

With shipping and conversion to our crappy loonie we have in canada, it only came to $26.28 CAD in total

I just pre-ordered a couple of OEM boards. $28.00 aussie dollarydoos delivered. The boards aren't too bad - it's shipping.

  • Like 2
Link to comment
Share on other sites

16 minutes ago, visrealm said:

I just pre-ordered a couple of OEM boards. $28.00 aussie dollarydoos delivered. The boards aren't too bad - it's shipping.

Shipping was not bad from UK to Canada for me, better than local delivery from actual official Pi reseller in Canada.

Screenshot_20240809-023535.png

Edited by Gary from OPA
  • Like 2
Link to comment
Share on other sites

I like a lot of things about this new chip, but I didn't get what I thought would be most useful...

 

Likes:

More RAM, 8 x 64KB + 2 x 4KB blocks (but I note, the non-striped map has been removed with a comment that you can get the same effect by having each CPU stick to the lower or upper striped 256KB blocks now).  The Digital IO pins are now certified as +5V tolerant, when running at 3.3V, but really, it already was close to that on the RP2040.  More IO pins on the higher pin model, that would alleviate the need for a bunch of support logic on my device.  Support for 2 serial memory devices for XIP which works with RAM now, but this is getting fairly low on the list of what I would want to use (though, all the other chip brands have this, so they couldn't really leave it out now, could they).

 

Dislikes:

The 8 cycle hardware integer dividers have been removed (so it's no longer 100% software compatible with the RP2040) with a note saying that the better CPU can do it natively now.  Not such a big deal there I suppose, but...  There's 2 extra CPUs in there, but you can't use them all at once, only 2 at a time, this would have been be my most wanted feature.  When your project is consuming 90% of one available CPU and 100% of the other, having one extra CPU would be really useful.

 

There's other stuff which is better too, like the improved PIO with 50% more "of it", but I was only using a small fraction of that anyway.  Overall for me, the initial excitement has dispersed somewhat.  Hmmm, more IO and +5V tolerance.

  • Like 4
Link to comment
Share on other sites

I wrote this message a few days ago, but AtariAge went down at the time, as I wrote this. Nice that the message didn't disappear after all, it seems to have been saved locally by the browser. Interesting follow up since then as well.

 

Thanks @Gary from OPA for mentioning that the devices were available at Pimoroni. I also placed an order for the Pimoroni Pico Plus 2 on Friday, ordered two boards. These would simplify the picocart board I created - that project has been on the back burner for a while now. This would be a good motivation to check that out. The Pico Plus 2 boards have PSRAM installed and the new chips support that natively. Would be much better than what can be achieved with software on the RP2040.

 

The problem I had with the picocart is that the console cartridge port does not have the capability to introduce wait states into memory accesses, meaning that you have to meet the timing every time. The console memory accesses on the 8-bit bus are very slow, but communicating with QSPI PSRAM chips in software requires a fair amount of cycles when address setup is needed. Burst bandwidth can be very high, but the latency of the first access was the issue. I think it is solvable but I didn't put enough time in it. Anyway with the new RP2350 chip there is to my understanding hardware support for the PSRAM, which should make this work well.

 

@JasonACT's points about likes and dislikes were interesting. The integer dividers for RP2040 were certainly nice to have but at the end of day just covering the shortcoming that the Cortex M0+ didn't support hardware division. I have used Cortex M0, M3, M4 and M7 cores and if memory serves me right everything above the M0 support division directly.  Regarding CPU performance, according to data from ARM, a Cortex-M33 core is about 1.5x faster than a Cortex M0+ core (at the same clock frequency), so there is a fair amount of performance boost over the RP2040. As one example, the M0 does not support the thumb 2 instruction set, limiting the number of CPU registers programs can effectively use. Also starting from M4 there are some SIMD instructions available, not to mention the FPU which dramatically speeds up floating point operations.

I assume that adding more active cores would have needed a much bigger bus crossbar switch within the chip, and it would also have increased power consumption which might be another problem. Don't know why they went this way, but the milk-v duo boards have a similar thing going on, you choose either an ARM or RISCV core.

 

I have assembled by hand a few boards with the RP2040 chip (not the pico breakout, but the actual chip). Before doing that I was thinking soldering these chips would be a major pain, but I think they can be easier to work with than fine pitch LQFP chips (I have soldered plenty of those, pin pitch 0.5mm). This is the case at least if you have a stencil, the RP2040 boards I worked on had 0402 sized passive components which would have been painful (and slow to work on) without the help of a stencil.

Edited by speccery
  • Like 4
Link to comment
Share on other sites

2 hours ago, speccery said:

Regarding CPU performance, according to data from ARM, a Cortex-M33 core is about 1.5x faster than a Cortex M0+ core (at the same clock frequency), so there is a fair amount of performance boost over the RP2040. As one example, the M0 does not support the thumb 2 instruction set, limiting the number of CPU registers programs can effectively use.

That's right, and I can see GCC making far better use of the M33, but I was able to hand code ordinary thumb 1 assembler to be well over 2 times faster than what GCC produced for my side project.  Then I realised (through testing, making small changes here and there) that you are penalised by unfavourable half-word positioning of instructions (small changes move code around, and you would normally expect more efficient code to run faster, but you need to consider extra RAM hits with branches to odd half word addresses).

 

I'm mentioning it because the T2 instructions seem to all be 32 bits in length, so unless you have run out of low registers (0-7) you get RAM cycle penalised for using the wider instructions.  I suspect you may be better off sticking to T1 if you have a spare low register, which I always did, except in one case.  It'll be interesting when the Pico2W comes out and I get one, to see which areas of my code can make good use of the extra T2 instructions.

  • Like 3
Link to comment
Share on other sites

2 hours ago, JasonACT said:

That's right, and I can see GCC making far better use of the M33, but I was able to hand code ordinary thumb 1 assembler to be well over 2 times faster than what GCC produced for my side project.  Then I realised (through testing, making small changes here and there) that you are penalised by unfavourable half-word positioning of instructions (small changes move code around, and you would normally expect more efficient code to run faster, but you need to consider extra RAM hits with branches to odd half word addresses).

 

I'm mentioning it because the T2 instructions seem to all be 32 bits in length, so unless you have run out of low registers (0-7) you get RAM cycle penalised for using the wider instructions.  I suspect you may be better off sticking to T1 if you have a spare low register, which I always did, except in one case.  It'll be interesting when the Pico2W comes out and I get one, to see which areas of my code can make good use of the extra T2 instructions.

Thanks for sharing your insights, interesting! This makes me want to test how loops branching to unaligned half-word addresses compare between M0+ and M4 cores. The MCU I use on the strangecart has both M4F and M0+ cores, so it's easy for me to test that on it. It also an older MCU without caches, so with test code running from RAM I should get comparable results. T2 instructions have 3 operand forms which you don't get with thumb 1, so you can do non-destructive operations, and it also supports the if-then-else instruction. I don't have a Cortex M33 board yet to test on...

 

Below is small example from the strangecart's BASIC interpreter. It's probably not the best example, but shows the if-then-else instruction (which is a 16 bits long thumb 2 instruction). 

 

The instruction decoders are different between the different cores, the M7 being the extreme example, as it is superscalar and can run two instructions per cycle.

 

Spoiler
// C++ code
float tibasic::eval_plus(size_t symname_len) {
  float left = eval_mul(symname_len);
  // Handle a series of additions or substractions
  while(*line == TOK_PLUS || *line == TOK_MINUS) {
    bool plus = *line == TOK_PLUS;
    line++;
    float right = eval_mul(0);
    left = plus ? left + right : left - right;
  }
  return left;
}

// Compiled assembly
00000000 <_ZN7tibasic9eval_plusEj>:
   0:   b538            push    {r3, r4, r5, lr}
   2:   ed2d 8b02       vpush   {d8}
   6:   4604            mov     r4, r0
   8:   f7ff fffe       bl      0 <_ZN7tibasic9eval_plusEj>
   c:   eeb0 8a40       vmov.f32        s16, s0
  10:   e009            b.n     26 <_ZN7tibasic9eval_plusEj+0x26>
  12:   f8c4 3270       str.w   r3, [r4, #624]  @ 0x270
  16:   f7ff fffe       bl      0 <_ZN7tibasic9eval_plusEj>
  1a:   2dc1            cmp     r5, #193        @ 0xc1
  1c:   bf0c            ite     eq
  1e:   ee38 8a00       vaddeq.f32      s16, s16, s0
  22:   ee38 8a40       vsubne.f32      s16, s16, s0
  26:   f8d4 3270       ldr.w   r3, [r4, #624]  @ 0x270
  2a:   781d            ldrb    r5, [r3, #0]
  2c:   f105 023f       add.w   r2, r5, #63     @ 0x3f
  30:   b2d2            uxtb    r2, r2
  32:   2a01            cmp     r2, #1
  34:   f103 0301       add.w   r3, r3, #1
  38:   f04f 0100       mov.w   r1, #0
  3c:   4620            mov     r0, r4
  3e:   d9e8            bls.n   12 <_ZN7tibasic9eval_plusEj+0x12>
  40:   eeb0 0a48       vmov.f32        s0, s16
  44:   ecbd 8b02       vpop    {d8}
  48:   bd38            pop     {r3, r4, r5, pc}
  4a:   bf00            nop

 

Edited by speccery
  • Like 5
Link to comment
Share on other sites

2 minutes ago, PeteE said:

I saw that the new microcontroller has an IO method called HSTX which can be used to drive a DVI monitor.  Example code here: https://github.com/raspberrypi/pico-examples/tree/master/hstx

yes, very useful, it allows for much easier hookup, a more in-depth blog about using HSTX can be found here:

 

https://www.cnx-software.com/2024/08/15/raspberry-pi-rp2350-hstx-high-speed-serial-transmit-interface/

 

Makes it useful for sure, for a new Pico9918 with DVI instead of VGA -- i would love to see high-res ti99, would be nice if possible to have 1920x1080 bitmap mode with sprites! or at least an 800x600 mode, or worse case at least doing the v9938/58 512x424 easy without issues, and if possible slipping in the v9990 features, making a pico9978 that never happened, v9990 with backwards 9938/58 support that was stripped out due to licensing and other issues at the time.

Edited by Gary from OPA
  • Like 6
Link to comment
Share on other sites

On 8/11/2024 at 1:51 AM, speccery said:

The problem I had with the picocart is that the console cartridge port does not have the capability to introduce wait states into memory accesses, meaning that you have to meet the timing every time.

What happens if you pull down GROM Ready during a CPU memory access? I've never messed with GROM.)

  • Like 2
Link to comment
Share on other sites

2 hours ago, FarmerPotato said:

What happens if you pull down GROM Ready during a CPU memory access? I've never messed with GROM.)

Unfortunately that does not help. By default GROMs already hold ready low. When a GROM access takes place, and the GROM is ready to do its thing, it temporarily releases the ready line. There is a pull-up resistor which pulls the ready line high (eventually, this takes a long time, I forget how long but something like over a microsecond). Of course the pull-up only has a chance to do its thing when all GROMs have released the ready line. Eventually the ready line goes high, and the GROM access cycle ends. GROM chip select line goes back high. At this time the GROMs again start to pull ready low. This is actually quite perfect for microcontroller implementation, since it means that by default any GROM access halts the CPU. You can really take your time to serve the read or write cycle. In practice with the grommy2 for instance the memory cycles run much faster than with actual GROM chips, but if there are actual GROMs in parallel they will slow down the system to the normal slow pace of GROM accesses.

  • Like 3
Link to comment
Share on other sites

12 hours ago, Duewester said:

Came in last week. OMG I wish I knew what I was doing.

image.thumb.png.6f70cd3c76174eb4d131a2daba71bbb6.png

That looks awesome! All 48 GPIOs exposed in a small package. I'm sold!

 

Edit: Cheap shipping to Australia too. Picked up two.

 

image.png.b7016b3c9d59c7a4125c3081045edc8e.png

Edited by visrealm
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...