//CD4094 20120302 8-way reference voltage source usage test
Keywords:CD4094
Reference address:CD4094 Shift Bus Register Driver
//program... #include#include #define uint unsigned int #define uchar unsigned char sbit k6=P1^7; sbit k5=P1^6; sbit k4=P1^5; sbit k3=P1^4; sbit k2=P1^3; sbit k1=P1^2; sbit LED_ON=P1^1; sbit led=P3^7; sbit A_=P3^3; sbit B_=P3^4; sbit C_=P3^5; sbit DEL=P1^0; sbit STR = P3^2; //Define each port of CD4094; sbit DATA = P3^1; sbit CLK = P3^0; fly tt,tt1,K=0; uchar KEY(); uchar code table[]={0x03,0x9f,0x25,0x0d,0x99,0x49,0x41}; //code unsigned char C51BOX2[3] _at_ 0x43; void Out_4094(uchar data1); //CD4094 write data sub-function; void Delay(uint a); //delay sub-function; //Main program starts; void timer0(void) interrupt 1 using 0 { TH0 =5000/256; TL0 =5000%256; if(K==0) {tt++; if(K==0&&tt==7){ {tt=0;LED_ON=~LED_ON;} } } Out_4094(table[K]); if(K!=0) LED_ON=0; tt1++; if(tt1==7){tt1=0;led=~led;} } void main() { uchar i,f,g; //infinite loop; TMOD=0x01; TH0 =5000/256; TL0 =5000%256; EA=1; ET0=1; TR0=1; A_=0; B_=0; C_=0; DEL=0; while(1) { /*for(g=0;g<6;g++) {Delay(30000); f=table[g]; Out_4094(f); //Call the display sub-function; Delay(30000); //delay; } */ KEY(); if(K==0){A_=0;B_=0; C_=0; DEL=0 ;} if(K==1){A_=0;B_=1; C_=1; DEL=0 ;} if(K==2){A_=1;B_=0; C_=1; DEL=0 ;} if(K==3){A_=0;B_=0; C_=1; DEL=0 ;} if(K==4){A_=1;B_=1; C_=0; DEL=0 ;} if(K==5){A_=0;B_=1; C_=0; DEL=1 ;} if(K==6){A_=1;B_=0; C_=0; DEL=1 ;} } } void Out_4094(uchar data1) //write CD4094 sub-function; { uchar i; //define subfunction; STR=0; //Keep the current state unchanged; for(i=0;i<8;i++) //Write eight bits of data into CD4094; { if(data1&0x01) //Judge concurrent serial data; { DATA=1; //Send high level; } else { DATA=0; //send low level; } CLK=0; //Form a rising delay pulse; _nop_(); _nop_(); //delay; _nop_(); CLK=1; data1>>=1; //data shift, send next bit of data; } STR=1; //Data sent; update display; } void Delay(uint a) //delay sub-function; { uint b; for(b=0;b
Previous article:DAC7611 Driver
Next article:Adc0831 (Analog-to-Digital Conversion) Driver
Recommended ReadingLatest update time:2024-11-16 16:01
Driver layer separation concept_bus driver device model_P
Hierarchical concept: The principle of driver upward registration: For example: input subroutine one input.c as a layer, the lower layer is Dev.c and Dir.c, write Dev.c and Dir.c respectively to register upward Input.c; as shown in the figure Separation concept: The concept of separation mainly talks about dividing
[Microcontroller]
Introduction and comparison of several driving solutions for LED display
Introduction and comparison of several drive solutions
TLC5941
driver chip
The TLC5941 chip is the latest product from TI
,
and features dot correction, high grayscale (PWM control), etc. All internal data registers, grayscale registers, dot correction registers, and e
[Power Management]
WPG Group launches high-efficiency, ultra-thin 200W LED driver solution based on Innoscience products
On September 15, 2022, WPG Holdings, a leading semiconductor component distributor dedicated to the Asia-Pacific market, announced that
its subsidiary Quan Ding has launched a high-efficiency, ultra-thin 200W LED driver power solution based on Innoscience's INN650D01 field-effect transistor.
F
[Power Management]
Nanochip releases the new 40V automotive-grade multi-channel half-bridge driver NSD830x-Q1!
Naxin Micro has launched the new NSD830x-Q1 series of multi-channel half-bridge automotive-grade driver chips
. This series of products includes two products, NSD8308 (8 channels) and NSD8306 (6 channels). Both products integrate multi-channel half-bridge drivers and N-MOS power stages to support a variety of
[Power Management]
Impact of driver grounding point location on conducted emissions
1. Background
When doing the conducted emission experiment, it was found that the PE grounding position of the driver's motor line would have a great impact on the test results, causing the test to exceed the standard. I wonder if my colleagues have encountered this. Now I will share with you the interesting sc
[Embedded]
mini2440 LED Driver
myled.c
#include linux/module.h
#include linux/kernel.h
#include linux/fs.h
#include linux/cdev.h
#include asm/uaccess.h
#include linux/device.h
#include mach/hardware.h
#include mach/gpio-nrs.h
#include mach/regs-gpio.h
/*#include "gpio-nrs.h"*/
//add tsuibin
#incl
[Microcontroller]
Driving six LEDs via two PIC pins
This design idea shows a new method to drive six LEDs using only two MCU I/O lines. This method is especially suitable for any chip with limited pins. This method uses two I/O lines and a pair of complementary bipolar transistors. More than one LED can be lit by multiplexing. Figure 1: The PIC10F200 is sele
[Power Management]
Renesas and Nidec Collaborate on Innovative “8-in-1” Proof of Concept to Provide Advanced Integration for Electric Vehicle Drive Motors
New electric vehicle drive motor solution will be
Live demonstration at Electronica 2024 in Munich, Germany, November 12-15, 2024
Beijing, China, November 11, 2024 -
Renesas Electronics, a global supplier of semiconductor solutions, today announced that it is the first in the world to lau
[Automotive Electronics]
- Popular Resources
- Popular amplifiers
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- Modern Product Design Guide
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
MoreDaily News
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
Guess you like
- Communication protocol conversion
- New live broadcast calendar
- LOTO Practice [Dry Goods] 2- Quick Application of Voltage Comparator
- GD32E230C Test 2: I2C and EEPROM
- 【XMC4800 Relax EtherCAT Kit Review】+DAVE integrated development environment construction and demo operation
- Design of data acquisition card based on FPGA.pdf
- Xunwei 4412 development board cross-compiles Qt application code
- Actual development and experience of the first phase
- 【National Technology N32G430】02 Small expansion, communication from top to bottom
- PCB and PCB LAYOUT (dry goods sharing)