Hardware Serial only in RX (or TX) #2841
Replies: 4 comments 3 replies
-
|
Hi @luca-stm32 |
Beta Was this translation helpful? Give feedback.
-
|
Hi @fpistm. So, if I understood well, you suggested me to configure USART2 in Half Duplex mode (for this configuration, I need to configure USART2 TX pin PA2 in declaration) and then swap RX to TX pin in order to use PA3, correct? I was wondering what happen to PA2 (USART2 TX PIN) when I declare Serial2 in Half Duplex mode as it is connected to an op-amp output: is PA2 in high impedance mode after Serial2 initialization? Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
Ok, thanks fpistm. |
Beta Was this translation helpful? Give feedback.
-
|
Excuse me fpistm, I know that my request is out of Arduino API concern, the request could interest few people and unfortunately I can't be of any help for it, and please don't think I have any respect of your hard (really very hard!) work, but I rather think it could be very difficult to implement (and expecially time consuming). #define USART_MODE_RX ((uint32_t)USART_CR1_RE) This declaration make me think that technically RX (or TX) only mode could be implemented. But maybe I missed a detail that makes this truly impossible to implement. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to ask if it could be possible to implement hardware serial peripheral only in RX (or TX) mode.
I searched in Wiki and I found that I could use hardware serial declaring RX and TX pins (both) or in halfduplex mode declaring only TX pin.
I thinked a declaration like this:
HardwareSerial Serial1(PA10, NC);for only RX mode or:
HardwareSerial Serial1(NC, PA9);for TX mode.
This could be very useful expecially when you need only RX (for example GPS serial data) using a micro with a little number of pins.
I prefer not to use Softwareserial if micro has hardware serial lines available.
I know that I can use Hardware Serial declaring RX and TX pins withiut conneting TX (or RX) pins, but I think it is a "waste" or resources and sometimes it is not possible expecially if you are using a small micro with a little number of pins.
Thanks for your great work!
Regards.
Luca
Beta Was this translation helpful? Give feedback.
All reactions