Shop OBEX P1 Docs P2 Docs Learn Events
P2 RPi Hat? — Parallax Forums

P2 RPi Hat?

JonnyMacJonnyMac Posts: 8,912
edited 2023-02-16 01:26 in PASM2/Spin2 (P2)

During the live meeting today @"Ken Gracey" was looking for ideas involving the RPi and the P2. I happened to have an RPi and and Eval board on my desk, so I looked at them for a few minutes and then sketched an idea in DipTrace.

  • 4 Eval headers (2 single, 1 double) for pins P0..P31
  • Qwiic connector using pins P32 (SCL from P2) and P33 (SDA from P2)
  • LEDs on P56..P63 (as on Eval)
  • Serial programming from RPi header (will need way to reset P2)
  • SPI connection from RPi header to P52..P55

This might be a fun way to do specialty projects that combine the P2 with the RPi.

Comments

  • Francis BauerFrancis Bauer Posts: 353
    edited 2023-02-16 07:34

    Years ago there was a RPi hat (#32230) made by Pimoroni (see web page) for the P1.
    I don't think it caught on unfortunately at the time.

    I got one of the P1 RPi Hats and played with it a bit back then with an early Raspberry Pi based PiTop laptop. I got side-tracked and never got back to doing more experiments.

    I just got (through Parallax) one of the new Raspberry Pi 400 kits that consists of a keyboard with a RPi 4 system built-in. I need to bring the P1 RPi Hat out again and see how it works with the RPi 4.

    Having a P2 RPi Hat would probably be a good start into making it more readily connectable to the RPi family.

    Good idea Jon.

  • Stephen MoracoStephen Moraco Posts: 300
    edited 2023-02-16 20:50

    Jon, What are your thoughts on using a right-angle edge connector for the P2, and are you including the Serial Eprom that RPi HATs normally have?

    That is looking like it will be fun!

  • JonnyMacJonnyMac Posts: 8,912
    edited 2023-02-17 04:08

    I had the idea while looking at a Pi and an Eval board on my desk -- this makes no consideration of specific requirements. BTW, that 2nd IC in my sketch is supposed to be the P2 flash.

    I just found this:
    -- https://github.com/raspberrypi/hats

    My original idea is for a standard Pi. If your suggestion for the R/A connector is to support the RP400, I think that could grow just a bit and get six Eval connectors. This gives the user 48 uncommitted IO, and P48..P63 for the Qwiic and connection to the RPi header (serial and SPI).

    I found the schematic for the the board Francis mentioned; I need to look at it and the docs to see what they did for the P1.

  • @JonnyMac said:
    During the live meeting today @"Ken Gracey" was looking for ideas involving the RPi and the P2. I happened to have an RPi and and Eval board on my desk, so I looked at them for a few minutes and then sketched an idea in DipTrace.

    • 4 Eval headers (2 single, 1 double) for pins P0..P31
    • Qwiic connector using pins P32 (SCL from P2) and P33 (SDA from P2)
    • LEDs on P56..P63 (as on Eval)
    • Serial programming from RPi header (will need way to reset P2)
    • SPI connection from RPi header to P52..P55

    This might be a fun way to do specialty projects that combine the P2 with the RPi.

    Great, this board looks as if it could be used without a rpi too and without the need of those ????? edge connectors. Please keep this application in mind too, when you design it! I suppose, that it will need power supply 3.3V and 1.8V and a flash anyways.
    In my opinion a low cost P2 board is still needed!

  • VonSzarvasVonSzarvas Posts: 3,273
    edited 2023-02-17 11:58

    They remind me of the old FLiP-Pi hat ! Or Flippy as it was affectionately known!
    Maybe the time is nigh for FLiP2-Pi :)

    I'd think more seriously such a hat would need to be based on an Edge module to keep it cost effective in manufacturing.

    For these sorts of products the original bare-bones 5V only Edge would seem a good way to bring the overall cost down. Adding the wide-rail power supply, SD and other stuff added so much cost that was deliberately kept off the original 5V design to keep the price at the lowest market entry level. Somehow that goal was lost in the enthusiasm to keep adding more!

    We talked about a "Student Edge" version a few times, thinking how to bring back an entry-level edition that could still use all the existing accessories and resources, and I think that could fit well with a Pi hat.

  • Great, this board looks as if it could be used without a rpi too and without the need of those

    That was not my intent. I thought such a board would get 5v from the RPi and use the same 3.3v and 1.8v circuitry as the Edge (perhaps simpler on the 3.3 side).

    I'd think more seriously such a hat would need to be based on an Edge module to keep it cost effective in manufacturing.

    If the Edge is the only product Parallax is ever going to produce with a P2, it's going to be hard to get the P2 moving in the marketplace. The Edge is already too expensive.

  • @JonnyMac said:
    If the Edge is the only product Parallax is ever going to produce with a P2, it's going to be hard to get the P2 moving in the marketplace. The Edge is already too expensive.

    As you can see above, I don't disagree :)

    What price point would you say is needed to "get the P2 moving in the marketplace" ?

  • Let's stay on topic of a P2 Pi-Hat ideas.

  • Sorry, I only thought, that you can almost not avoid to design a board that can be used without a rpi..... So you might just keep this application in mind.

    Well, ideas.
    In my opinion an SD slot is more useful than flash.
    I could imagine, that driving steppers might be a good application for the combination of rpi with P2. So if this head could have connectors for 3 of these polulu A4988 step driver modules?

  • Wuerfel_21Wuerfel_21 Posts: 4,374
    edited 2023-02-17 20:11

    Actually, just get rid of both the flash entirely, it's pointless when you can just have the Pi boot the P2 from serial every time. (unless you'd somehow want to take advantage of the P2 booting faster than the Pi)

  • @JonnyMac could your P2 hat be designed such that the header pins can be installed on both sides (or thru the board) such that the P2 hat could also operate as a standalone controller with a standard PI hat attached to its top? In other words, your P2 hat could also become a PI (of sorts) and the entire HAT ecosystem can then be used with the P2? Or am I milking without a bucket here?

  • I think this discussion should be moved to the main P2 forum.

  • I suppose if it had flash (I think it should) it could operate by attaching 5v -- but then it would be tricky to reprogram because I'm assuming a P2 HAT would use a direct serial channel to the Pi. I guess a Prop-Plug header could be added, but then it become more Frankenstein. And, for stand-alone, there's already Edge modules and small breakouts.

    I learned in my early days developing products for Toro that if you try to please everybody with one product, you won't please anybody. This idea -- which was a 10-minute sketch created in DipTrace -- was in response to Ken Gracey looking for ways to pair the P2 with the RPi. IMO, keeping it simple and complying with the RPi standards for HATs will keep things focused and could possibly get support from the RPi foundation which may be helpful. Parallax is very focused on Education and this could be a way to get P2s into those channels.

    It was an idea. It probably won't go anywhere, but when someone says something that drives my creative urge I have to get it out of my system.

  • @JonnyMac

    My two cents:

    Based on Parallax's educational focus and @"Ken Gracey"'s call for suggestions during the last meeting, it comes to mind something similar to the Pimoroni's Explorer Hat Pro. We use these on programming camps and STEAM related trainings for middle school - high school students and teachers. It's hard to try and smash together P2 (in its current state of early documentation, which has improved a lot) and a low entry barrier for newbies, but with the appropriate peripherals (buttons, touch-pads, leds, breadboard, and exposed I/O's) it could be an attractive proposition. Parallax's own activity board is a good example, but as a hat, you have the open possibility of using Python on the RPI and the P2 working together. RPI could do the heavy lifting for data acquisition (for example), internet connectivity, database centric applications, or many other projects such (NodeRED integration comes to mind).

    Personally I like the idea of a Hat.

  • This is not an original idea on my part. I knew it had been done with a P1, so I chucked this sketch together to see how parts would fit the standard HAT format. To your point, it allows a team approach with the P2 doing things that may not be easy on the Pi and vice-versa.

  • Perhaps it would be a good idea to do some brainstorming, what would be possible applications of the combination of raspi with p2?

    I have used a combination of raspi2 with p1 for a while to control my little cnc lathe, which is driven by step motors. The experience is:
    Only 2 cogs had been necessary, one for communication and one for the steppers and linear interpolation.
    The plus side is, that the Propeller will run undisturbed by interrupts.

    The down side is, that you are forced to deal with so many different systems. Frankly speaking I can hardly imagine, that the combination is good for education. You have to learn too many things in parallel.

    To reduce complexity, after having learned, that you can reserve cores ("isolcpus") on a raspi, that they are no longer used for linux tasks (but still for interrupts), I have changed the system and do now control the steppers directly by a dedicated core. I have done a lot of measurements about the latency which is given in a setup with a raspi2 @ 900MHz with dedicated core. I have not seen latency > 500µs in 3E7 measurements with planned pause 100µs. The probability of a latency>10µs was 0,002.

    So an application, that benefits from linux but needs latency to be <500µs might profit from the combination. Competition comes from beagle boards with their PRUS. They set the price. Actually I have always been surprised, that you cannot find many applications for these PRUS on the internet.....

    Another application, that I see, would be easy (!!!!) interfacing with (lots of) analogue sensors and actors. For this, very good libraries would be needed and perhaps some preamps or drivers? Perhaps preload the P2 with some fine interface library to reduce the amount of learning? For this, as many pins of p2 as possible, should be available. I think that most of the workload would not come from the hardware of the board but from the library and it's documentation. There are already boards like Gerdboard on the market and the connector system from SeeedStudio.

    I do not think, that it is really necessary, that the board has the same size as the raspi, because you cannot use the standard enclosures anyways.

  • jmgjmg Posts: 15,140

    @JonnyMac said:
    ... This idea -- which was a 10-minute sketch created in DipTrace -- was in response to Ken Gracey looking for ways to pair the P2 with the RPi. ...
    It was an idea. It probably won't go anywhere, but when someone says something that drives my creative urge I have to get it out of my system.

    To me, it is a good idea. I did a variant of P2D2 that had a Pi-pinout, on both (identical pinout) 40 pin headers, and found this pin mapping below was routable on 2 layers :
    The pins with a j suffix are jumper options that are GND on a Pi and can be P2 pins on a more custom usage. (solder bridge options)

    Not covered in this mapping, is a means to RESET the P2 - the focus on this mapping was to allow a P2 to replace a Pi master.
    If you wanted to slave a P2 to a Pi-host, for development and shipping, choices could be a pinout variant focused on Serial BOOT with Pi having P2-RESET control, with a subset of P2 pins connected.

    There is no reason a P2-Edge+40pin header simple 'connector adaptor' board could not be also offered.

           PI4  P2D2Pi FLiP                       CN1  (Other 40 pin, CN3 Pm = P(n-32 ))                
           P2     Pi4      Std Pi                .___.               Std Pi       Pi4     P2
           VBP                          +3V3---1-|O O|--2--+5V                            5V 
           P32                 (SDA1)  GPIO2---3-|O O|--4--+5V                            5V 
           P33                 (SCL1)  GPIO3---5-|O O|--6--_                              GND
           P35    TXD3    (GPIO_GLCK)  GPIO4---7-|O O|--8-----GPIO14 (TXD0)               P34
           P37j            PiGND            _--9-|O.O|-10-----GPIO15 (RXD0)               P36
           P39            (GPIO_GEN0) GPIO17--11-|O O|-12-----GPIO18 (GPIO_GEN1)          P38
           P41            (GPIO_GEN2) GPIO27--13-|O O|-14--_          PiGND               P40j
           P43            (GPIO_GEN3) GPIO22--15-|O O|-16-----GPIO23 (GPIO_GEN4)          P42
           VBP                          +3V3--17-|O O|-18-----GPIO24 (GPIO_GEN5)  PWM0    P44
           P46            (SPI0_MOSI) GPIO10--19-|O.O|-20--_          PiGND               P45j
           P48            (SPI0_MOSO) GPIO9 --21-|O O|-22-----GPIO25 (GPIO_GEN6)          P47
           P50            (SPI0_SCLK) GPIO11--23-|O O|-24-----GPIO8  (SPI0_CE0_N)         P49
           GND                              _-25-|O O|-26-----GPIO7  (SPI0_CE1_N) RTS3    P51 
           P53    SDA0       (EEPROM) ID_SD---27-|O O|-28-----ID_SC ID EEPROM     SCL0    P52
           P55    RXD3                GPIO5---29-|O.O|-30--_                              P54j
           P57    CTS3                GPIO6---31-|O O|-32-----GPIO12              PWM0    P56
    F.IO1  P58    PWM1                GPIO13--33-|O O|-34--_                              GND
    F.CLK  P60                        GPIO19--35-|O O|-36-----GPIO16                      P59  F.IO0
    U.TXD  P62                        GPIO26--37-|O O|-38-----GPIO20                      P61  F.CSN 
           GND                              _-39-|O O|-40-----GPIO21                      P63  U.RXD
                                                 '---'                                  
                                          40W 0.1" PIN HDR                              
    
Sign In or Register to comment.