You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the current stage it works for me. Have fun!
Info below is also in the readme of the board definition directory.
+------v------+
MISO/A6 D6~ 1-+PA6 PA5+-20 D5 SCK/A5
MOSI/A8/TX4 D7 2-+PA7=PB0 PA4+-19 D4~ CS/A4
A9/RX4 D8 3-+PB1 PC19+-18 D17 SWCLK
/RST D9 4-+PB7 PA3+-17 D3~ RX2/A3*
USBDM D10 5-+PC16=PC11 PA2+-16 D2~ TX2/A2
USBDP D11 6-+PC17=PC10 PA1+-15 D1~ A1
GND 7-+VSS PA0+-14 D0~ A0
SWDIO D16 8-+PC18 PC3+-13 D15~ A13
VCC 9-+VDD PA10+-12 D14 SCL/TX1
D12 10-+PA9 PA11+-11 D13 SDA/RX1
+-------------+
*A3, VREF and hardware I2C don't work on CH32X033F8P6 0-series (lot number with the penultimate bit 5 being 0).
Tested features
digitalWrite()/digitalRead() - can use Arduino pin numbers or PAx notation.
analogWrite() - 12-bit resolution, pins marked with ~ in pinout above.
analogRead() - very stable 12-bit resolution, but issues with A3/A0/PADC_VREF
Serial.print() - Tested 115200 bps on Serial2 (PA2/PA3) and Serial1 (PA10/PA11), as set in variant_CH32X033F8P6.h
EEPROM library - may need improvement (updated to support 122 bytes).
Pin PB7 (Arduino pin 9) can be configured as hardware reset /RST using WCH Link Utility. (See issue Hardware reset pin doesn't work on CH32X033 or CH32X035 #123)
Known issues/limitations
Pins PA7/PB0, PC16/PC11 and PC17/PC10 cannot be used for output.
Any signal on A0 seems to show on other ADC pins when disconnected.
A3, PADC_VREF and I2C don't work on CH32X033F8P6 0-series (lot number with the penultimate bit 5 being 0).
To counter missing I2C the Software_I2C library by Seeed Studio is a good alternative, although it needs some changes to improve compatibility in I2C scanning.
openwch/arduino_core_ch32#171
Currently tested to work: CH32V003/CH32V002/CH32V006/CH32X033.
55
+
(CH32VM00X required updated ch32v00x_flash.c from latest EVT code)
44
56
Future releases of this library may support other CH32 processors and allow for larger memory sizes.
45
57
46
58
### **How to use this library**
@@ -150,9 +162,11 @@ The method returns a `uint32_t` value, containing the data0 and data1 bytes and
150
162
---
151
163
152
164
## Features & limitations
153
-
- The first release of this library was made only for the CH32V003 and has been tested on that MCU only. Other members of the CH32 may behave incorrectly or not work at all.
154
-
- This EEPROM implementation for the CH32V003 has only 26 bytes available. When addressing more, things are likely to go wrong. A future release may allow using more pages from the flash memory.
165
+
- The first release of this library was made for the CH32V003, offering 26 bytes of emulated EEPROM. It was tested on CH32V003 and CH32X033.
166
+
. The next release offered 122 bytes of emulated EEPROM on CH32X035/X033 and CH32VM00X (V002/V004/V006/V008). It passed tests on V002, V006 and X033.
167
+
- Other members of the CH32 may behave incorrectly or not work at all. A test on V103 showed issues writing more than the first two bytes.
155
168
- Most CH32 EEPROM methods are the same as their equivalent on regular Arduino's. BEWARE: The begin() and end() methods are like their counterparts for ESP8266/ESP32, but are very different from the begin() and end() methods of EEPROM v2.0 by Christopher Andrews, who introduced them to support C++ iterators. This library follows the begin() convention introduced by the Serial and Wire classes, i.e. to initialize the object.
156
169
157
170
## Disclaimer
158
171
- All code on this GitHub account, including this library is provided to you on an as-is basis without guarantees and with all liability dismissed. It may be used at your own risk. Unfortunately I have no means to provide support.
0 commit comments