2009-09-30 03:29 AM
rs232
2011-05-17 04:23 AM
Hi all,
I'm working on my first stm32 based project, starting from ''HyperTerminal_Interrupt'' example into stm32 fwlib. I have 2 questions: 1) Both send and receive operations transfer one more character (0xfe during transmit and 0x0d during receive). Example: - if TxBuffer contains ''hello'', into pc I see ''xhello'', where 'x' is 0xfe - if I send ''hello'' from pc to board, RxBuffer contains ''xhello'' where 'x' is 0x0d Why? I tried to reduce baudrate from 115k to 9k, but nothing changed 2) This example fires tx_interrupt only at reset, but I'd like to transmit every time I need. I think I have to modify registers (ref um0427).. right? Thanks jerry2011-05-17 04:23 AM
Can you look on an oscilloscope to examine the data on the TX / RX lines?
Chris.2011-05-17 04:23 AM
Hi Chris,
Using a third interrupt, USART_IT_TC, problem (1) seems to be solved! I'm testing a rs232/rs485 converter (between pc and stm32 board). Without this interrupt, I checked the number of transmitted characters, and then move the RTS signal: if (NumberOfTransmittedChars == NumberOfCharsToTransmit) { - disable transmit - enable receive - move RTS } Using an oscilloscope, I saw the transmission also after the RTS move. I don't know the reason. Now I use the TransmissionCompleteInterrupt. Into this handler, I move the RTS. Now transmit,receive and RTS start and stop at the same time. About second question..? :)2011-05-17 04:23 AM
up!
I'd like to transmit every time I need using interrupt (not only after reset!). Is it possible? Example: while (1) { USART1->??? = ???; Delay(123); } Thanks jerry