A project using LPC804 found a problem, its PWM pin outputs a pulse waveform between power-on reset and execution of the PWM initial function.
Then I erase MCU flash and measure idle pins waveform, which are also output pull-up. This is different from the description in the user manual, all GPIO pins default to inputs at reset.
Could you please support this problem, thank you!
The following show the pulse waveform after power-on reset. Red is MCU VDD and yellow is PWM output.
Hi,
As the following pic I copied from the UM11065.pdf, during/after Reset, almost all pins are in GPIO input state with on-chip pull-up resistor enabled, that is why you see high logic for the PWM pins during/after Reset before you initialize the pin.
I suppose that you have to connect external 5K~10K ohm pull-down resistor for the PWM pins, this is common practice in order to keep the PWM pins low.
Hope it can help you
BR
XiangJun Rong
Hi XiangJun,
Thanks for your answer, but I'm still a little confused. the following pictures I copied from the UM11065.pdf. If the port state is an input state at reset, the port internally internal circuit is connected to a Schmidt trigger, it will be a high resistance input state and should not have a pull-up level output. Why does the port direction have a lower priority than the output state?
Hi,
As the following pic I copied from UM11065.pdf, when the weak pull-up is enabled, the pin will be in high logic. when the weak pull-down is enabled, the pin will be in low logic. Unfortunately, in default, the weak pull-up is enabled, the pin is in high logic as you have observed.
You have to connect an external pull-down resistor(5~10K ohm) to the pin so that the pin is in low logic.
Hope it can help you
BR
XiangJun Rong
Understand, thanks for your reply, and suggestion on the external circuit.