Skip to content

Robot-Sticks/progstick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Progstick

Model board progsticks 0.1.rv1 v73

Progstick 0.1 PINOUT

Pinout PDF

Technical characteristics

  • 32-bit RISC-V architecture
  • Clock speed up to 48 MHz.
  • 20KB flash memory for code.
  • 4KB SRAM.
  • 23 GPIO pins.
  • 10-bit ADC
  • Analog comparators
  • PWM
  • UARTs
  • SPI
  • I2C
  • Timers
  • Watchdog timer
  • Support for low power and sleep modes.

Arduino IDE

Note ONLY Windows

How to use

You can add this software package directly on the IDE through the Arduino Boards Manager.

Add the following link in the "Additional Boards Managers URLs" field:

https://github.com/openwch/board_manager_files/raw/main/package_ch32v_index.json

Then you can search for "wch" through the "board manager", find the installation package, and install it.

Blink

#define LED_PIN D5

void setup() {

  pinMode(LED_PIN, OUTPUT);

}

void loop() {
  digitalWrite(LED_PIN, LOW);

  delay(1000);
  digitalWrite(LED_PIN, HIGH);
  delay(1000);

}

Motor

#define LED_PIN PC3
#define ML1_PIN PC0
#define ML2_PIN PC7
#define M1_PIN PC6
#define M2_PIN PC5

void setup() {

  pinMode(LED_PIN, OUTPUT);
  pinMode(ML1_PIN, OUTPUT);
  pinMode(ML2_PIN, OUTPUT);
  pinMode(M1_PIN, OUTPUT);
  pinMode(M2_PIN, OUTPUT);

}

void loop() {
  digitalWrite(LED_PIN, LOW);  
  digitalWrite(ML1_PIN, HIGH);  
  digitalWrite(ML2_PIN, LOW);  
  digitalWrite(M1_PIN, HIGH);  
  digitalWrite(M2_PIN, LOW);  
  delay(1000);                     
  digitalWrite(ML1_PIN, LOW);  
  digitalWrite(ML2_PIN, LOW); 
  digitalWrite(LED_PIN, HIGH); 
  digitalWrite(M1_PIN, LOW); 
  digitalWrite(M2_PIN, LOW); 
  delay(1000);
}

Installation other Operating System

Note Testing

Prerequisites

Cargo

Cargo is the package manager for the Rust programming language. It is included by default when you install Rust.

Installing Cargo and Rust

To install the Rust package manager (Cargo), follow the instructions for your operating system:

-- Linux and MacOS

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Closed and open Check if the installation worked:

cargo --version

-- Windows

  1. Download the installer at https://www.rust-lang.org/tools/install and run it.

  2. Open the command prompt and check the installation with:

cargo --version
  1. If it does not work, manually configure the environment variables:
CARGO_HOME=%USERPROFILE%.cargo
PATH=%CARGO_HOME%\bin
  1. Try checking the installation again with cargo --version.

If you have any issues installing, open a ticket with the error.

- Hardware

WCHLink-E (Only work with WCHLink-E, no WCHLink). Buy in Aliexpress

Install wlink - WCH-Link(RV)

cargo install --git https://github.com/ch32-rs/wlink

or download a binary from the Nightly Release page.

Note On Linux, you should install libudev and libusb development lib first. Like sudo apt install libudev-dev libusb-1.0-0-dev on Ubuntu.

Usage

wlink flash --address 0x08000000 firmware.bin

Note The firmware.bin file must be in the same directory where the command is executed.

> wlink flash --address 0x08000000 firmware.bin
12:10:26 [INFO] WCH-Link v2.10 (WCH-Link-CH32v003)
12:10:26 [INFO] Attached chip: CH32v003(0x30700518)
12:10:26 [INFO] Flashing 8068 bytes to 0x08000000
12:10:27 [INFO] Flash done
12:10:28 [INFO] Now reset...
12:10:28 [INFO] Resume executing...

Compile w/ Eclipse - MounRiver Version

Windows - MounRiver Version

http://www.mounriver.com/download#:~:text=MounRiver_Studio_Setup_V191

Mac

  cd /opt && unzip ~/Downloads/MRS_Toolchain_MAC_V170/xpack-riscv-none-embed-gcc-8.2.0.zip
  export PATH=/opt/xpack-riscv-none-embed-gcc-8.2.0/bin:$PATH
  git clone https://github.com/unixbigot/ch32v_evt_makefile_gcc_project_template.git -b macos_generate_fix
  cd ch32v_evt_makefile_gcc_project_template
  ./generate_project_from_evt.sh ch32v003f4u6
  make

Reference

Note Everything is very recent, we are testing.

Linux

Download x64

Download x86

About

Model board progsticks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors