Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Pi or P2 Demo? - Page 2 — Parallax Forums

Propeller Pi or P2 Demo?

2»

Comments

  • hinvhinv Posts: 1,255
    @Wuerfel_21 Thanks for the corrections. Do you know what, besides serial TX and RX are already used on the Raspberry Pi? I'm thinking maybe the thing to do is to make a fully compatible GPIO connections. It seems that the signals on the Raspi are 3v3 inputs and outputs anyways. Do you know why the pinouts of the Raspi GPIO is numbered all over the place? Was it because the BGA was just easier to route this way? I never really interfaced to it, but I would imagine that it is quite a PITA working around that odd ordering.
  • Cluso99Cluso99 Posts: 18,069
    hinv wrote: »
    @Wuerfel_21 Thanks for the corrections. Do you know what, besides serial TX and RX are already used on the Raspberry Pi? I'm thinking maybe the thing to do is to make a fully compatible GPIO connections. It seems that the signals on the Raspi are 3v3 inputs and outputs anyways. Do you know why the pinouts of the Raspi GPIO is numbered all over the place? Was it because the BGA was just easier to route this way? I never really interfaced to it, but I would imagine that it is quite a PITA working around that odd ordering.
    Yes, the RPi connections are a dogs breakfast.
  • Wuerfel_21Wuerfel_21 Posts: 5,053
    edited 2021-01-13 17:22
    hinv wrote: »
    Do you know why the pinouts of the Raspi GPIO is numbered all over the place? Was it because the BGA was just easier to route this way? I never really interfaced to it, but I would imagine that it is quite a PITA working around that odd ordering.

    Yes, they are like that because it's easier to route that way. Arduinos are the same, BTW, the library just abstracts the actual pin numbers away (well, AVR pins aren't really numbered sequentially to begin with).
  • hinv wrote: »
    @Wuerfel_21 Thanks for the corrections. Do you know what, besides serial TX and RX are already used on the Raspberry Pi? I'm thinking maybe the thing to do is to make a fully compatible GPIO connections.

    Well, the Pi GPIO has all sorts of stuff hardwired to certain pins. There's hardware SPI, there's 18bit parallel video, there's I2S, lots of things.
  • hinvhinv Posts: 1,255
    Now I am leaning towards a Raspberry Pi footprint. With pin usage of:
    Power In/Serial Console/Programing through USB-C 2pins shared with GPIO header
    HDMI 8pins
    Audio In/Out/Composite Video 3pins
    BlueToothLE module 2pins (sticks out of the Raspberry Pi 3 case where the ethernet usually is)
    4xUSB 8pins
    HyperRAM 11pins (177MB/s required for 24bit 1080p @30fps)
    microSD 4pins (full MMC speed one can be added to GPIO header)
    28 pins on GPIO header (including console/programming serial)

    Legacy adapter board for those that prefer VGA & PS2, a board that plugs into the HDMI connector, has VGA out (3+0to2 pins), keyboard 1pin and second pin jumperable if using doing SoG or Composite Sync on the VGA, mouse 2pins)

    Now for a comparison of pinouts:

    Raspberry Pi pinouts ripped off from https://www.raspberrypi.org/documentation/usage/gpio/
    As well as simple input and output devices, the GPIO pins can be used with a variety of alternative functions, some are available on all pins, others on specific pins.

    PWM (pulse-width modulation)
    Software PWM available on all pins
    Hardware PWM available on GPIO12, GPIO13, GPIO18, GPIO19
    SPI
    SPI0: MOSI (GPIO10); MISO (GPIO9); SCLK (GPIO11); CE0 (GPIO8), CE1 (GPIO7)
    SPI1: MOSI (GPIO20); MISO (GPIO19); SCLK (GPIO21); CE0 (GPIO18); CE1 (GPIO17); CE2 (GPIO16)
    I2C
    Data: (GPIO2); Clock (GPIO3)
    EEPROM Data: (GPIO0); EEPROM Clock (GPIO1)
    Serial
    TX (GPIO14); RX (GPIO15)

    P2 Pi pinouts:
    As well as simple input and output devices, the GPIO pins can be used with a variety of alternative functions.
    PWM(pulse-width modulation)
    Hardware Assisted (through SmartPin configuration) on all pins.
    SPI
    SPI0: MOSI (any pin); MISO (any pin); SCLK (any pin; CEO (any pin), CE1 (any pin or not used)
    SPI1: MOSI (any pin); MISO (any pin); SCLK (any pin; CEO (any pin), CE1 (any pin or not used)
    ...
    SPI6: MOSI (any pin); MISO (any pin); SCLK (any pin; CEO (any pin), CE1 (any pin or not used)
    I2C
    I2C0: Data (any pin); Clock (any pin)
    I2C1: EEPROM Data (any pin); EEPROM Clock (any pin)
    ...
    I2C12: Data (any pin); Clock (any pin)
    Serial
    Console TX (Pin63); RX (Pin62) Correct me if I got these backwards.
    Serial1: TX (any pin); RX (any pin)
    Serial2: TX (any pin); RX (any pin)
    ...
    Serial13: TX (any pin); RX (any pin)
    Analog Input (any # of pins)
    Analog Output (any # of pins)
    ... need to add pin feature discriptions here as more driver objects become available.
    Streamer (any pin)

    Now, if you were a true maker, or an EE student, or a hobiest that likes to know what's going on under the hood, which Pi would you rather have on your bench? @"Ken Gracey" You see the advantage you have here when you compare them like that? There are a lot of Pi hats that could work already, plus you guys could make some others like a 3click hat. I am guessing if you were able to build them for $100 in the USA, and maybe even get those fancy Purple&Gold PCB's' like (which is the PE6502 board that uses a Propeller), you could sell lots of them. I would really your opinion/feedback @"Ken Gracey" and others.
  • hinvhinv Posts: 1,255
    edited 2021-01-13 18:18
    BTW, that PE6502 sold many units at $130...and a single cog could likely emulate that whole board.
  • pik33pik33 Posts: 2,366
    edited 2021-01-13 21:16
    EE student, or a hobiest that likes to know what's going on under the hood, which Pi would you rather have on your bench?

    3B+ , powered by Ultibo, which is Object Pascal based bare metal environment.

    All of them will do, except RPi 4/400 which is still poor documented while Zero/1/2/3 was already reverse engineered and/or good documented. There are a lot of bare metal tutorials and 2 ready-made environments: Circle (C++ based) and Ultibo.

    These are open source environments, a lot of things inside RPi can be learned from them.

    Of course.. I have many RPis on my desk :) (0,0W,1b,2,3,3a+,3b+,4,400)
    Raspberry Pi pinouts(...)

    RPi has GPIO0..GPIO26 connected to the GPIO pins (mixed up... ) All of them can be simple in or out, up to 5 functions are defined for every pin.

    There are registers for selecting the function (one reg for 10 pins, 3 bit for function#)
    There are 2 registers to read pins
    There are 2x2 registers to set and reset pins (different for set and reset), so you have to do 2 writes to set any 1-0 combination on 32 pins

    There are 2 hardware PWMs/serializers (up to 250 MHz on input) - and also there is i2s
    You can connect 18 GPIO pins directly to GPU making a "VGA666" (6 bits per color)
    There are several UARTS and i2c


    For a P2Pi the simplest thing to do is to connect P0..P26 as in RPi.
    This will make a lot of RPi hats work with a P2 Pi
    P28-P31 - 2x USB for kbd/mouse. Can a hub be connected to P2 USB?
    P32 to P43 for HyperRAM/Flash
    P44,P45 - audio out jack - maybe P27 as mic in (instead of composite, which can be accessed via a dumbadapter on HDMI socket)
    P46,P47 - audio in (in place of one USB socket)
    P48..P55 - HDMI socket, make an hdmi->VGA and composite dumb adapters as accessories sold with the board
    P57..61 - SD,
    as eth is not possible (or maybe it is?) use RJ connector to connect the serial port on P62,P63





  • hinvhinv Posts: 1,255
    @pik33 to each his own. I personally don't have an interest in learning Pascal. What do you think the user base for bare metal Pi's? Also, the Pi won't do much for analog without external devices.

    For your choice of pins, I think SD only needs 4 pins, plus there needs to be another pin on the audio jack for either Composite video or mic can share the same connector. The dumbadapter pins should be saved for PS/2 Keyboard & Mouse, unless SyncOnGreen, which will free up another pin.
    HyperRam only used 11 pins, so on your count it would be 32 through 42.
    Audio in might be good, but I think people would prefer USB over Audio in, but I could be wrong.
    I think you did well to pick lower pin numbers for Pi compatibility and also byte boundaries to start of HyperRAM and HDMI as these 2 are high bandwidth.
    Even though LEDs on 56 and 57 are somewhat standard, I think it would be a waste to use whole pins for them.
    The FTDI/CP2102/Peter's Micro for USB2serial can drive LEDs for downloading.
  • jmgjmg Posts: 15,173
    hinv wrote: »
    Now I am leaning towards a Raspberry Pi footprint. With pin usage of:
    Power In/Serial Console/Programing through USB-C 2pins shared with GPIO header
    HDMI 8pins
    Audio In/Out/Composite Video 3pins
    BlueToothLE module 2pins (sticks out of the Raspberry Pi 3 case where the ethernet usually is)
    4xUSB 8pins
    HyperRAM 11pins (177MB/s required for 24bit 1080p @30fps)
    microSD 4pins (full MMC speed one can be added to GPIO header)
    28 pins on GPIO header (including console/programming serial)
    I'm not following - I would expect a Raspberry Pi footprint board, to have a 40 pin header ?

    This new 1GHz RISC-V 'Pi variant', includes such a 40 pin header.
    https://beagleboard.org/beaglev

    The P2D2Pi variant layout I did, uses this 40 pin pin mapping (repeat for each 32 port block ). This is 2 layer routable.
         ~~~~~~~~~~~~~~~~ P2D2Pi FLiP and Pi4 Pin mappings ~~~~~~~~~~~~~~~~~
    https://www.element14.com/community/docs/DOC-92640/l/raspberry-pi-4-model-b-default-gpio-pinout-with-poe-header     
    Some GND pins have SB jumpers (NO) for P2 signals, allowing all 32 IO per 40 pin header.
    
           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                              
    
    In order to bring out all 32 io pin per side, 4 pins are always GND and 4 GND pins have jumper options for P2 port pins.
    P2 used this way, can replace a Pi-master (eg for talking to Displays), or it can plug into a Pi as a slave.

  • hinvhinv Posts: 1,255
    Yeah, a 40pin Pi compatible header was the idea, but there are only 28 GPIO's on a Pi. The rest are power and ground. So, yeah, access to a whole host of PiHats would be really nice.
    Having a single board was also the idea, like other Pies to keep costs down. Board sandwich would drive up costs.
    Also having all the amenities that people need to develop as well as maker tools and control down to the bear metal is also the idea.
    What's with that special ID EEPROM? I wasn't thinking there needed to be serial ROM there, just Pin0 and Pin1, unless there is a real good reason for it.
    I was thinking Made in the USA, even if it is more expensive. Maybe @"Ken Gracey" and @cgracey will decide to make it if enough people are interested. They've got everything already drawn, parts sourced in the form of the "P2-ES Eval Board Accessory Set", and have fixed some noise issues(IIRC) that arose with the 1st P2Eval, so to avoid them should be easier..
  • jmgjmg Posts: 15,173
    hinv wrote: »
    What's with that special ID EEPROM?
    I think that ID_SC, ID_SD are for access to a possible ID EEPROM, mounted on the Pi Hats, so the system can boot correctly for a display for example.

  • pik33pik33 Posts: 2,366
    edited 2021-01-14 07:28
    What do you think the user base for bare metal Pi's?
    I am employed to do a commercial project using bare metal Pis making money out of this :)

    You can use OpenGL ES and have a camera attached using Ultibo - and it only needs RPi firmware and a custom kernel7.img which is 2 MB. No system, you can switch the pi off without closing, no SD needed after start, if you don't want to write data on it, you can even hot-swap the SD.

    These ID pins are simply GPIO 0 and 1
    Also, the Pi won't do much for analog without external devices.

    P2 can be such an external device. A "realtime-and-analog hat"
  • hinvhinv Posts: 1,255
    @jmg, yeah, that BeagleV does look pretty sweet.
  • hinvhinv Posts: 1,255
    @pik33 What about cycle accurate timing for signal generation? Is the kernel a real-time OS? Are there any closed source blobs to deal with?
  • pik33pik33 Posts: 2,366
    edited 2021-01-14 18:56
    There is a closed source RPi firmware blob, which is needed to initialize RPi and there is no escape for that, as it runs on VideoCore.

    A cycle accurate stuff can be done, you can free a core from interrupts and system tasks, then it is your core so do what you want with it.

    There is a problem with realtime i/o stuff as the pins are connected via system bus which timings are unpredictable. (delay between set a bit in register and get this bit on your pin) The jitter can be several hundred nanoseconds. It is much lower in one-core Pis. The Propeller is much more predictable and consistent in real time stuff.

    You can use built-in PWMs (2 of them) for signal generation (I made an audio driver for Ultibo as there was no such driver ready - https://github.com/pik33/SimpleAudio )

    After Ultibo start, you got the CPU in hypervisor mode and MMU set 1:1 to physical RAM addresses. All of this can be changed later.

    You have an access to VC4 via its standard mailbox interface, so all things work, including OpenGL ES and camera.

    It is free pascal based but you can link your C code easy; ready made C code can be linked too if it can be compiled to .a file. I made an MP3 player adding ready-made libmad library to it.

    Here is a video channel: https://www.youtube.com/c/UltiboLive/videos



  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2021-01-14 19:19
    My main interest would be USB Video processing if the P2 could handle it.

    Here is a link to a similar type of video processing I am doing:
    https://www.pyimagesearch.com/2020/06/01/opencv-social-distancing-detector/
    I didn't sucker into buying this guys software, so I figured out how to do it on my own through a few nights of intense Google digging.

    As a real world application example ... I am currently working on a project that uses a RasPi for video surveillance and motion detection written in Python with four separate USB video feeds running essentially a video Server on the Pi so that it can be accessed anywhere in the world that you have internet. The PCB that the RasPi is connected to is basically a glorified custom PLC. The PCB firmware, written in pure PIC Assembly language, is capable of monitoring and reading all the listed items below to communicate in simple serial packets to any device capable of constructing a proper packet. In this case a Raspberry PI but it could just as easily be a BASIC STAMP.

    -24 Inputs (each fuse protected at 500mA with visual fuse blown indicator)
    -24 Outputs (each fuse protected at 5A with visual fuse blown indicator)
    -Integrated QUAD USB Port with software controllable Enable/Disable per port
    -Integrated USB2Audio
    -Integrated 20Watt Class D Audio Amplifier
    -External GPS monitoring
    -RH and Temperature sensor (DHT22)
    -Dual Raspberry PI connector with dedicated 5V power supply
    -Integrated SLA battery monitoring and charging
    -Voltage Boost circuit for SLA charging overhead requirement
    -Automatic switching between Battery and Main power in the event of a power failure
    -External Load Cell sensing for monitoring kiosk weight
    -12V input from SLA Battery and Main power (10 Amp fused)
    -Integrated 5V regulator for main board
    -Integrated 3.3V regulator for external GPS board
    -Programmable INPUT alarms: LOW to HIGH, HIGH to LOW, ANY change
    -Main Power failure alarm
    1343 x 1600 - 658K
    4032 x 3024 - 4M
  • 5A outputs, GPS, battery backup, opencv. Hook those 5A outputs onto wheel motors and this kiosk can surely detach from mains and stalk it target until they buy something...

    The load cell is interesting, I never thought of that for a kiosk, but it makes perfect sense to verify successful operation
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2021-01-15 00:07
    I don't want to derail this thread because I think it has merit... To gain any momentum with this you are going to need to think from an industrial/consumer demand perspective.

    @Tubular - Yeah that was a fun board to design and write firmware for.
    Think Automated Propane Kiosk, ICE machines, and other Vending Machines.
    If you could substitute the Raspberry Pi functionality for a Propeller and consider the clientele for such a service you would have a considerable market to contend with.


Sign In or Register to comment.