AnsweredAssumed Answered

STM32F4xx NVIC->ISPR Question

Question asked by Kang Sung Gu on Sep 23, 2017
Latest reply on Sep 23, 2017 by Vangelis Fortounas

When is the ISPR register used?
ISPR [0] | = 0x00000001 << 6; // (EXTI0 Position)
Does this code convert the EXTI0 interrupt into the pending state so that the EXTI0 interrupt should not be executed?
But the interrupts work well

 

Did I misunderstand?

 

This is my sorce code

 

int main(void)
{

  /* USER CODE BEGIN 1 */

  /* USER CODE END 1 */

  /* MCU Configuration----------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */

  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* USER CODE BEGIN SysInit */
  /* USER CODE END SysInit */

  /* Initialize all configured peripherals */

  /* USER CODE BEGIN 2 */
   //NVIC Register init
  NVIC->ISER[0] |= 0x01<<6; //EXTI0 vect enable
 
  //SYSCFG Register init
  SYSCFG->EXTICR[0] |=0x00000000; //PA0 interrupt enable
 
  //RCC Register init
  __IO uint32_t tmpreg = 0x00U; //__IO = volatile 
  RCC->AHB1ENR |= 0x00000041; //GPIOG, GPIOA AHB1ENR
  //RCC->APB2ENR |= 0x00000001 << 14; //SYSCFG ENABLE: APB2 clock is EXTI 
  /* Delay after an RCC peripheral clock enabling */
  tmpreg = 1; //
  UNUSED(tmpreg); //
  
  //GPIO Register init
  GPIOA->PUPDR   |= 0x00000002; //GPIOA_PIN0 PULL DOWN  SET
  GPIOG->MODER   |= 0x04000000; //GPIOG_PIN_13 OUTPUT MODE
  GPIOG->OTYPER  |= 0x00000000; //GPIOG PORT Push-Pull
  GPIOG->OSPEEDR |= 0x0C000000; //GPIOG_PIN_13 HIGH SPEED
  GPIOG->PUPDR   |=   0x0000000; //no pullup no pulldown
 
  //EXTI Register init
  EXTI->IMR  |= 0x00000001; //EXTI0 enable
  EXTI->RTSR |= 0x00000001;//EXTI0 rising edge enable
 
  NVIC->ISPR[0] = 0x00000001<<6;
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
  /* USER CODE END WHILE */

  /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */

}

 

Attachments

Outcomes