Problem Description:
Recently encountered a problem, stm32 with 485 output, but only the output, the input data Stm32 received:
Test Description:
The dir port of test 485 is 3.3v, the general pin level is 0 or 1 level when dangling, and the pc6,pc6 of Dir-stm32 is low-level set with Gpio_resetbits ().
However, after the next, the measurement is 3.3v, so the board can only send, can not receive
Solution:
After checking to find pc6-9 not initialized, how to do it, so I initialize the push-pull output, also known as the drop-down output, the open-drain output is the pull-up output,
Push-Pull output: internal to a 0, equivalent to the GND, give a 1 equivalent to connect VCC
Open-Drain output: internal to 0, connect GND, to 1 if the external pull-up resistor is required to be 1
And then it's solved, but one problem is that the output is a bit less than a byte, and then I delay a byte of time. Dir set 0;
It over, in fact, a lot of problems to know how to do, more brain, and smart people play, this will become more intelligent.
In-depth analysis of 485 not receiving string problems