openwch / arduino_core_ch32

Core library for CH32duino
229 stars 41 forks source link

Hardware reset pin doesn't work on CH32X033 or CH32X035 #123

Open zane-c opened 2 weeks ago

zane-c commented 2 weeks ago

Sorry if this is the wrong repo to be asking this question. I have a few boards with the CH32 chips. My reset circuit works fine for the v003 chips, but doesn't work for the X03x chips. I am wondering if this is an issue with the defaults being set in the Arduino core for these chips or something else completely.

Both appear to have identical reset circuits in the datasheets. But I did find it odd that one is labeled RST and one is NRST. ~Shouldn't RST be active high?~

My circuits for reference:

Sorry again for the noob question. I am not an embedded engineer.

maxint-rd commented 2 weeks ago

At first look your circuit seems fine. Reset is usually active low indeed. Those NRST/RST labels may cause some confusion.

My one case where RST was not working was when I used the particular pin for something else. I see in your schematic that for the X035, the RST pin uses PC3. Are you sure your sketch doesn't use PC3 for something? Could it be that PC3 is already initialized for something else by the core? Unfortunately I don't have any X035 to test with...

zane-c commented 1 week ago

Thanks @maxint-rd for taking a look and for the suggestion. I can confirm my sketches don't have any handling of the PC3 pin. I will keep poking through the core's code to see if I can find anything that is initializing that to a non-default.