home.social

#raspberry-pi-pico — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #raspberry-pi-pico, aggregated by home.social.

fetched live
  1. Kızmamı anlamsız bulan olabilir!

    Kızdığım şey şu ki Python Python Python diye kartı övüp reklamını yapıyorlar.

    Fakat iş yapmaya gelince kart Ardiuno ekosistemine sığınıyor!

    Python Python Python diye gürültü yapıp bizi de boşuna aldatmayın o zaman!

    Ben #Arduino ile çok mutluydum!

    Bu #RaspberryPiPico ile MicroPython kodlayacağım diye çok heveslenmiştim.

    Fakat azıcık yüklü iş yapmaya gelince Arduino tarafına kaçmak istiyor!

    Ben seni #MicroPython için aldım!

  2. Kodlama ile oynamak istiyorum ve mikrodenetleyici tarafında yeni ürünler var mı diye baktım ve içlerinden bir tek bu ilgimi çekti

    #RaspberryPiPico için tasarlanmış, ama MicroPython ile çok basit, Atari seviyesinde oyun yapılmayacaksa #C /C++ yâni #Arduino istiyor!

    Ne anladım ben bundan?

    O zaman Arduino ile çalışacak şekilde tasarlasaydınız

    Python ile bir Led Matrix ekranı bile sürülemiyorsa yuh artık!

    Sanırım @adafruit 'in CircuitPython'u ile ancak basit Atari oyunları herhâlde yapılabilir!

  3. İnanamıyorum ya!

    Kaç yıl geçti bu Raspberry Pi Pico'dan hâlâ bir halt olmuyor!

    Hafifletilmiş C/C++ için Arduino'yu,
    MicroPython için ise Raspberry Pi Pico'yu kullanmayı hedeflemiştim.

    Arduino için Arduino IDE,
    MicroPython için Thonny kullanacaktım.

    Fakat bu Pico ile bir halt yapamıyorum!

    Şuna bak!

    MicroPython ile basit bir led matrix saat ekranı bile süremiyor ve onun için bile C/C++ ve herhâlde Arduino IDE istiyor!

    #Arduino #RaspberryPiPico

    waveshare.com/wiki/Pico-RGB-Ma

  4. İşte benim #RaspberryPiPico donanımım.

    Ona en güzelinden çoklayıcı ve ekranlar aldım, ama o TFT LCD Ekranda MicroPython ile ancak #FrameBuffer ile basit yazı ve şekiller çizebilmiştim!

    Python ekran kütüphânesi yoktu!

    Renk kodları bile tersti!

    Şu anda durum nasıl bilmiyorum, ama #RaspberryPiPico2W daha güçlü olsa da hâlâ bir ekranı #MicroPython ile sürebileceğini sanmıyorum!

    Yine de iki yıldan fazla oldu ve birileri güzel bir python ekran kütüphânesi yazmış olabilir!

    mastodon.online/@aslankemalasl

  5. Yaza doğru bende iki şey tetikleniyor

    Biri uzun yürüyüşler yapmak, diğeri ise elektronik ile uğraşmak yada kodlama yapmak

    #RaspberryPiPico'dan iki tâne almıştım. Birini yaktım, bir tâne kaldı.

    Yakın tarihlerde çıkan #RaspberryPiPico2W için #MicroPython ile sürülebilen güzel ve geniş bir ekran çıktımı diye baktım, ama maalesef hâlâ yok!

    Hâlâ ancak C++ ile kullanılabiliyor!

    Bu sene de Pico ile oynayamayacağım!

    Kodlama yapma hevesim ise dilin sürekli değişip durması yüzünden #Python ile kaçtı

  6. That took quite a lot of battling but I got the new #FujiNet proto board to come up on CoCo! I jumpered the pins for now to make it so all the GPIOs are in the lower 32bit window to make it easier to start from the PicoROM code.

    #3DPrinted #KiCad #Fusion360 #MSX #RaspberryPiPico #TRS80CoCo #RetroComputing #VintageComputing #Electronics

  7. There's now a CoCo version of the case. I added some extra standoffs so the case can be used as a jig while soldering the two boards together. #3DPrinted #KiCad #Fusion360 #MSX #RaspberryPiPico #TRS80CoCo #FujiNet #RetroComputing #VintageComputing #Electronics

  8. This is pretty neat! I can export a PCB from #KiCad as .step and import it directly into #Fusion360 so I can design my #MSX case around it. Too bad it doesn't export the silkscreen layer though. #RaspberryPiPico #TRS80CoCo #FujiNet #RetroComputing #VintageComputing #Electronics

  9. This curriculum has been designed to take your students from basic microcontroller hardware interfacing to sophisticated microcontroller programs using ARPS-2 (Arduino UNO), BEAPER Nano (Arduino Nano ESP32), and BEAPER Pico (Raspberry Pi Pico). Get the activities here: github.com/mirobotech

    #STEMeducation #Arduino #RaspberryPiPico #Programming #MicroPython

  10. It's alive! For a while there I thought my #RaspberryPiPico Core2350B wasn't working. Turns out that setting things up needs to be a lot more explicit than it was on the RP2040. #TRS80CoCo #MSX #FujiNet #RetroComputing #VintageComputing #KiCad #Electronics

  11. Showed up this morning, for less than $200 I got:
    - an original #commodore64 vintage keyboard working via USB thanks to a #raspberryPiPico and some c code
    - a brand new c64 mechanical keyboard mod also functioning over the same usb micro controller (plus +5v bus for the blue lights)
    - the #commodore64ultimate starlight case
    After some local free 3d printing and upcycle reselling, I'll have paid less than 50% MSRP. Hype to put a #raspberrypi 5, flex atx psu, and mid range GPU in this beauty.

  12. Last night was #robot arm class in Physical Computing & the #MakerSpace was electric with #CircuitPython #RaspberryPiPico #3dprinting arms battling to pick up candy! Learn such badassery at YouTube.com/@BuildWithProfG

  13. RE: oldbytes.space/@thelastpsion/1

    And the results are in!

    1. Pico C
    2. Rust
    3. Free Pascal
    4. Joint with Pico C++, MicroZig and Yarg.

    So, what am I going to do? Well, I'm leaning towards porting the existing Arduino C code to the Pico C SDK. I'm currently using one class for encapsulation and abstraction, but I could replace that with structs and static functions. I'm not a great C programmer, but I'm pretty comfortable with it, so it makes sense

    However, before I do that, I see a bigger challenge of getting a good setup without using VS Code. I've been using #NeoVim for a while now, and I'd like to get a comfortable setup using that on #Linux.

    So, I'm going to try to build Blinky projects for at least Pico C, Rust and Free Pascal, using Linux and NeoVim. Hopefully this will give me a better feel for how well these languages actually suit me. I've never done any Rust before, either, so that's going to be quite the learning curve!

    If I have time, I'm going to give Yarg a go, too, because I think the premise is really cool. If I'm on a roll, I'll try #MicroZig too.

    And if I really feel like I have the capacity, I'll port the code to one of these other languages.

    I'm acutely aware of all the other projects I've given myself to do, such as the SIBO SDK and other small Psion-related projects, not to mention $dayjob and $reallife. So we'll see how things go!

    #Pascal #FreePascal #ObjectPascal #RustLang #YargLang #RaspberryPiPico #PiPico #PiPico2 #RP2040 #RP2350

  14. RE: oldbytes.space/@thelastpsion/1

    Only a couple of hours left for this poll.

    C is clearly out in front for my embedded project, but Rust and Pascal aren't far behind!

    #RaspberryPiPico #PiPico2 #PiPico #RP2040 #RP2350

  15. PIO on the Raspberry Pi Pico – Part 2

    Having got all the theory out of the way in PIO on the Raspberry Pi Pico now is the time to actually start programming. Whilst I have the option of using the C/C++ SDK or one of the Python variants, I’m particularly interested in getting it going from within the Arduino environment, just because that is where I do pretty much all of my other microcontroller messing about.

    I’m not using the official Arduino for Pico support though, I’m using Earl Philhower’s version from here: https://github.com/earlephilhower/arduino-pico

    Pico Arduino Getting Started

    Before getting too far into PIO land, there are a few things to note about using the unofficial Arduino Pico core with the Raspberry Pi Pico.

    On first boot, hold down the BOOT switch and the Pico will be detected as a “UF2 Board”. This will allow the first upload to take place (more here). I’ve selected “Raspberry Pi Pico” or “Raspberry Pi Pico 2” as appropriate for the board.

    Prior to the first download, the configuration should set the Debug Port to Serial. Then once the first sketch is downloaded the board can be redetected via a serial link which will allow both Serial.print() and automatic reset on download of new sketches.

    Aside: there are three serial ports (more here):

    • Serial – the USB serial port – the one used here
    • Serial1 – UART0
    • Serial2 – UART1

    Here is a simple starter program to make sure everything is working:

    void setup() {
    Serial.begin(9600);
    pinMode (LED_BUILTIN, OUTPUT);
    }

    unsigned counter;
    void loop() {
    Serial.println(counter);
    counter++;
    delay(1000);
    digitalWrite (LED_BUILTIN, (counter & 1));
    }

    Assuming everything is working, every second the LED will flash on or off and the counter value will be printed to the serial monitor.

    Hello PIO

    I’m starting off with a simple pulse on a GPIO pin and will be using the online PIO assembler from https://wokwi.com/tools/pioasm to build it.

    My PIO Source:

    .program pulse

    .wrap_target
    set pins, 1 [3] // 4 cycles
    set pins, 0 [11] // 12 cycles
    .wrap

    % c-sdk {
    static inline void pulse_program_init(PIO pio, uint sm, uint offset, uint pin) {
    pio_sm_config c = pulse_program_get_default_config(offset);

    // set_base=pin, count=1
    sm_config_set_set_pins(&c, pin, 1);
    pio_gpio_init(pio, pin);

    // pins_base=pin, pin_count=1, is_out=true
    pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, true);

    // 440 Hz pulse over 16 cycles
    float div = (float)clock_get_hz(clk_sys) / (440.0 * 16.0);
    sm_config_set_clkdiv(&c, div);

    pio_sm_init(pio, sm, offset, &c);
    pio_sm_set_enabled(pio, sm, true);
    }
    %}

    The online assembler turns the above into the following, which is pasted into a pulse_pio.h file within an Arduino sketch.

    // -------------------------------------------------- //
    // This file is autogenerated by pioasm; do not edit! //
    // -------------------------------------------------- //

    #pragma once

    #if !PICO_NO_HARDWARE
    #include "hardware/pio.h"
    #endif

    // ----- //
    // pulse //
    // ----- //

    #define pulse_wrap_target 0
    #define pulse_wrap 1

    static const uint16_t pulse_program_instructions[] = {
    // .wrap_target
    0xe301, // 0: set pins, 1 [3]
    0xeb00, // 1: set pins, 0 [11]
    // .wrap
    };

    #if !PICO_NO_HARDWARE
    static const struct pio_program pulse_program = {
    .instructions = pulse_program_instructions,
    .length = 2,
    .origin = -1,
    };

    static inline pio_sm_config pulse_program_get_default_config(uint offset) {
    pio_sm_config c = pio_get_default_sm_config();
    sm_config_set_wrap(&c, offset + pulse_wrap_target, offset + pulse_wrap);
    return c;
    }

    static inline void pulse_program_init(PIO pio, uint sm, uint offset, uint pin) {
    pio_sm_config c = pulse_program_get_default_config(offset);
    // set_base=pin, count=1
    sm_config_set_set_pins(&c, pin, 1);
    pio_gpio_init(pio, pin);
    // pins_base=pin, pin_count=1, is_out=true
    pio_sm_set_consecutive_pindirs(pio, sm, pin, 1, true);
    // 440 Hz pulse over 16 cycles
    float div = (float)clock_get_hz(clk_sys) / (440.0 * 16.0);
    sm_config_set_clkdiv(&c, div);
    pio_sm_init(pio, sm, offset, &c);
    pio_sm_set_enabled(pio, sm, true);
    }

    #endif

    Adding the appropriate additional PIO initialisation code to my previous test sketch now gives me the following complete code:

    #include <PIOProgram.h>
    #include "pulse_pio.h"

    #define PULSE_PIN 2

    void setup() {
    Serial.begin(9600);
    pinMode (LED_BUILTIN, OUTPUT);
    PIO pio;
    uint sm, offset;
    if (!pio_claim_free_sm_and_add_program(&pulse_program, &pio, &sm, &offset)) {
    for (;;) {
    Serial.print("No PIO or SM");
    delay(10000);
    }
    }
    pulse_program_init(pio, sm, offset, PULSE_PIN);
    }

    unsigned counter;
    void loop() {
    Serial.println(counter);
    counter++;
    delay(1000);
    digitalWrite (LED_BUILTIN, (counter & 1));
    }

    Notes:

    • As I’m using “set” in the pio program I need to use the “set” group of pins in the various API calls – hence the use of sm_config_set_set_pins() which configures which pins to use with the set command. In this case, just one pin determined by the “pin” parameter.
    • I’m using the wait [] instructions to put the pulse HIGH for 4 cycles and LOW for 12 cycles, giving 16 cycles in total.
    • The waiting cycles have to account for the single cycle of the actual executed instruction, hence using [3] and [11].
    • When setting the clock divisor, I’m dividing the system frequency by my required frequency * 16 as there are 16 cycles in the complete program.
    • When I had a single cycle HIGH and 3 cycles LOW and then used the value 440.0 * 4.0 I wasn’t getting an accurate frequency (I was getting ~1.9K rather than 440). I’m guessing (I haven’t done the maths) this was overflowing the integer part of the divisor maybe.

    The PIO and state machine used are allocated dynamically by the system using pio_claim_free_sm_and_add_program(). The first version had hard-coded PIO 0, state machine 0:

      PIO pio = pio0;
    int sm = 0;
    uint offset = pio_add_program(pio, &pulse_program);

    The final result can be seen on the oscilloscope trace below.

    Conclusion

    I’ve now been through the theory and a real, albeit simple, application and am feeling like I understand a lot more what is going on now. I still am somewhat bewildered by the huge array of API calls and do feel like they could be grouped together somehow to make them more accessible to people who haven’t swallowed the entire chip datasheet and SDK guidebooks…

    But yes, I’m slowly starting to feel like I’m getting to grips with PIO a bit more now. I want to do something that now grabs some input from the GPIO and sticks it into memory, ideally using the DMA system, so that is probably where I’ll go next.

    Kevin

    #pio #raspberryPiPico #rp2040 #rp2350
  16. It has come to my attention that this exists.

    github.com/tabemann/zeptoforth

    I can't update my poll without resetting the results. But, uh, I guess it's an option now?

    #RaspberryPiPico #RP2040 #Forth

  17. Poll for a bit of fun. Feel free to boost!

    I've got a #RaspberryPiPico project written in #Arduino C. It talks to a Psion SSD and dumps the contents over USB serial. It can (theoretically) act as a full controller to tag an SSD, too.

    I feel like I should port it to the proper Pico SDK. But I also know there are other options. And I'm intrigued to know what Fedi would do.

    What should I rewrite this firmware in?

    #RP2040 #RP2350 #PiPico #PiPico2