Data transfer from GPIO port to RAM buffer using DMA upon receiving a trigger signal on the timer capture input channel.
  1. Our requirement is to configure the DMA so that it transfers data from the GPIO lines (8 bit data lines) to the RAM buffer upon receiving a trigger signal on the timer capture input channel.
  2. We had received an example code from ST for the F1 series controllers and the  code is attached. The code works fine with the F1 discovery board. Now we are trying to do the same thing on the F4 board. We have implemented the same configurations for F4 board and tried with F4 discovery board but the DMA data transfer doesn’t happen.The code for F4 is also attached.
  3. The code file is attached. Please note that we have used standard peripheral library functions from ST. Can you please go through our configurations and point out errors? Or send the useful example which can fulfill our requirements.

Indeed, looks like you need DMA2, as DMA1 can only access peripherals on APB1

  1. // STM32F4 DMA GPIO - sourcer32@gmail.com
  2.  
  3. // Per RM0090 DMA2, Channel0, Stream6 correlates to TIM1_CH1(PA8) source
  4. // 2 KHz clock generated on TIM3_CH1 (PB4)
  5. // Externally strap PA8 to PB4
  6. // PC0 conflicts, adapt as required
  7.  
  8. #include "stm32f4_discovery.h"
  9.  
  10. #define BufferSize 1000
  11.  
  12. uint8_t GPIO_DATA[BufferSize];
  13.  
  14. /*******************************************************************************
  15. * Function Name : GPIOC Configuration
  16. * Description : GPIO PORT configurations in such a way that so it status can be read
  17. * Input : None
  18. * Output : None
  19. * Return : None
  20. *******************************************************************************/
  21. void GPIOC_Configuration (void)
  22. {
  23. GPIO_InitTypeDef GPIO_InitStructure;
  24.  
  25. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); /* GPIOC clock enable */
  26.  
  27. // I'd prefer inputs, but going with original example...
  28.  
  29. GPIO_InitStructure.GPIO_Pin = 0xFF; // Pin0 .. Pin7
  30. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  31. GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;
  32. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  33. GPIO_Init(GPIOC, &GPIO_InitStructure);
  34.  
  35. GPIO_SetBits(GPIOC, 0xFF); // Set High-Z
  36. }
  37.  
  38. /*******************************************************************************
  39. * Function Name : Timer1 configurations
  40. * Description : Configure Timer1 in such a way that it can initiate data transfer using DMA on rising edge of clock signal received on port pin.
  41. * Input : None
  42. * Output : None
  43. * Return : None
  44. *******************************************************************************/
  45. void TIM1_Configuration(void)
  46. {
  47. GPIO_InitTypeDef GPIO_InitStructure;
  48. TIM_ICInitTypeDef TIM_ICInitStructure;
  49.  
  50. RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); /* TIM1 clock enable */
  51. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
  52.  
  53. /* TIM1 channel 1 pin (PA8) configuration */
  54. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_8;
  55. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  56. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  57. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  58. GPIO_Init(GPIOA, &GPIO_InitStructure);
  59.  
  60. GPIO_PinAFConfig(GPIOA, GPIO_PinSource8, GPIO_AF_TIM1); // PB3 TIM1_CH1
  61.  
  62. TIM_ICInitStructure.TIM_Channel = TIM_Channel_1;
  63. TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising;
  64. TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI;
  65. TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1;
  66. TIM_ICInitStructure.TIM_ICFilter = 0x0;
  67. TIM_ICInit(TIM1, &TIM_ICInitStructure);
  68.  
  69. TIM_CtrlPWMOutputs(TIM1, ENABLE); /* TIM Main Inputs/Output Enable */
  70. TIM_Cmd(TIM1, ENABLE); /* TIM enable counter */
  71. TIM_DMACmd(TIM1, TIM_DMA_CC1, ENABLE ); /* Enable TIM1_CC1 DMA Requests */
  72. }
  73.  
  74. /*******************************************************************************
  75. * Function Name : DMA2 configuration
  76. * Description : Transfer Data from peripheral port (GPIOC) to RAM buffer
  77. * Input : None
  78. * Output : None
  79. * Return : None
  80. *******************************************************************************/
  81. void DMA2_Configuration(void)
  82. {
  83. /***************************************************************************************************************************************/
  84. DMA_InitTypeDef DMA_InitStructure;
  85.  
  86. /* Enable the DMA clock */
  87. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
  88.  
  89. /* Configure the DMA Stream */
  90. DMA_Cmd(DMA2_Stream6, DISABLE);
  91. DMA_DeInit(DMA2_Stream6);
  92.  
  93. /* Set the parameters to be configured */
  94. DMA_InitStructure.DMA_Channel = DMA_Channel_0;
  95. DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&GPIOC->IDR; /* Read fron GPIO input data register */
  96. DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&GPIO_DATA[]; /* Send the data to the RAM buffer */
  97. DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;
  98. DMA_InitStructure.DMA_BufferSize = BufferSize;
  99. DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
  100. DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
  101. DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
  102. DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
  103. DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
  104.  
  105. DMA_InitStructure.DMA_Priority = DMA_Priority_High;
  106. DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
  107. DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_HalfFull;
  108. DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
  109. DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
  110. DMA_Init(DMA2_Stream6, &DMA_InitStructure);
  111.  
  112. /* Enable DMA Transfer Complete interrupt */
  113. DMA_ITConfig(DMA2_Stream6, DMA_IT_TC, ENABLE);
  114.  
  115. DMA_Cmd(DMA2_Stream6, ENABLE);
  116.  
  117. /***************************************************************************************************************************************/
  118. }
  119.  
  120. /*******************************************************************************
  121. * Function Name : TIM3_Configuration
  122. * Description : Configure TIM3 to generate a PWM signal. Used for test purpose
  123. * Input : None
  124. * Output : None
  125. * Return : None
  126. *******************************************************************************/
  127. void TIM3_Configuration (void)
  128. {
  129. #define TIM3_PERIOD (500-1) /* Timer 3 PWM period 2 KHz */
  130. #define TIM3CH1_PULSE ((TIM3_PERIOD+1)/2) /* Timer 3 PWM pulse period */
  131. #define TIM3_PRESCALER (84-1) /* Timer 3 prescaler 1 MHz */
  132.  
  133. GPIO_InitTypeDef GPIO_InitStructure;
  134. TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  135. TIM_OCInitTypeDef TIM_OCInitStructure;
  136.  
  137. RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); /* TIM3 clock enable */
  138. RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE); /* GPIOB clock enable */
  139.  
  140. /* GPIOB Configuration: TIM3 channel 1 as alternate function push-pull */
  141. GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;
  142. GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
  143. GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
  144. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  145. GPIO_Init(GPIOB, &GPIO_InitStructure);
  146.  
  147. GPIO_PinAFConfig(GPIOB, GPIO_PinSource4, GPIO_AF_TIM3); // PB4 TIM3_CH1
  148.  
  149. TIM_TimeBaseStructure.TIM_Period = TIM3_PERIOD;
  150. TIM_TimeBaseStructure.TIM_Prescaler = TIM3_PRESCALER;
  151. TIM_TimeBaseStructure.TIM_ClockDivision = ;
  152. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  153.  
  154. TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
  155. TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
  156. TIM_OCInitStructure.TIM_Pulse = TIM3CH1_PULSE;
  157. TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
  158.  
  159. TIM_TimeBaseInit (TIM3, &TIM_TimeBaseStructure); /* Time base configuration */
  160. TIM_OC1Init (TIM3, &TIM_OCInitStructure); /* PWM1 Mode configuration: Channel1 */
  161. TIM_OC1PreloadConfig(TIM3, TIM_OCPreload_Enable); /* Enable the timer preload */
  162. TIM_ARRPreloadConfig(TIM3, ENABLE); /* Enable the time autoreload register */
  163. TIM_Cmd (TIM3, ENABLE); /* Start the timer */
  164. }
  165.  
  166. /**************************************************************************************/
  167.  
  168. void NVIC_Configuration(void)
  169. {
  170. NVIC_InitTypeDef NVIC_InitStructure;
  171.  
  172. /* Enable the DMA Stream IRQ Channel */
  173. NVIC_InitStructure.NVIC_IRQChannel = DMA2_Stream6_IRQn;
  174. NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = ;
  175. NVIC_InitStructure.NVIC_IRQChannelSubPriority = ;
  176. NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  177. NVIC_Init(&NVIC_InitStructure);
  178. }
  179.  
  180. /**************************************************************************************/
  181.  
  182. void DMA2_Stream6_IRQHandler(void) // 2 Hz
  183. {
  184. /* Test on DMA Stream Transfer Complete interrupt */
  185. if (DMA_GetITStatus(DMA2_Stream6, DMA_IT_TCIF6))
  186. {
  187. /* Clear DMA Stream Transfer Complete interrupt pending bit */
  188. DMA_ClearITPendingBit(DMA2_Stream6, DMA_IT_TCIF6);
  189.  
  190. /* Toggle LED3 : End of Transfer */
  191. STM_EVAL_LEDToggle(LED3);
  192.  
  193. // Add code here to process things
  194. }
  195. }
  196.  
  197. /**************************************************************************************/
  198.  
  199. /**
  200. * @brief Main program
  201. * @param None
  202. * @retval None
  203. */
  204. int main(void)
  205. {
  206. int i;
  207. for(i=;i<BufferSize; i++)
  208. {
  209. if((i % ) == )
  210. GPIO_DATA[i] = ;
  211. else
  212. GPIO_DATA[i] = 0xFF;
  213. }
  214. GPIOC_Configuration();
  215. NVIC_Configuration();
  216. TIM1_Configuration();
  217. TIM3_Configuration();
  218. DMA2_Configuration();
  219.  
  220. STM_EVAL_LEDInit(LED3); /* Configure LEDs to monitor program status */
  221.  
  222. STM_EVAL_LEDOn(LED3); /* Turn LED3 on, 1 Hz means it working */
  223.  
  224. while(); // Don't want to exit
  225. }

Hello Clive, I used your code and changed it to memorry to peripheral out.

The code given below. Now when i try to send the data out what i am seeing is

when i sample the data at constant rate then some bytes of data gets repeated

which is giving an indication that the data is getting sampled twice.

My conclusion says that the particular data remains on GPIO port for longer duration.

  1. #include "stm32f4xx.h"
  2. #include "stm32f4xx_gpio.h"
  3. #include "stm32f4xx_dma.h"
  4. #include "stm32f4xx_tim.h"
  5. #include "stm32f4xx_rcc.h"
  6. #include "misc.h"
  7.  
  8. #define BufferSize 8008
  9.  
  10. uint16_t GPIO_DATA[ BufferSize ];
  11. volatile uint8_t count = ;
  12.  
  13. /*******************************************************************************
  14. * Function Name : GPIOE Configuration
  15. * Description : GPIO PORT configurations for sending out the data received via DMA transfer
  16. * Input : None
  17. * Output : None
  18. * Return : None
  19. *******************************************************************************/
  20. void GPIOE_Configuration( void )
  21. {
  22. GPIO_InitTypeDef GPIO_InitStruct;
  23.  
  24. //RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE); /* GPIOE clock enable */
  25. RCC->AHB1ENR |= RCC_AHB1Periph_GPIOE;
  26.  
  27. GPIO_InitStruct.GPIO_Pin = 0xFFFF; // Pin0 .. Pin15
  28. GPIO_InitStruct.GPIO_Mode = GPIO_Mode_OUT;
  29. GPIO_InitStruct.GPIO_OType = GPIO_OType_PP;
  30. GPIO_InitStruct.GPIO_Speed = GPIO_Speed_100MHz;
  31.  
  32. GPIO_Init( GPIOE, &GPIO_InitStruct );
  33.  
  34. }
  35.  
  36. /*******************************************************************************
  37. * Function Name : Timer8 configurations
  38. * Description : Configure Timer8 in such a way that it can initiate data transfer using DMA
  39. * Input : None
  40. * Output : None
  41. * Return : None
  42. * Remark : Prescaler and Period can vary from 1 and 2 respectively
  43. *******************************************************************************/
  44. void TIM8_Configuration( void )
  45. {
  46. #define TIM8_PERIOD (3-1) /* Timer 8 PWM period 90,10 MHz */
  47. #define TIM8_PRESCALER (6-1) /* Timer 8 prescaler 180, 30 MHz */
  48.  
  49. TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  50.  
  51. // RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM8, ENABLE); /* TIM8 clock enable */
  52. RCC->APB2ENR |= RCC_APB2Periph_TIM8;
  53.  
  54. TIM_TimeBaseStructure.TIM_Period = TIM8_PERIOD;
  55. TIM_TimeBaseStructure.TIM_Prescaler = TIM8_PRESCALER;
  56. TIM_TimeBaseStructure.TIM_ClockDivision = ;
  57. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  58.  
  59. TIM_TimeBaseInit( TIM8, &TIM_TimeBaseStructure ); /* Time base configuration */
  60. TIM_ARRPreloadConfig( TIM8, ENABLE ); /* Enable the time autoreload register */
  61. TIM_Cmd( TIM8, ENABLE ); /* TIM enable counter */
  62. TIM_DMACmd( TIM8, TIM_DMA_Update, ENABLE ); /* Enable TIM8_UP DMA Requests */
  63. TIM_ITConfig( TIM8, TIM_IT_Update, ENABLE ); /* Enable TIM8 Update interrupt*/
  64. }
  65. /*******************************************************************************
  66. * Function Name : Timer1 configurations
  67. * Description : Configure Timer1 in such a way that it enables data transfer using DMA
  68. * Input : None
  69. * Output : None
  70. * Return : None
  71. *******************************************************************************/
  72. void TIM1_Configuration( void )
  73. {
  74. #define TIM1_PERIOD (500-1) /* Timer 1 PWM period 1 KHz */
  75. #define TIM1_PRESCALER (360-1) /* Timer 1 prescaler 500 KHz */
  76.  
  77. TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
  78.  
  79. // RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1, ENABLE); /* TIM1 clock enable */
  80. RCC->APB2ENR |= RCC_APB2Periph_TIM1;
  81.  
  82. TIM_TimeBaseStructure.TIM_Period = TIM1_PERIOD;
  83. TIM_TimeBaseStructure.TIM_Prescaler = TIM1_PRESCALER;
  84. TIM_TimeBaseStructure.TIM_ClockDivision = ;
  85. TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
  86.  
  87. TIM_TimeBaseInit( TIM1, &TIM_TimeBaseStructure ); /* Time base configuration */
  88. TIM_ARRPreloadConfig( TIM1, ENABLE ); /* Enable the time autoreload register */
  89. TIM_ITConfig( TIM1, TIM_IT_Update, ENABLE ); /* Enable TIM1 Update interrupt*/
  90. TIM_Cmd( TIM1, ENABLE ); /* TIM enable counter */
  91.  
  92. }
  93.  
  94. /*******************************************************************************
  95. * Function Name : DMA2 configuration
  96. * Description : Transfer Data to peripheral port (GPIOE) from RAM buffer
  97. * Input : None
  98. * Output : None
  99. * Return : None
  100. *******************************************************************************/
  101. void DMA2_Configuration( void )
  102. {
  103. DMA_InitTypeDef DMA_InitStructure;
  104.  
  105. /* Enable the DMA clock */
  106. // RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
  107. RCC->AHB1ENR |= RCC_AHB1Periph_DMA2;
  108.  
  109. /* Configure the DMA Stream */
  110. DMA_Cmd( DMA2_Stream1, DISABLE );
  111. DMA_DeInit( DMA2_Stream1 );
  112.  
  113. /* Set the parameters to be configured */
  114. DMA_InitStructure.DMA_Channel = DMA_Channel_7;
  115. DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t) &GPIO_DATA[ ]; /* Read the data from the RAM buffer */
  116. DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t) &GPIOE->ODR; /* Send GPIO output data register */
  117. DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;
  118. DMA_InitStructure.DMA_BufferSize = BufferSize;
  119. DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
  120. DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
  121. DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
  122. DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
  123. DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
  124.  
  125. DMA_InitStructure.DMA_Priority = DMA_Priority_High;
  126. DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
  127. DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
  128. DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
  129. DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
  130. DMA_Init( DMA2_Stream1, &DMA_InitStructure );
  131.  
  132. /* Enable DMA Transfer Complete interrupt */
  133. DMA_ITConfig( DMA2_Stream1, DMA_IT_TC, ENABLE );
  134.  
  135. DMA_Cmd( DMA2_Stream1, ENABLE );
  136. }
  137.  
  138. /**************************************************************************************/
  139. /*******************************************************************************
  140. * Function Name : NVIC configuration
  141. * Description : configures 2 interrupt channels. 1st reads end of data transfer and disables DMA,2nd enables dma after every 1ms
  142. * Input : None
  143. * Output : None
  144. * Return : None
  145. *******************************************************************************/
  146. void NVIC_Configuration( void )
  147. {
  148. NVIC_InitTypeDef NVIC_InitStructure;
  149.  
  150. /* Enable the DMA Stream IRQ Channel */
  151. NVIC_InitStructure.NVIC_IRQChannel = DMA2_Stream1_IRQn;
  152. NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = ;
  153. NVIC_InitStructure.NVIC_IRQChannelSubPriority = ;
  154. NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  155. NVIC_Init( &NVIC_InitStructure );
  156.  
  157. //enables DMA stream IRQ Channel after 1ms
  158. NVIC_InitStructure.NVIC_IRQChannel = TIM1_UP_TIM10_IRQn;
  159. NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = ;
  160. NVIC_InitStructure.NVIC_IRQChannelSubPriority = ;
  161. NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
  162. NVIC_Init( &NVIC_InitStructure );
  163.  
  164. }
  165.  
  166. /**************************************************************************************/
  167.  
  168. void TIM1_UP_TIM10_IRQHandler( void )
  169. {
  170. if ( TIM_GetFlagStatus( TIM1, TIM_FLAG_Update ) )
  171. {
  172. DMA_Cmd( DMA2_Stream1, ENABLE );
  173. //GPIOG->ODR ^= GPIO_Pin_11; //chip enable
  174. GPIOG->BSRRL = GPIO_Pin_11;
  175. // Clear update interrupt bit
  176. TIM_ClearITPendingBit( TIM1, TIM_IT_Update );
  177. }
  178. }
  179.  
  180. void DMA2_Stream1_IRQHandler( void ) // 1 KHz
  181. {
  182. /* Test on DMA Stream Transfer Complete interrupt */
  183. if ( DMA_GetITStatus( DMA2_Stream1, DMA_IT_TCIF1 ) )
  184. {
  185. /* Clear DMA Stream Transfer Complete interrupt pending bit */
  186. DMA_ClearITPendingBit( DMA2_Stream1, DMA_IT_TCIF1 );
  187.  
  188. //Indicating end of transfer
  189. GPIOG->BSRRH = GPIO_Pin_11;
  190.  
  191. // Add code here to process things
  192. // DMA_Cmd(DMA2_Stream1, DISABLE); //for pausing/restarting DMA transfer
  193. }
  194. }
  195.  
  196. void LED_Init( )
  197. {
  198. GPIO_InitTypeDef GPIO_InitDef;
  199. RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOG, ENABLE );
  200.  
  201. GPIO_InitDef.GPIO_Pin = GPIO_Pin_All;
  202. GPIO_InitDef.GPIO_Mode = GPIO_Mode_OUT;
  203. GPIO_InitDef.GPIO_OType = GPIO_OType_PP;
  204. GPIO_InitDef.GPIO_PuPd = GPIO_PuPd_NOPULL;
  205. GPIO_InitDef.GPIO_Speed = GPIO_Speed_100MHz;
  206. //Initialize pins
  207. GPIO_Init( GPIOG, &GPIO_InitDef );
  208.  
  209. }
  210. /**************************************************************************************/
  211.  
  212. /**
  213. * @brief Main program
  214. * @param None
  215. * @retval None
  216. */
  217. int main( void )
  218. {
  219. SystemInit( );
  220. int i;
  221. //writing data to memory
  222.  
  223. for ( i = ; i < BufferSize; i++ )
  224. {
  225. GPIO_DATA[ i ] = i;
  226. }
  227.  
  228. //Initializing components
  229. GPIOE_Configuration( );
  230. LED_Init( );
  231. NVIC_Configuration( );
  232. DMA2_Configuration( );
  233. TIM8_Configuration( );
  234. TIM1_Configuration( ); //used for setting a clock with 1ms sample rate
  235.  
  236. while ( )
  237. ; // Don't want to exit
  238. }

Don't enable the TIM8 interrupt, 10 MHz isn't viable. Check the repetition count setting for TIM8

Data transfer from GPIO port to RAM buffer using DMA upon receiving a trigger signal on the timer capture input channel.的更多相关文章

  1. STM32 GPIO fast data transfer with DMA

    AN2548 -- 使用 STM32F101xx 和 STM32F103xx 的 DMA 控制器 DMA控制器 DMA是AMBA的先进高性能总线(AHB)上的设备,它有2个AHB端口: 一个是从端口, ...

  2. Efficient data transfer through zero copy

    Efficient data transfer through zero copy https://www.ibm.com/developerworks/library/j-zerocopy/ Eff ...

  3. UDT: Breaking the Data Transfer Bottleneck

    http://udt.sourceforge.net/ DT is a reliable UDP based application level data transport protocol for ...

  4. ISO 9141-2 and ISO 14230-2 INITIALIZATION and DATA TRANSFER

    http://ecad.tu-sofia.bg/et/2005/pdf/Paper097-P_Dzhelekarski1.pdf INITIALIZATION Prior to any diagnos ...

  5. Zore copy(翻译《Efficient data transfer through zero copy》)

    原文:https://www.ibm.com/developerworks/library/j-zerocopy/ <Efficient data transfer through zero c ...

  6. PatentTips – RDMA data transfer in a virtual environment

    BACKGROUND Embodiments of this invention relate to RDMA (remote direct memory access) data transfer ...

  7. PatentTips - Cross-domain data transfer using deferred page remapping

    BACKGROUND OF THE INVENTION The present invention relates to data transfer across domains, and more ...

  8. OpenHCI - Data Transfer Types

    There are four data transfer types defined in USB(USB中有4种数据传输类型). Each type is optimized to match th ...

  9. Data transfer object

    Data transfer object (DTO) is a design pattern used to transfer data between software application su ...

随机推荐

  1. Zookeeper笔记之命令行操作

    $ZOOKEEPER_HOME/bin下的zkCli.sh进入命令行界面,使用help可查看支持的所有命令: 一.节点相关操作 create [-s] [-e] path data acl creat ...

  2. BGM时长

    1.can u feel it 00:08-00:30 22s 2.纤夫的爱 00:43-00:54 11s 3.渡情 00:55-01:52 57s 4.nobody 01:56-02:25 29s ...

  3. 在线建立或重做mysql主从复制架构方法(传统模式和GTID模式)【转】

    mysql主从复制架构,是mysql数据库主要特色之一,绝大多数公司都有用到. 而GTID模式是基于事务的复制模式的意思,发展到现在也是越来越多人用. 以前很多文章,介绍搭建mysql主从复制架构,是 ...

  4. 内存溢出(Memory Overflow)和内存泄露(Memory Leak)的区别

    内存泄漏指你用malloc或new申请了一块内存,但是没有通过free或delete将内存释放,导致这块内存一直处于占用状态 内存溢出指你申请了10个字节的空间,但是你在这个空间写入11或以上字节的数 ...

  5. mysql ON DUPLICATE KEY UPDATE重复插入时更新

    mysql当插入重复时更新的方法: 第一种方法: 示例一:插入多条记录 假设有一个主键为 client_id 的 clients 表,可以使用下面的语句: INSERT INTO clients (c ...

  6. ansible源码解读

    Ansible源码获取 Ansible Github:https://github.com/ansible Ansible目录结构 $ tree -L 2 ansible-2.0.0.0 ansibl ...

  7. 数学之美——HMM模型(一)介绍

    一直想写点关于数学方面的blog,这对于数据挖掘分析,NLP处理等都有着比较重要的作用,之前在CSDN上想写点HMM方面的文章,一直没写成,最近几天终于抽点时间完成了HMM的文章,加以整理,遂有这个系 ...

  8. Channel Allocation HDU1373

    染色问题:相邻不能染同一种颜色 最少需要的颜色的数量=最大团点的数量 #include<bits/stdc++.h> using namespace std; #define N 27 i ...

  9. 【Java】 大话数据结构(10) 查找算法(1)(顺序、二分、插值、斐波那契查找)

    本文根据<大话数据结构>一书,实现了Java版的顺序查找.折半查找.插值查找.斐波那契查找. 注:为与书一致,记录均从下标为1开始. 顺序表查找 顺序查找  顺序查找(Sequential ...

  10. 常用工具(Windows版本)

    为原有版本修改为markdown后的更新,这个编辑器真心不错,只需要把原来喜欢的表格改成列表即可. 代码工具 代码管理工具 SourceTree:支持windows和mac跨平台使用的git图形化客户 ...