Coder Social home page Coder Social logo

mtkos / ch32v203-minimal Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 18 KB

A series of small programs, showing how to program ch32v203 boards without using proprietary software

License: MIT License

Makefile 12.52% Assembly 7.95% C 79.53%
ch32v203

ch32v203-minimal's Introduction

ch32v203-minimal

This repository is a companion to my ch32v003-minimal repository. The programs are similar. Some differences occur because:

  1. The board exposes different GPIO pins. For instance, ch32v003 does not have GPIOB, whereas my ch32v203 has an onboard LED at pin PB2, which, of course, is nice to use.

  2. Each GPIO has 16 lines, instead of only 8 for ch32v003. For the extra lines there is an extra configuration register CFGHR.

  3. The interrupt numbers are different. Refer to table 9-2 in the reference manual (not table 9-1, which is for ARM-based devices, this cost me a lot of time).

  4. ch32v203 has 64kB of flash, instead of only 16kB for ch32v003. For this reason it is easier to use the picolibc library.

  5. ch32v003 has a 24MHz high-speed internal oscillator (HSI). Using the PLL, we can double this frequency to get a 48MHz clock. ch32v203 has a 8MHz internal oscillator. However, the PLL can increase this frequency up to 18 times, giving a 144MHz clock. By default, the PLL uses half of the HSI frequency. To get full 144MHz you need to configure the extended configuration register, documented in chapter 33 of the reference manual.

  6. ch32v203 has a QingKeV4 processor instead of QingKeV2. It has, for example, more registers, and also instructions for integer multiplication and division. Therefore, we use -march=imac (or ima if we want to avoid compressed instructions, or imac_zicsr).

Remarks

The following documentation has been used, in addition to the ones mentioned in the ch32v003-minimal repository:

[QingKeV4] The QingKeV4 Microprocessor Manual, can be obtained from https://www.wch-ic.com/downloads/QingKeV4_Processor_Manual_PDF.html.

[CH32v203] The CH32V203 Reference Manual, can be obtained from https://www.wch-ic.com/downloads/CH32FV2x_V3xRM_PDF.html.

ch32v203-minimal's People

Contributors

mtkos avatar

Stargazers

Cronomantic avatar Vasco Santos avatar

Watchers

 avatar

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.