saawsm / swx

An E-Stim driver for the RP2040 microcontroller.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

swx - E-Stim Driver Firmware

swx is an E-Stim driver for the RP2040 microcontroller (e.g. Raspberry Pi Pico). Taking advantage of the PIO interface, it handles the low-level control and pulse generation of the output channels. Control of the driver is done via I2C. Direct pulses can be sent, or parameters changed. Such as frequency, pulse width, power level, etc.

Hardware Requirements

swx assumes that each E-Stim channel has the following IO:

  • Pulse A/B - Two digital GPIO pins used to create the actual E-Stim pulse.
  • Level1 - Used to set the output power of the channel.
  • Sense1,2 - Used to measure channel current, allowing for calibration and real-time fault monitoring.

*1: Hardware abstracted
*2: Supports sharing the same IO between channels

View the SW32 or SW22 projects for example hardware.

Getting Started

git clone -b master https://github.com/saawsm/swx

Use -b develop instead for the develop branch of swx. The dev branch can be unstable, use with caution.

Toolchain Setup

Ensure you can build C/C++ projects written using pico-sdk.

Building

Board hardware configurations can be found in the boards folder.

mkdir build
cd build
cmake -DPICO_BOARD=<board> ..
make -j4

Replace <board> with the board name (e.g. SW22).

Built firmware named swx.uf2 or swx.bin will be located in the build folder.

About

An E-Stim driver for the RP2040 microcontroller.

License:GNU General Public License v3.0


Languages

Language:C 96.3%Language:CMake 3.7%