Shop OBEX P1 Docs P2 Docs Learn Events
When You Need Just One Pixel on a P1 — Parallax Forums

When You Need Just One Pixel on a P1

JonnyMacJonnyMac Posts: 8,918
edited 2023-11-05 16:13 in PASM/Spin (P1)

... go with the APA102c. Most people like it because it's SPI (without the CS line) so it can go very fast. Since it has a separate clock signal, it can also go slow -- that is, it can be controlled with interpreted Spin 1.

For work I made a bunch of P2 Accessory type boards, but wanted them compatible with the P1 as I also made an Eval-type board for the P1. On my button board is a single APA102c. Since the protocol is synchronous, I wrote these two methods to set the LED color

pub set_pixel(rgb) : final

  final.byte[3] := $FF                                          ' global = 100%
  final.byte[2] := rgb.byte[1]                                  ' blue
  final.byte[1] := rgb.byte[2]                                  ' green
  final.byte[0] := rgb.byte[3]                                  ' red

  shiftout($00_00_00_00)                                        ' start frame
  shiftout(final)                                               ' color
  shiftout($FF_FF_FF_FF)                                        ' end frame


pri shiftout(value)

  repeat 32
    outa[PIX_D] := value <-= 1
    outa[PIX_C] := 1
    outa[PIX_C] := 0

My P1 Eval board has an SAO (Silly Add-On) header (I'm not a particular fan of cats, that's an SAO that I was gifted at DEF CON last year), a QWIIC port, and a 2mm JST port with the same pins. I'd like to replace that JST with a SEEED Studio type connector but I can't find the raw parts at Digikey (If you know, please share). I added a bigger reset button, have four P2-Accessory type headers, and a 2.5mm JST for external power (a jumper will let me send USB 5v to the headers).

In all we made about 10 different accessory boards to facilitate P1 and P2 development over the coming months.

960 x 960 - 854K

Comments

  • Jon,
    Very interesting, thanks.
    We will be eagerly looking out for "about 10 different accessory boards to facilitate P1 and P2 development over the coming months"

  • JonnyMacJonnyMac Posts: 8,918
    edited 2023-11-05 22:09

    Most are specific to the Laser Tag company I work for, but here are some communications-oriented boards that I suggested Parallax might consider building.

    • XBee (2.4GHz p2p, p2mp)
    • NRF24L01 (2.4GHz p2p, p2mp)
    • ESP-01 (serial to WIFI)
    • XPort (serial to Ethernet)

    The XPort module is a bit expensive, but it saves a lot of code and IO space.

    600 x 241 - 106K
  • @JonnyMac "I'd like to replace that JST with a SEEED Studio type connector but I can't find the raw parts at Digikey (If you know, please share)."

    Hi Jon, I just saw this and thought it will be good to asist you for a change, it is usually the other way arround.

    I have bought these SEEED connectors from Farnell here in the UK before so I had the part number to search for these on Digikey for you.
    They are:-
    Digi-Key Part Number: 1597-1082-ND
    GROVE 2MM 4PIN VERT CONN 10PCS
    https://www.digikey.co.uk/en/products/detail/seeed-technology-co-ltd/110990030/5482560
    They also stock the right-angle version & the matching 4 way cables which I have found very handy, this should display at the bottom that page.

  • Thank you. I finally found those (ironically, while looking for something else) and will be incorporating them into a few development designs.

Sign In or Register to comment.