This repository has been archived on 2025-11-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files

47 lines
2.5 KiB
Markdown

## Programming Software Setup
### Dev Envitonment
Macos 12 on a dual core laptop. An RPi Pico, programming over usb cable. Some wires, buttons, LEDs and resistors I *borrowed* from lab.
### Code Editor
~~Instead of using Arduino IDE, I use Visual Studio Code for programming. I use it because I (seem to) write code more efficiently and because I have it customized it to my liking.~~
I use the new Zed Editor. I am transitioning from using VSCode with lots of plugins to a minimilist and lightweight setup and I am using this project to help familiarize with Zed.
To help my migration to Zed, I ported my custom dark theme, called Subtle Colors, from VSCode. I also use vim mode in vscode and I am glad it is builtin to Zed.
### Project Generation
A C Pico project requires additional files to handle compilation: CMakeList.txt and pico_sdk_import.cmake, templates of both available in the installed pico sdk. To automate this, I am using [Pico Project Generator](https://github.com/raspberrypi/pico-project-generator) to generate the boilerplate code for the project. Most of the options are left default. The only changes are: `Console over USB` and `Create VSCode Project` are enabled.
<img src="https://a.l3n.co/i/722InF.md.png" width="300">
### Uploading Code
The C code gets compiled to a `.UF2` binary file. This file should be uploaded to the pico.
Currently I program the pico over USB connection, and to do so,
- the USB has to be unplugged
- The button on the board has to be held down to put the board into programming mode
- USB has to be plugged back in and the button can be released
This will wear-out the port upon time. To solve this, the `RUN` pin #30 can be pulled down/connect to `GND` to reset the board. I use a button to acomplish that, from now on called the reset button, as seen below.
<img src="https://b.l3n.co/i/722tOD.png" width=300>
So uploading the code requires following steps:
- Press and hold reset button (2)
- Press and hold bootloader button (1)
- Release reset button (2)
- Release bootloader button (1)
This will mount the pico as a storage device, to where the generated `.UF2` file should be copied.
## Hardware Setup
I have the RaspberryPi Pico Non-W variant: without the wireless chip. I soldered male jumper headers and mounted it onto a large breadboard. I am using solid copper wires for connections because they stay in set shape.
I am also using a button as mentioned above to upload the program. This will be my standard setup for the rest of the guides.