readme.txt 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*!
  2. \file readme.txt
  3. \brief description of the TIMERs cascade synchro demo
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-06-06, V1.0.0, firmware for GD32F3x0
  8. */
  9. This demo is based on the GD32350R-EVAL board, it shows how to
  10. synchronize TIMER peripherals in cascade mode.
  11. In this example three timers are used:
  12. 1/TIMER1 is configured as master timer:
  13. - PWM mode is used
  14. - The TIMER1 update event is used as trigger output
  15. 2/TIMER2 is slave for TIMER1 and master for TIMER0,
  16. - PWM mode is used
  17. - The ITR0(TIMER1) is used as input trigger
  18. - External clock mode is used,the counter counts on the rising edges of
  19. the selected trigger.
  20. - The TIMER2 update event is used as trigger output.
  21. 3/TIMER0 is slave for TIMER2,
  22. - PWM mode is used
  23. - The ITR1(TIMER2) is used as input trigger
  24. - External clock mode is used,the counter counts on the rising edges of
  25. the selected trigger.
  26. The TIMxCLK frequency is set to systemcoreclock 84MHz(GD32F330) or 108MHz(GD32F350),
  27. the prescaler is 42000(GD32F330) or 54000(GD32F350) so the TIMER2 counter clock is 2KHz.
  28. The master timer TIMER1 is running at TIMER1 frequency :
  29. TIMER1 frequency = (TIMER1 counter clock)/ (TIMER1 period + 1) = 0.5 Hz
  30. and the duty cycle = TIMER1_CH0CC/(TIMER1_CAR + 1) = 50%
  31. The TIMER2 is running:
  32. - At (TIMER1 frequency)/ (TIMER2 period + 1) = 0.25 Hz and a duty cycle
  33. equal to TIMER2_CH0CC/(TIMER2_CAR + 1) = 50%
  34. The TIMER0 is running:
  35. - At (TIMER2 frequency)/ (TIMER0 period + 1) = 0.125 Hz and a duty cycle
  36. equal to TIMER0_CH0CC/(TIMER0_CAR + 1) = 50%