2022-12-20 02:39 AM
I'm modifying code for a Atmega AVR to a STM32L03 and encounter ISR(USART1_START_vect). It is a function that is called when the UART receives a start frame. I'm a newbie to this STM32-processor but I have googled and checked in inc-files but I cannot find any suitable code. I'm using HAL for now.
Have anyone a suggestion?
Thanx
Solved! Go to Solution.
2022-12-28 02:21 AM
Hi @Håkan Nalén ,
If you need a simple EXTI example, you can refer to this wiki article: Getting started with EXTI.
Several ready to use examples are also available in the STM32CubeL0 package. You can refer to some of them here.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-12-20 02:44 AM
What does your code do with such an interrupt?
If you want to detect the pin is active, perhaps use an EXTI interrupt.
2022-12-20 02:45 AM
> when the UART receives a start frame
Define "start frame".
> I have googled and checked in inc-files
Read the Reference Manual (RM) to your STM32.
JW
2022-12-20 02:50 AM
I have two UART ports. Both can occupy an interpreter and each port sets a flag that says "I now own the interpreter". That flag is set in this ISR().
I suppose a Frame detect IRQ coming when the hardware pin change state.
I must read about the EXTI interrupt..
2022-12-20 02:51 AM
I suppose a Frame detect IRQ coming when the hardware pin change state in the beginning of the transfer.
2022-12-20 04:14 AM
If it's this
then as Clive said above, EXTI may be a direct equivalent. However, for the purpose you've described, IMO it's better to "flip the switch" upon reception of the first byte on given UART.
JW
2022-12-20 04:46 AM
The note from 328PB is exactly what I want to happen in STM32-mcu.
The EXTI line 26 o 28 is activated in project.ioc file. I found the file stm320xx_hal_exti.c and what I can see this is the file that deals with EXTI.
Because I'm a newbie regarding this processor I searching for the interrupt function. Is it HAL_EXTI_IRQHandler() ?
If U have another Tips & Trix/manual for the processor and how to make a sw design in this target I would appreciate a tip. I found Target Device Docs and Resources in the Help menu i the IDE...
Thanx
2022-12-20 03:59 PM
> I have two UART ports. Both can occupy an interpreter and each port sets a flag that says "I now own the interpreter". That flag is set in this ISR().
And why cannot it be done when the data is received?
2022-12-20 08:59 PM
You are probably right. I can set the flag after the first byte has been received. The uart-ports has their own buffer but there is only one input buffer for the interpreter. I can set the flag in Rx-complete IRQ for the specific port.
Thanx. It is a simple solution and I get less IRQ:s.
2022-12-28 02:21 AM
Hi @Håkan Nalén ,
If you need a simple EXTI example, you can refer to this wiki article: Getting started with EXTI.
Several ready to use examples are also available in the STM32CubeL0 package. You can refer to some of them here.
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.