Updated Getting started (markdown)

Gabriel Koppenstein committed 2022-08-06 14:09:16 +02:00
1 parent d50390d036
commit 199ba479db
1 file changed
+37 -3
+37 -3
@@ -1,7 +1,8 @@
## Overview ## Overview
In order to make use of this project, you will need the following: In order to make use of this project, you will need the following:
- The RP2040-Decoder board itself - The RP2040-Decoder board itself
- Debugger (e.g. Raspberry Pi Pico or other multi-drop SWD debug interfaces might work as well) - Raspberry Pi Pico or another multi-drop SWD debug interfaces might work as well
- Micro-USB cable
## 1. Where to get the board? ## 1. Where to get the board?
You can of course choose any preferred PCB manufacturer, the PCB is designed to be compliant with JLCPCB.com 2 layer board capabilities (hole diameter/clearence/etc.). Regarding assembly, you can of course assemble the board yourself but I would not recommend it (especially the RP2040 QFN Package is not easy to solder). Alternatively you can order the board fully or partly assembled. All parts are normally available at LCSC.com who supply parts to JLCPCB.com. You can of course choose any preferred PCB manufacturer, the PCB is designed to be compliant with JLCPCB.com 2 layer board capabilities (hole diameter/clearence/etc.). Regarding assembly, you can of course assemble the board yourself but I would not recommend it (especially the RP2040 QFN Package is not easy to solder). Alternatively you can order the board fully or partly assembled. All parts are normally available at LCSC.com who supply parts to JLCPCB.com.
@@ -10,6 +11,39 @@ You can of course choose any preferred PCB manufacturer, the PCB is designed to
In order to generate export the production files (Gerber/BOM/Pick and Place) you need [KiCad](https://www.kicad.org/download/) 6 which is open source. In order to generate export the production files (Gerber/BOM/Pick and Place) you need [KiCad](https://www.kicad.org/download/) 6 which is open source.
## 3. Building and flashing ## 3. Building and flashing
To build the software and run it on the Controller we need to interface the RP2040 using Serial Wire Debug. A detailed guide on how to do this using another RP2040 board (Raspberry Pi Pico) is available here: [Getting started - Pico](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf). Chapter 5 & 6 and Appendix A are the most relevant but you might also refer to chapter 9 if you are using Windows or macOS.
**Alternatively, for windows users, it is recommended to follow the [Quick start guide](https://github.com/gab-k/RP2040-Decoder/wiki/Quick-start-guide-(Windows)).** To build the software and run it on the Controller we need to interface the RP2040 using Serial Wire Debug. This can be done using a Raspberry Pi Pico board.
### Windows
1. Download and install [Pico setup for Windows from ndabas](https://github.com/ndabas/pico-setup-windows) and make sure to check the box for also installing Zadig.
2. Clone and build Pico repos either by checking the box at the end of the setup.
3. Connect Raspberry Pi Pico via USB while holding the reset button. Your Pi Pico should now be visible in Windows explorer as a mass storage device.
4. Navigate to the picoprobe/build subfolder in your installation folder and copy picoprobe.uf2 to your Pi Pico. Alternatively, download the picoprobe.uf2 file from [here](https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html#debugging-using-another-raspberry-pi-pico).The Pi Pico onboard LED should now be on.
5. Navigate to the tools subfolder in your installation folder and open zadig.exe
6. Install the picoprobe driver using zadig.exe as shown in [Getting started with Raspberry Pi Pico - Appendix A - Page 62](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf#%5B%7B%22num%22%3A65%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22XYZ%22%7D%2C115%2C692.106%2Cnull%5D)
7. Connect GND to GND, VBUS to +V, GPIO2 to SWCLK, GPIO3 to SWDIO as shown in the picture below.
<img src="https://github.com/gab-k/RP2040-Decoder/blob/main/docs/svg/Debug_Connections.svg" width="700"/>
8. To finally build and flash, open the Developer Command Prompt for Pico and type the following commands:
* git clone https://github.com/gab-k/RP2040-Decoder.git
* cd RP2040-Decoder
* mkdir build
* cd build
* cmake -G "NMake Makefiles" ..
* nmake
* openocd -f interface/picoprobe.cfg -f target/rp2040.cfg -c "program RP2040-decoder.elf verify reset exit"
### Other OS
Please refer to [Getting started - Pico](https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf). Chapter 3 & 5 and Appendix A are the most relevant but you might also refer to chapter 9.1 if you are using macOS.
## 4. Wiring and initial commissioning
<img src="https://github.com/gab-k/RP2040-Decoder/blob/main/docs/svg/Wiring_diagram.svg" width="700"/>
The illustration above shows an example wiring configuration.
Another important note is that when the decoder is put into operation for the first time, it automatically performs a motor calibration, which is required for feedforward control. The calibration takes about one to two minutes.