2219 views|5 replies

58

Posts

0

Resources
The OP
 

[Yatli AT32F421 Review] Doubts from EXTI disconnection [Copy link]

 

Last time, I used the interrupt method to read the key code to improve efficiency, but there was also a small problem. After CH450 scans the key, it will pull down a low-level pulse on the INT pin. My EXTI pin is configured like this

void EXTI9_5_Config(void)
{
	EXTI_InitType   EXTI_InitStructure;
  GPIO_InitType   GPIO_InitStructure;
  NVIC_InitType   NVIC_InitStructure = {0};
	
	RCC_AHBPeriphClockCmd(RCC_AHBPERIPH_GPIOF, ENABLE);         ///<Enable GPIOF clock
	GPIO_StructInit(&GPIO_InitStructure);
	GPIO_InitStructure.GPIO_Pins = GPIO_Pins_6;
	GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
	GPIO_InitStructure.GPIO_Pull = GPIO_Pull_NOPULL;									//上拉
	GPIO_Init(GPIOF, &GPIO_InitStructure);                        ///<Configure PF6 pin as input 
	
	RCC_APB2PeriphClockCmd(RCC_APB2PERIPH_SYSCFGCOMP, ENABLE);    ///<Enable SYSCFG clock
	SYSCFG_EXTILineConfig(GPIO_PortSourceGPIOF, GPIO_PinsSource6);  ///<Connect EXTI6 Line to PF6 pin

	EXTI_InitStructure.EXTI_Line = EXTI_Line6;
	EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
	EXTI_InitStructure.EXTI_Trigger = EXTI_Trigger_Falling;					//下降沿触发
	EXTI_InitStructure.EXTI_LineEnable = ENABLE;
	
	EXTI_Init(&EXTI_InitStructure);                               ///<Configure EXTI6 line
	
	NVIC_InitStructure.NVIC_IRQChannel = EXTI15_4_IRQn;
	NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 3;
	NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;
	NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
	NVIC_Init(&NVIC_InitStructure);                               ///<Enable and set EXTI9_5 Interrupt to the lowest priority
}

However, I found that the PF6 pin would occasionally become low level and could not be pulled up by the CH450INT pin, resulting in the inability to respond to interrupts. I needed to disconnect the connection line from PF6 to the INT pin and reconnect it, but this situation occurred again after a while. Please help.

This post is from Domestic Chip Exchange

Latest reply

Pull it out and test it separately.   Details Published on 2021-5-24 22:16
 
 

9702

Posts

24

Resources
2
 

Test PF6 separately, for example, use another GPIO as output, control it repeatedly, and see if similar problems occur again.

This post is from Domestic Chip Exchange
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
 
 
 

6547

Posts

0

Resources
3
 

Hang an oscilloscope to see what the waveform is like

Find out the reason why the PF6 pin becomes low level from time to time

This post is from Domestic Chip Exchange
 
 
 

7422

Posts

2

Resources
4
 

Pull it out and test it separately.

This post is from Domestic Chip Exchange
Personal signature

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

 
 
 

58

Posts

0

Resources
5
 

Thanks for your replies, I'm about to hand in the paper, I'm afraid I'll have to try again after I finish it.

This post is from Domestic Chip Exchange
 
 
 

58

Posts

0

Resources
6
 

I have tried it, and it works fine when I pull it out and use it alone. It may be caused by the failure to read the CH450 key value when receiving the interrupt.

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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