Anson Zhao caf1cb2360 init commmit. 6 years ago
..
gd32f3x0_it.c caf1cb2360 init commmit. 6 years ago
gd32f3x0_it.h caf1cb2360 init commmit. 6 years ago
gd32f3x0_libopt.h caf1cb2360 init commmit. 6 years ago
main.c caf1cb2360 init commmit. 6 years ago
readme.txt caf1cb2360 init commmit. 6 years ago

readme.txt

/*!
\file readme.txt
\brief description of the TIMER2 PWM input capture demo
*/

/*
Copyright (C) 2017 GigaDevice

2017-06-06, V1.0.0, firmware for GD32F3x0
*/

This demo is based on the GD32350R-EVAL board, it shows how to
use the TIMER peripheral to measure the frequency and duty cycle of an external
signal.

The TIMxCLK frequency is set to systemcoreclock 84MHz(GD32F330) or 108MHz(GD32F350),
the prescaler is 42000(GD32F330) or 54000(GD32F350) so the TIMER2 counter clock is 2KHz.

The external signal is connected to TIMER2 CH0 pin (PB4).
The rising edge is used as active edge.
The TIMER2 CH0CV is used to compute the frequency value.
The TIMER3 CH1CV is used to compute the duty cycle value.

The available frequence of the input signal is ranging from 0.03Hz to 2KHz.
You can use USART to watch the frequency and duty cycle of the input signal.
The USART is configured as follow:
- BaudRate = 115200 baud
- Word Length = 8 Bits
- One Stop Bit
- No parity
- Hardware flow control disabled (RTS and CTS signals)
- Receive and transmit enabled