3361 views|5 replies

2865

Posts

4

Resources
The OP
 

How to enter timer5 interrupt in GD32F103C8T6 [Copy link]

I use the following code in my program, but I cannot enter the TIME5 interrupt. However, I can enter the interrupt by changing TIME5 to TIME2 and TIME3. Is it possible that GD32F103C8T6 does not have a TIMER5 timer? However, the manual does not mention the absence of this timer.

void timer5_init(uint16_t arr,uint16_t psc)
{
    timer_parameter_struct timer_initpara;
    rcu_periph_clock_enable(RCU_TIMER5);		/* 使能TIMER5时钟 */
    
    /* TIMER5 初始化配置 */
	  timer_deinit(TIMER5);
    timer_initpara.prescaler         = psc;						/* 时钟预分频系数 */
    timer_initpara.period            = arr;						/* 自动重装载值 */
    timer_init(TIMER5,&timer_initpara);

	  timer_enable(TIMER5);
	
	  nvic_irq_enable(TIMER5_IRQn, 3, 3);				/* TIMER5中断设置,抢占优先级3,子优先级3 */
	  timer_interrupt_enable(TIMER5,TIMER_INT_UP);	/* 使能更新中断 */ 
}

//MAIN
timer5_init(5000,12000);	/* 定时500ms*/


void TIMER5_IRQHandler(void)
{
  timer_flag_clear(TIMER5,TIMER_FLAG_UP);		/* 定时器更新中断的标识位需要手动清除 */  
	
}

This post is from GD32 MCU

Latest reply

[attach]622131[/attach] C8 doesn't have it, just look at the manual and you'll know.   Details Published on 2022-7-14 15:28
 

2865

Posts

4

Resources
2
 

GD32F103C8T6 only has four timers: timer0, timer1, timer2, timer3, and no timers 4 and 5.

This post is from GD32 MCU

Comments

Sure, just cut it off.  Details Published on 2022-6-15 19:47
 
 
 

7422

Posts

2

Resources
3
 
bigbat posted on 2022-6-15 18:52 GD32F103C8T6 only has four timers: timer0, timer1, timer2, timer3, and there is no timer 4 and 5 at all

Sure, just cut it off.

This post is from GD32 MCU

Comments

I don't understand what you mean. Is it possible or not? I looked in the selection manual [attachimg]614541[/attachimg] This model has 4+1 timers  Details Published on 2022-6-16 09:07
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

2865

Posts

4

Resources
4
 
freebsder posted on 2022-6-15 19:47 Sure, just cut it off.

I don't understand what you mean. Is it possible or not? I'll check the selection manual.

This model has 4+1 timers

This post is from GD32 MCU

Comments

It should not be. Your C8 does not have it. The ones with more pins do.  Details Published on 2022-6-16 11:01
 
 
 

7422

Posts

2

Resources
5
 
bigbat posted on 2022-6-16 09:07 I don't understand what you mean. Is it possible or not? I looked in the selection manual and this model has 4+1 timers

It should not be. Your C8 does not have it. The ones with more pins do.

This post is from GD32 MCU
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

1

Posts

0

Resources
6
 

C8 doesn't have it, just look at the manual and you'll know.

This post is from GD32 MCU
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list