Giter VIP home page Giter VIP logo

swx's Introduction

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.

swx's People

Contributors

saawsm avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

swx's Issues

Add continuous feedback sampling as channel fail safe

Use internal ADC (with high sampling rate) to log calibration curve for expected feedback values. It would most likely require #2 to be implemented.

Compare this curve to the current channel feedback, if it differs, activate fail-safe and turn off power.

Primary useful if the PFET fails closed, since the channel would immediately go full power. It would also prevent run away conditions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.