2014-10-08 03:36 PM
Using:
2014-10-08 03:54 PM
Don't know, EXTI?
2014-10-08 04:00 PM
Does this mean, that I definitively must configure the chip select input for interrupt and set up an additional ISR?
2014-10-08 04:16 PM
It means I don't know....
The Hard NSS suggests a gating to cause the RXNE N-cycles into the transaction, ie slave accepting input based on a low -CS If you want to get close and personal with the edges of the -CS pin, then I think you're going to have to use an EXTI based method to achieve that. It's not something I have tried, or plan on trying.2014-10-08 09:15 PM
Ok, I got it working using EXTI for now.
Unfortulately, because of SPI2's select is on PB12, there is no EXTI12_IRQn but I have to use EXTI15_10_IRQn instead. Btw: I'm mainly interested if the chipselect has been deactivated between calls of my SPI2_IRQHandler(). So I don't really need a ISR call for every chipselect edge. For this I'd now tried to work without EXTI15_10_IRQHandler(). Using EXTI_Mode_Event instead of EXTI_Mode_Interrupt and hoping that I could check some kind of »event bit« inside of my SPI2_IRQHandler(). But in the case of using EXTI_Mode_Event, there seems no event bit which I could read out (I'd also checked out , pages 381 ff.). Well, I could use EXTI_Mode_Interrupt and simply not enable the related EXTI15_10_IRQn. Now I can check EXTI_GetITStatus(EXTI_Line12) (and clear pending bit afterwards) and this works as expected. But there's also a disadvantage: If I later want to use e.g. EXTI_Line11 for calling an isr, this isr will also called every time a transition occours on my chipselect line (permanently if the pending bit was not cleared inside of the isr). So, it seems to be a bad idea to do such things. brings quite less helpful results and there are also no code examples inside of the standard peripheral library. My impression is, that EXTI_Mode_Event was only for waking up the Stm32 from sleep mode - nothing more or less. No way to check if such an event has been occoured or not (isn't it?).2014-10-09 01:56 AM
PB12 is TIM1_BKIN and I2C2_SMBA, both should be usable as interrupt sources if those peripherals are unused. I admit that it's an unorthodox solution and there may be bumps ahead.
JW2014-10-09 05:52 AM
> … it's an unorthodox solution and there may be bumps ahead.
Within my application, the edges of the chip select are indicators for start and end of a transmission of a bunch of data. I think it's very common to use a chip select activation as some kind of »transmission start« when communicate over SPI. May you know a better solution to detect chip select transitions between SPI2_IRQHandler() calls?