Acquisition of 16-bit data at 20kHz through SPI Protocol
Hi everybody, in the framework of an internship, I am supposed to link two electronic boards through SPI protocol..the development board I am proramming is STM32-P107 with the uc stm32f107, and I am getting the data from a 16-bit converter. Since i've always worked with microchip microcontrollers, I am finding difficulties to program the interruption needed. Here is the code I've written so far, many thing lack I know, but I am counting on you guys to help me sort this out:
to be clear, what would be wrong with this code? what do I need to add ( many things I guess)? and what are the steps to follow to set the interruption which will sample tha data at 20kHz? Thank you in advance, Zouhair
Re: Acquisition of 16-bit data at 20kHz through SPI Protocol
I don't see any NVIC setup in your code. In Microchip and Atmel MCUs you only need to specify linker flag for a function. On stm32 interrupts are not fixed by certain vector in the program memory. You actualy have to configure NVIC (Nested vectored interrupt controller): 1) set vertor's priority 2) set vector's handler function 3) enable desired interrupt vector I can't explain anything else right now. Maybe you'll figure it out.
Re: Acquisition of 16-bit data at 20kHz through SPI Protocol
Another question, I want to configure the interruption with the Timer 2 as you can see, so I put the channel to TIM2_IRQn, the question is, where do I need to mention SPI3_IRQn as vector of global interruption of the SPI I am dealing with in my program? Thanks!