|
| 1 | +# Setting Up Arduino Development for PicoCalc keyboard |
| 2 | + |
| 3 | +This guide walks you through setting up your Arduino environment to develop for the PicoCalc keyboard (STM32F103R8T6) microcontroller using the [STM32duino Arduino Core](https://github.com/stm32duino/Arduino_Core_STM32). It also includes instructions to manually install the [XPowersLib](https://github.com/cuu/XPowersLib.git) library. |
| 4 | + |
| 5 | +## 1. Install Arduino IDE |
| 6 | +Download and install the latest version of [Arduino IDE](https://www.arduino.cc/en/software) for your operating system. |
| 7 | + |
| 8 | +## 2. Install STM32duino Core via Board Manager |
| 9 | +To use STM32 microcontrollers with Arduino, you need to install the STM32duino core. |
| 10 | + |
| 11 | +### **Steps:** |
| 12 | +1. Open **Arduino IDE**. |
| 13 | +2. Go to **File** → **Preferences**. |
| 14 | +3. In the **Additional Board Manager URLs** field, add the following URL: |
| 15 | + ``` |
| 16 | + https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json |
| 17 | + ``` |
| 18 | +4. Click **OK**. |
| 19 | +5. Open **Tools** → **Board** → **Boards Manager**. |
| 20 | +6. Search for **STM32** and install **STM32 MCU based boards** by STMicroelectronics. |
| 21 | + |
| 22 | +## 3. Select the Correct Board and Settings |
| 23 | +Once the STM32 core is installed, configure the board settings: |
| 24 | + |
| 25 | +1. Go to **Tools** → **Board** → **STM32 Boards** → **Generic STM32F1 series**. |
| 26 | +2. In **Tools** menu, configure the following settings: |
| 27 | + - **Board part number**: `Generic F103R8Tx` |
| 28 | + - **Upload method**: `STM32CubeProgrammer(Serial)` |
| 29 | + |
| 30 | +## 4. Install XPowersLib Manually |
| 31 | +Instead of installing XPowersLib via the Arduino Library Manager, we will manually clone it into the correct location. |
| 32 | + |
| 33 | +### **Steps:** |
| 34 | +1. Open a terminal. |
| 35 | +2. Navigate to your Arduino libraries folder: |
| 36 | + ```bash |
| 37 | + cd ~/Arduino/libraries |
| 38 | + ``` |
| 39 | +3. Clone the XPowersLib repository from the correct branch: |
| 40 | + ```bash |
| 41 | + git clone -b stm32f103r8t6 https://github.com/cuu/XPowersLib.git |
| 42 | + ``` |
| 43 | + |
| 44 | +This ensures the library is correctly placed for the Arduino IDE to detect it. |
| 45 | + |
| 46 | +## 5. Get Code |
| 47 | +```bash |
| 48 | +git clone https://github.com/clockworkpi/PicoCalc.git |
| 49 | +``` |
| 50 | +the keyboard code is in `Code/picocalc_keyboard` |
| 51 | + |
| 52 | +open Code/picocalc_keyboard/picocalc_keyboard.ino in Arduino IDE |
| 53 | + |
| 54 | + |
| 55 | +## 6. Upload Code to PicoCalc Keyboard |
| 56 | +To upload your code: |
| 57 | + |
| 58 | +1. Connect the picocalc board to your PC using a usb type-c cable. |
| 59 | +2. Set the DIP 1 to ON |
| 60 | +3. Long-Press the **Power On** button to power on. |
| 61 | +4. Click the **Upload** button in Arduino IDE. |
| 62 | +5. After upload, set DIP 1 to OFF |
| 63 | + |
| 64 | +Here is a screenshot of working arduino ide: |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +### Libraries version info |
| 70 | + |
| 71 | +* STM32 MCU based boards 2.10.0 |
| 72 | +* XPowersLib 0.2.3 (cuu mod) |
| 73 | + |
0 commit comments