We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I'm using the MCBSTM32E development board equiped with an STM32F103ZE microcontroller.
I configured the USART2 transmitter according the Reference Manual and it works fine.
I configured the USART2 receiver according the Reference Manual and it does not work.
3 hours of experimenting does not do the job. I did next steps: - set the CR1_UE Usart Enable bit - clr the CR1_M bit for selecting 8 data bits - set the CR2 register to 1 stopbit - set the BRR register to the desired bautrate - set the CR1_RE bit to enable the receiver - set the USART RX input pin PA3 to input float - enabled the GPIOA port pheripheral clock - enabled the USART2 peripheral clock - set the CR1_RXNEIE bit to activate receive interrupt - set the NVIC-ISER bit for USART2 (global interrupt) - write an interrupt handler
When I apply data to the RX-input nothing happens. I monitored the receive data (DR) register and status (SR) register but nothing changed. I scoped pin PA3 on the uC and it is toggling when receiving data.
When I force a receive interrupt by setting the USART2 bit in the ISPR register then the interrupt handler is executed.
I changed code to control USART1 but with same effect.
I must have forgotten some bit or made some configuration errer. It seems as if rx-data is not entering the internal shiftregister or is not sampled.
All hints and tips are welcome.
Thanks,
Henk
We are all happy that my advise helped.
Burp.
Of course i meant advice.
Of course i meant i'm an idiot.