Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] enternal interrupt configuration for STM32F103VCT6 PROCESSOR

Status
Not open for further replies.

jagadeeshvulava

Junior Member level 1
Joined
Dec 10, 2010
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
hyderabad
Activity points
1,426
HI all,
I'm new one to ARM processors.....
I'm using stm32f103 processor for an embedded application.. i need to configure one IO pin in interrupt mode...

can any one help me to interface this to an external button on the board..

which register to be set to enable interrupts....
and how to check for interrupt occurrence ..


now i'm receiving data through USART in polling mode for that my code is like ............


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
void USART2_Configuration(void)
{ 
  GPIO_InitTypeDef GPIO_InitStructure;
  USART_InitTypeDef USART_InitStructure; 
 
  RCC_APB2PeriphClockCmd( RCC_APB2Periph_GPIOA ,ENABLE);
  RCC_APB1PeriphClockCmd( RCC_APB1Periph_USART2,ENABLE);
  /*
  *  USART1_TX -> PA2 , USART1_RX ->    PA3
  */                
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;          
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP; 
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 
  GPIO_Init(GPIOA, &GPIO_InitStructure);           
 
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;         
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;  
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; 
  GPIO_Init(GPIOA, &GPIO_InitStructure);
 
  USART_InitStructure.USART_BaudRate = 38400;
  USART_InitStructure.USART_WordLength = USART_WordLength_8b;
  USART_InitStructure.USART_StopBits = USART_StopBits_1;
  USART_InitStructure.USART_Parity = USART_Parity_No;
  USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
  USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
 
  USART_Init(USART2, &USART_InitStructure); 
  USART_ITConfig(USART2, USART_IT_RXNE, ENABLE);
  USART_ITConfig(USART2, USART_IT_TXE, ENABLE);
  USART_ClearFlag(USART2,USART_FLAG_TC);
  USART_Cmd(USART2, ENABLE);
}
 
void SendSerialData(unsigned char *CommandData, unsigned int CommandLength )
{
    unsigned int loopCounter = 0;
 
    for (loopCounter=0; loopCounter<CommandLength; loopCounter++)
    {
        USART_SendData(USART2, CommandData[loopCounter]);
//      wait untill data transmission complition 
        while (USART_GetFlagStatus(USART2, USART_FLAG_TC) == RESET)
        {}
 
    }
}
 
void receiveCommandResponce(unsigned int recCount)
{
    unsigned int loopCnt = 0;
 
    memset_local(USARTRecDataBuff, 0x00, 80);
    for (loopCnt=0;loopCnt<recCount; loopCnt++)
    {
//      wait untill data reception starts 
        while (USART_GetFlagStatus(CAMERA_USART_PORT, USART_FLAG_RXNE) == RESET)
        {}
 
        USARTRecDataBuff[loopCnt] = USART_ReceiveData(USART2);
    }
 
}


how can i receive data in interrupt mode thourgh usart and how to get key status as external interrupt........
thank you in advance
 
Last edited by a moderator:

I've read this document but still confusion is there.......
is there any reference code is there..........???

thank you ,,,,,
 

I'm sorry, but I not a frequent ARM user (rather dsPIC33F, PIC24H, MSP430). I believe you can also look for documents concerning other ST ARM microcontrollers, because NVIC is integral part of ARM Cortex-M3 core and external interrupt controller is probably same or at least very similar between different families of MCUs.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top