Each I/O port is equipped with three 8-bit registers, namely the direction control register DDRx, data register PORTx, and input pin register PINx. The working mode and performance characteristics of the I/O port are controlled by these three registers
1) When DDRx=1, the I/O port is in output mode, and the output is the value of PORTx (high and low levels)
When DDRx=0, the I/O port is in input mode, and the data in PINx is It is the actual level of the external pin. When reading data, you should read PINx, not PORTx. This should be noted!!!
2) When DDRx=0 and in input mode, PORTx cooperates with PUD to set the internal Validity and invalidity of the pull-up resistor!!!
The pull-up resistor is valid when DDRx=0, PORTx=1, PUD=0, and it is invalid at other times!
I hope you can understand!
The above is the detailed content of How to buy and sell PORTX coins (how to sell coins on tce exchange). For more information, please follow other related articles on the PHP Chinese website!