2014-04-17 05:58 PM
I'm trying to generate a reset on a USART receive character match on the F3 Discovery board. If I understand the user manual, I need to set bits 31:24 of USART_CR2 to be the character I want to match. The problem is that I cannot change those bits. I can change other bits, such as bit 23 of CR2. I made sure I set RE=0 as the user manual says to do. Is there something else I need to do to set the match character? Does anyone have code that generates an interrupt on match?
Here is how I was trying to set the match character: uint32_t reg; reg = (uint32_t)USART1->CR1; reg &= (uint32_t)0xfffffffb; USART1->CR1 = (uint32_t)reg; // This works. I can read back the changed value. reg = USART1->CR2; reg |= (uint32_t)0x96000000; // A tilde character USART1->CR2 = (uint32_t)reg; // This does not work. CR2 is unchanged.Any suggestions would be greatly appreciated!--Osman #character_match #usart_cr22014-04-17 06:28 PM
I've been working on this problem all day, and (of course) I solve it five minutes after posting here. It seems that the User Manual is incorrect: setting RE=0 does *not* allow you to modify bits 31:24. You have to set UE=0. After I did that, I could set the match character and now my interrupt works. I hope this info helps someone else.