STC series single chip makes digital tube brighter

Publisher:runaway2000Latest update time:2012-08-18 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The I/O port of the STC series microcontroller has a strong pull-up mode. What is the strong pull-up mode?
The I/O port of the STC microcontroller can be set to four modes: quasi-bidirectional port/weak pull-up, push-pull/strong pull-up, input/high impedance. When set to push-pull/strong pull-up, the current it can withstand is very large regardless of output 1 or 0.
The special function register (SFR) of the STC microcontroller adds PXM1 and PXM0 registers to the I/O port, and each port has such a pair. The working mode of the port can be selected by setting the value of PXM1:PXM0:
The definitions of PXM1 and PXM0 are as follows:
0 0 Quasi-bidirectional port (traditional IO)
0 1 Push-pull output (strong pull-up, current up to 20mA, use as little as possible)
1 0 Input only (high impedance)
1 1 Open drain, such as the traditional 8051 P0 port
The following takes the P1 port as an example:
The names of the mode configuration registers of the P1 port are P1M1 and P1M0, and the addresses are 91H and 92H respectively.
Example:

Whether it is assembly or C, the definition of registers is the same:
P1M1 equ 91H
P1M0 equ 92H
Then, there are the following statements in the program:
Assembly language:
mov p1m1,#00000000B
mov p1m0,#11111111B ; Set all p1 ports to strong pull-up mode
C language:
P1M0 = 0xC0;
P1M1 = 0xA0; //P1.7 open drain, P1.6 high impedance, P1.5 strong push-pull output, other quasi-bidirectional I/O ports.

Using this function, it is very easy to make the digital tube display brighter. In the past, I always thought about adding pull-up resistors or buying digital tubes with higher brightness. Now, I think it is great that I can do it with just a software setting. It is really cool!
(The microcontrollers I use are STC11F02E and STC12C5A60S2).

However, the teacher has two pieces of advice here:

1. Ants can drag things that are 100 times heavier than themselves, but they are still ants after all. It is obviously impossible to ask ants to pull a carriage. Therefore, the "strong" of strong pull is only relative. It is okay to pull a digital tube, but to pull devices such as relays, you still have to follow the standard circuit. You still have to add transistors when it is time. Don't be too greedy.

2. Once you set the I/O port to pull-up (push-pull) mode, you must not connect the wires of the two ports together, otherwise, once one pin outputs 1 and the other pin outputs 0, your port will be burned. If it is not set to pull-up mode, the I/O port will generally not be damaged.

Keywords:MCU Reference address:STC series single chip makes digital tube brighter

Previous article:AT89s51-ADC0804 Experiment
Next article:Garbage weighing and charging control system based on single chip microcomputer AT89S51

Recommended ReadingLatest update time:2024-11-16 22:53

Design of 51 single chip wireless music doorbell
Wireless doorbells are also called wireless remote control doorbells or remote control doorbells. Wireless doorbells use super-regenerative wireless modules to achieve wireless remote control. Wireless doorbells do not require wiring and are simple and flexible to install. However, the transmission distance is greatly
[Microcontroller]
Design of 51 single chip wireless music doorbell
51 single chip microcomputer ~ relay, freewheeling diode related principles
Relay: The relay is marked with: AC stands for alternating current, the bottom line 05V is the rated voltage of 5V, and the 30VDC below stands for 30V direct current. Relay circuit diagram connection: as shown in the middle part of the figure below; (1) 4 and 5 are D and E; (2) 2 is normally open, 3 is normally closed
[Microcontroller]
51 single chip microcomputer ~ relay, freewheeling diode related principles
Design of wireless photoelectric target controller based on AT89S52 single chip microcomputer
0 Introduction In response to the actual needs of the troops' aiming training, a wireless photoelectric target system with simple circuit, small size, light weight, low cost, easy to move and automatic target reporting is developed here, which solves the problems in daily training well. 1 Overall design The wir
[Microcontroller]
Design of wireless photoelectric target controller based on AT89S52 single chip microcomputer
#51 MCU #RS-485 communication functions and features
RS-485 communication is commonly used in industrial control, power communication, smart instruments and other fields. This communication method mainly has the following five capabilities: ①Adapt to complex construction sites ② Anti-electromagnetic interference ③ Networking ④Longer transmission distance ⑤ A
[Microcontroller]
[Self-study 51 MCU] 2 -- Keil software to write programs, burn programs and light up LEDs
1. Introduction to peripheral LED LED lamps are light emitting diodes, which are a type of diode. A diode has an anode and a cathode. Current flows from the positive electrode to the negative electrode, and is conducted, while the reverse is blocked. Among them, the forward voltage of the SMD light emitting diode is b
[Microcontroller]
[Self-study 51 MCU] 2 -- Keil software to write programs, burn programs and light up LEDs
Analytical solution of electronic timing and scoring system with 89C51 single chip microcomputer as core device
0 Introduction In 2008, the Science and Technology Olympics is a very important aspect, and the timing and scoring system is of utmost importance in the competition. It can be said that a good timing and scoring system determines the success or failure of the event. In basketball games, the total countdown
[Microcontroller]
Analytical solution of electronic timing and scoring system with 89C51 single chip microcomputer as core device
51 MCU implements the universal program framework of the serial port to judge the data header to receive a string of data
1. Use proteus to draw a simple circuit diagram for subsequent simulation 2. Programming /******************************************************************************************************************** ---- @Project: USART ---- @File: main.c ---- @Edit: ZHQ ---- @Version: V1.0 ---- @CreationTime: 20
[Microcontroller]
51 MCU implements the universal program framework of the serial port to judge the data header to receive a string of data
Design of 32-bit MCU development board based on STM32F100VBT6
  The STM32F100VBT6 uses the ARM Cortex-M3 32-bit RISC core, operates at a frequency of 24MHz, integrates high-speed embedded memory (up to 128kB flash memory, up to 8kB SRAM) and various enhanced peripherals and I/O connected to two APB buses. All devices provide two I2C, two SPI, one HDMI CEC and up to 3 USART Peuge
[Microcontroller]
Design of 32-bit MCU development board based on STM32F100VBT6
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号