Today I will tell you about the display of CT107D Blue Bridge Cup digital tube.
I won't go into detail about the specific principles of digital tubes, because I'm afraid you'll get dizzy if I say too much. If you want to understand the principles, you can do some BD yourself.
Let's find the circuit:
As you can see, we directly control the Y7C port and send data to the P0 port.
We control the Y6C port to select which digital tube to use, one is 8
We just need to find Y6C and Y7C
This is very familiar, okay, let's use the method
P2=(P2&0x1f)|0xc0; Open Y6
P0=0x01; select the first
P2&=0x1f; Close Y6
P2=(P2&0x1f)|0xe0; Open Y7
P0=0xf9; Give data
P2&=0x1f; Close Y7
Here is the basic usage. Now I will write a complete program
#include "reg52.h"
unsigned char code tab[]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xff,0xbf}; //data encoding
unsigned char dsbuff[]={10,10,10,10,10,10,10,10}; Displayed data
unsigned char dscom = 0;
void init_smg()
{
TMOD|= x01; Timer 0 working mode 2
TH0=(65536-2000)/256; interrupt once every 2m seconds
TL0=(65536-2000)%256;
ET0=1; Enable timer interrupt
TR0=1; start timer 0
EA=1; Enable general interrupt
}
void dsPlay()
{
P2=(P2&0x1f)|0xe0;
P0=0xff;
P2&=0x1f;
P2=(P2&0x1f)|0xc0;
P0=1< P2=(P2&0x1f)|0xe0; P0=tab[dsbuff[dscom]]; P2&=0x1f; if(++dscom==8)dscom=0; } void smg_time0()interrupt 1 { TH0=(65536-2000)/256; interrupt once every 2m seconds TL0=(65536-2000)%256; dsplay(); } void main() { init_smg(); dsbuff[0]=8; The first digital tube displays 8 while(1); }
Previous article:CT107D Blue Bridge Cup independent keyboard application (5)
Next article:CT107D Blue Bridge Cup Serial Port Example (3)
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- How to save data on pyboard without memory card, so that it doesn't matter if the power is off
- STM32 LCD driver writing ideas, with code analysis
- Common solutions for J-Link failing to connect to the chip
- Arteli AT32F4xx Standard Peripheral Library Release Notes
- AD 3D component package library
- If the PCB heat dissipation area is not enough, will increasing the copper thickness help improve the heat dissipation of the PCB?
- Can't tell the difference? The difference between RF analog signal source and vector signal source
- Most EMI problems are related to clock signals.
- Share: AD batch hide component labels
- [Xiao Meige SoC] How to view the number of GPIO added on the FPGA side of the SoC FPGA system and use interrupts