Learning ARM

Thread Starter

Shear_Intelligence

Joined Jun 10, 2012
29
hi there, i recently worked on 8051 based microcontrollers, now i decided to switch to ARM micro controller, i borrowed a board name stm32f407vg discovery from my teacher, i want to learn arm can anyone suggest me any resource or any book? i have to finish this in 3 weeks if anyone has idea or any link or any suggestion please share. thaks

SI
 

MrChips

Joined Oct 2, 2009
35,120
Finish what in three weeks? I've been working with ARM for 15 months and I'm still not done.

Go to the IAR website and download the IAR EWARM.
 

Thread Starter

Shear_Intelligence

Joined Jun 10, 2012
29
i mean i have to finish learning arm in 3 weeks so that i can use it in my final year project. modules i need to use in my fyp are usb OTG, usart and adc with atleast 2 mega samples per seconds then i will write software to accuse data to computer through usart.
 

Thread Starter

Shear_Intelligence

Joined Jun 10, 2012
29
Finish what in three weeks? I've been working with ARM for 15 months and I'm still not done.

Go to the IAR website and download the IAR EWARM.
i have done it all the problem is that i dont really know where to begin the coding or start programming. in other modules we can do very basic example to get started like led blinking etc. can you tell me where did you learn arm?
 

MrChips

Joined Oct 2, 2009
35,120
I learned to use the ARM by looking at the project examples under Projects.
Start by toggling an I/O pin.

I can send you some code later this week.

(You are not going to learn it all in 3 weeks).
 

Thread Starter

Shear_Intelligence

Joined Jun 10, 2012
29
I learned to use the ARM by looking at the project examples under Projects.
Start by toggling an I/O pin.

I can send you some code later this week.

(You are not going to learn it all in 3 weeks).
honey i just need to use adc and uart. i will try my best to do it in 3 weeks. and yes please send me your codes.
 

MrChips

Joined Oct 2, 2009
35,120
Look for IO_Toggle example in the ...\Project\... folder.
You should be able to open this from the IAR EWARM IDE.

In any case it is in the STM32F4DISCOVERY installation folder:

C:\Documents and Settings\... ...\My Documents\Downloads\stm32f4discovery_fw\STM32F4-Discovery_FW_V1.0.1\Project\Peripheral_Examples\IO_Toggle

Here is the listing of main.c. With this code you can make the LEDs flash:

PD12 - LED4 - Green
PD13 - LED3 - Orange
PD14 - LED5 - Red
PD15 - LED6 - Blue


Rich (BB code):
/**
  ******************************************************************************
  * @file    IO_Toggle/main.c 
  * @author  MCD Application Team
  * @version V1.0.0
  * @date    19-September-2011
  * @brief   Main program body
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
  ******************************************************************************  
  */ 

/* Includes ------------------------------------------------------------------*/
#include "stm32f4_discovery.h"

/** @addtogroup STM32F4_Discovery_Peripheral_Examples
  * @{
  */

/** @addtogroup IO_Toggle
  * @{
  */ 

/* Private typedef -----------------------------------------------------------*/
GPIO_InitTypeDef  GPIO_InitStructure;

/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
void Delay(__IO uint32_t nCount);
/* Private functions ---------------------------------------------------------*/

/**
  * @brief  Main program
  * @param  None
  * @retval None
  */
int main(void)
{
  /*!< At this stage the microcontroller clock setting is already configured, 
       this is done through SystemInit() function which is called from startup
       file (startup_stm32f4xx.s) before to branch to application main.
       To reconfigure the default setting of SystemInit() function, refer to
        system_stm32f4xx.c file
     */

  /* GPIOD Periph clock enable */
  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);

  /* Configure PD12, PD13, PD14 and PD15 in output pushpull mode */
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13| GPIO_Pin_14| GPIO_Pin_15;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
  GPIO_Init(GPIOD, &GPIO_InitStructure);

  while (1)
  {
    /* PD12 to be toggled */
    GPIO_SetBits(GPIOD, GPIO_Pin_12);
    
    /* Insert delay */
    Delay(0x3FFFFF);
    
    /* PD13 to be toggled */
    GPIO_SetBits(GPIOD, GPIO_Pin_13);
    
    /* Insert delay */
    Delay(0x3FFFFF);
  
    /* PD14 to be toggled */
    GPIO_SetBits(GPIOD, GPIO_Pin_14);
    
    /* Insert delay */
    Delay(0x3FFFFF);
    
    /* PD15 to be toggled */
    GPIO_SetBits(GPIOD, GPIO_Pin_15);
    
    /* Insert delay */
    Delay(0x7FFFFF);
    
    GPIO_ResetBits(GPIOD, GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15);
    
    /* Insert delay */
    Delay(0xFFFFFF);
  }
}

/**
  * @brief  Delay Function.
  * @param  nCount:specifies the Delay time length.
  * @retval None
  */
void Delay(__IO uint32_t nCount)
{
  while(nCount--)
  {
  }
}

#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{ 
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}
#endif

/**
  * @}
  */ 

/**
  * @}
  */ 

/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
 
Top