Skip to content

Instantly share code, notes, and snippets.

@hasumikin
Last active October 29, 2024 05:37
Show Gist options
  • Save hasumikin/b0b847b46e0f8605d873251abd1f2eda to your computer and use it in GitHub Desktop.
Save hasumikin/b0b847b46e0f8605d873251abd1f2eda to your computer and use it in GitHub Desktop.

Setup, general information and trouble shooting

Important Notes

(Also read Trouble Shoot)

Laptop Security Settings

If your laptop is configured to prohibit writing to USB memory devices, likely due to your company's security policy, it will not function in the workshop😣

Mac Issues

  • From our experience, Mac laptops occasionally encounter issues during the workshop
  • We are unsure of the specific models that may have problems. Both Intel Macs and M1/M2/M3 Macs have had issues in the past
  • Please be aware that we will not be able to know if your Mac will work until the day of the workshop

Install R2P2 into Raspi Pico

  • Download the latest R2P2-FLASH_MSC-*.uf2 from GitHub https://github.com/picoruby/R2P2/releases (Of course, unzip it)
     

  • Connect Pi Pico and PC while\npressing the BOOTSEL button

    • You'll find RPI-RP2 drive in file manager (File Explorer or Finder)
       
  • Drag & drop R2P2-*.uf2 into RPI-RP2 drive

  • You'll find "R2P2" drive (sometimes naming the drive fails and it shows "USB Drive" or something like that. But it would be working anyway)

  • Open a proper serial port on the terminal emulator

    If you use don't know how to use terminal emulator, google (,chatgpt, or claud) to figure out the way to open connection.

  • If you could see a screen like this, congrats, now you are at the gate🎉

  • Lastly, I would like you to stargaze at the PicoRuby repo: https://github.com/picoruby/picoruby 🌟

Terminal Emulator

Example of using screen command

> ls /dev/tty.*
It shows a device like "/dev/tty.usbserial-*" or "/dev/tty.usbmodem*", then
> screen /dev/tty.usbserial-XXXXXXXX 9600

In Ubuntu, you may need to add yourself to dialout group:

sudo usermod -a -G dialout $USER

Anyway, ChatGPT will help you!

Note that the baudrate has to be 9600.

About Raspi Pico's Pin Number

  • Note that "pin-out number" (from 1 to 40) and "GPIO number" (from GP0 to GP28) are different
  • In R2P2, you have to use "GPIO number" Raspi Pico pin out

Today's parts

If something's missing or broken during the workshop, ask a staff.

About the Breadboard

   +----+---+---+---+---+----+---+---+---+--...+-+---+-----+
 - |  - | - | - | - | - |    | - | - | - |  ...  | - | -   |  GND (Power Rail)
 + |  + | + | + | + | + |    | + | + | + |  ...  | + | +   |  VDD (Power Rail)
   ---------------------------------------------------------
   + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10+...+ 28+ 29+ 30+  Column Number
 j |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 i |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 h |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 g |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 f |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
   +---+---+---+---+---+---+---+---+---+---+...+---+---+---+  Central Divide
 e |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 d |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 c |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 b |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
 a |   |   |   |   |   |   |   |   |   |   |...|   |   |   |  Component Area
   + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10+...+ 28+ 29+ 30+  Column Number
   ---------------------------------------------------------
 - |  - | - | - | - | - |    | - | - | - |  ...  | - | -   |  GND (Power Rail)
 + |  + | + | + | + | + |    | + | + | + |  ...  | + | +   |  VDD (Power Rail)
   +----+---+---+---+---+----+---+---+---+--...+-+---+-----+
  1. Power Rails:

    • The top and bottom rows marked with "-" (GND) are internally connected horizontally.
    • The rows next to them marked with "+" (VDD) are also internally connected horizontally.
    • These provide easy access to power and ground throughout your circuit.
  2. Component Area:

    • The middle section (rows a to j) is divided into two halves by the central gap.
    • In each half, the five holes in each column ("a, b, c, d, e" or "f, g, h, i, j") are internally connected vertically.
    • Each column (1 to 30) is independent vertically.
    • For example, all five holes (from a to e) in column '1' are connected, but they're not connected to holes of column '2'.
  3. Central Divide:

    • The gap in the middle serves as an isolation point between the two halves of the component area.
    • This allows you to place integrated circuits (ICs) or other multi-pin components across the gap.

This connection layout allows for flexible circuit design:

  • You can easily distribute power using the top and bottom rails.
  • Components can be placed across the central divide.
  • Connections between components are made by placing their leads in the same row or by using jumper wires.

Remember, understanding these connections is key to successfully building circuits on a breadboard without unintended short circuits or open connections.

Trouble Shoot

If R2P2 hang up (sorry for a bug😓)

  • Plug off, wait 3 seconds, and plug in again

NoMethodError???

Picoruby is a small implementation for limited resources. It has less classes and methods than your usual CRuby. You can check API documentation here: https://picoruby.github.io/Array.html

If you app.rb doesn't work as you wish and you get lost control of Raspi Pico

  • At startup of R2P2, pressing "S" key will skip running the app.rb and R2P2 shell will be in control

You don't know what is app.rb? No worries, we'll learn it later :)

When you're stuck in a dead end, reset it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment