Function name: HC595SendData //8-bit serial input/output, parallel output
Function description: Send data to the SPI bus. Here we only explain the general situation of parallel input.
Pin description: Please refer to the relevant chip information
void HC595SendData(unsigned int SendVal)
{
unsigned char i;
for(i=0;i<8;i++)
{
if((SendVal<
Keywords:74HC595
Reference address:74HC595 uses SPI bus to connect to 51 microcontroller driver
//If the highest bit of the input is 1, then set the serial input to 1, otherwise input 0
else MOSIO=0;
S_CLK=0; //Rising edge input each bit
NOP(); //The datasheet gives the maximum rise and fall time as 1000ns
NOP(); //Here is 2us, which is enough
S_CLK=1;
}
R_CLK=0; //set dataline low
NOP(); //Output 8-bit parallel data on the rising edge
NOP(); //The explanation of delay is the same as above
R_CLK=1; //Chip select
OE=0;
}
Previous article:Example of 51 MCU realizing stepper motor acceleration and deceleration - with comments
Next article:Detailed explanation of DS18B20 temperature sensor driver based on 51 single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 16:49
C51 program for microcontroller driving 74HC595
//This subroutine is for 74HC595 to send characters. This program sends the lowest bit first!
//The clock pin of chip 74HC595 is pin 11
//The data pin of chip 74HC595 is pin 14
//The latch pin of chip 74HC595 is pin 12
//When multiple 74HC595s are connected in series, the signal will be latched only
[Microcontroller]
- Popular Resources
- Popular amplifiers
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- ATmega16 MCU C language programming classic example (Chen Zhongping)
- Smart Car Security Attack and Defense Revealed
- STC MCU Principles and Applications: Analysis and Design from Devices, Assembly, C to Operating Systems: A Three-Dimensional Tutorial (He Bin)
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
- [TI recommended course] #[High Precision Laboratory] Interface: 3 Ethernet#
- MSP430F5529 ADC Reference
- Fennel – Lisp syntax for Lua programming
- [LSM6DSOX finite state machine routine study 1]--Introduction to finite state machine and routine
- Reading the good book "Operational Amplifier Parameter Analysis and LTspice Application Simulation" Reading experience 01- Familiarity with the book
- Brief Introduction of Push-Pull Circuit
- New wireless LED driver platform advances commercial lighting applications and meets future demands
- How were antennas invented?
- Summary: ublox wireless development board EVK-NINA-B400 evaluation report
- Download the practical information - Power Management Basics