openwch / arduino_core_ch32

Core library for CH32duino
267 stars 52 forks source link

How to Use UART with CH32V003F4P6 in Arduino IDE? #163

Open Nikitanagar opened 3 hours ago

Nikitanagar commented 3 hours ago

Hello everyone, I am new to the CH32V003F4P6 microcontroller and am trying to get started with it using the Arduino IDE. Specifically, I want to use the UART functionality to send and receive data over serial communication.

I have the following questions:

  1. How can I configure UART on the CH32V003F4P6 using the Arduino IDE?

    • I am familiar with using UART on other microcontrollers (like the ATmega328P), but I am unsure of the specific setup for the CH32V003F4P6.
    • Are there any specific libraries or configuration steps that I need to follow for this chip in Arduino?
  2. Is there any specific setup needed in the Arduino IDE for the CH32V003F4P6?

    • I have installed the CH32V003 board package in the Arduino IDE, but I am unsure about the settings to use for proper communication.

Any help or examples would be greatly appreciated! Thank you in advance!

maxint-rd commented 2 hours ago

How can I configure UART on the CH32V003F4P6 using the Arduino IDE?

You can just use it, same as regular Arduino, but make sure to use the latest code of the master branch, since the released version lacks many improvements. Also look into the PR's to find more improvments. I submitted PR #145 to add interrupt driven serial for better communication and support of Serial.available() and Serial.peek().

Is there any specific setup needed in the Arduino IDE for the CH32V003F4P6?

Yes. Use the released core, then update with improvements (see above).