When using STM8S003, due to insufficient pins, PB4 and PB5 were used as ordinary IO ports. As a result, no matter how the program was adjusted, a high level could not be output. I searched a lot of information on the Internet and finally figured out the problem after practice.
First of all, PB4 and PB5 can be used as I2C multiplexing ports, as described in the manual:
It can be found that the definition of the port property after PB4 and PB5 is T, which means true open-drain mode. There is neither P-Buffer nor protection diode connected to VDD inside. That is to say, no matter how it is set in the program, PB4 and PB5 can only be in open-drain mode. After clarifying this, if you need to use PB4 and PB5 as ordinary IO ports, it is recommended to add pull-up resistors so that high and low levels can be output normally.
Previous article:STVD+COSMIC project construction
Next article:How to write STVD interrupt function
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Some bytes of code in the application memory area of MSP430FR5949IDAR FRAM are tampered
- Overview of RFID Anti-collision Technology
- MSP430 low power mode - while loop fails
- [MM32 eMiniBoard Review] Give feedback on this board
- IWR6843 Smart mmWave Sensor Antenna-Package Evaluation Module
- Three designs of constant current circuit
- How can an outdoor Bluetooth speaker output the same power as a 12V lead-acid battery using two 7.4V lithium batteries?
- 【GD32F307E-START】+I2C driver problem
- Essential survival skills for power engineers - 20 classic analog circuits
- Please recommend a power IC with 12V input and 48V/1.2A output