#include
0x92,0x82,0xf8,0x80,0x90,0xff};
TempData[0] = led_discode[i/10];
while(1)
CLI();
while(EECR & (1<
#include
#define uchar unsigned char
#define uint unsigned int
void EEPROM_write(uint EEPROM_ADDR, uchar EEPROM_DAT);
void Delayms(uint MS);
void display(uchar FirstBit,uchar Num);
void Mcu_IO_Init(void);
uchar EEPROM_read(uint EEPROM_ADDR);
float TempData[8];
uchar WeiMa[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
uchar led_discode[11]={0xc0,0xf9,0xa4,0xb0,0x99,
void main(void)
{
flying i;
Mcu_IO_Init();
i=EEPROM_read(1);
i++;
EEPROM_write(1,i);
TempData[2] = led_discode[i/100];
TempData[1] = led_discode[i];
{
display(6,2);
}
}
void Mcu_IO_Init(void)
{
DDRA=0XFF;
PORT=0XFF;
DDRC=0XFF;
PORTC=0XFF;
DDRF|=0X0E;
PORTF|=0X0E;
PORTF&=0xF7;
DDRB |=0X10;
PORTB|=0X10;
}
void EEPROM_write(uint EEPROM_ADDR, uchar EEPROM_DAT)
{
EEARH = 0X00;
EEARL = EEPROM_ADDR;
EEDR = EEPROM_DAT;
EECR |= (1<
EECR |= (1<
CLI();
while(EECR & (1<
unsigned char i;
PORTA=WeiMa[i+FirstBit];
PORTC=TempData[i];
uint i,j;
for( i=0;i
for(j=0;j<1141;j++);
Keywords:AVR128
Reference address:AVR128 program - EEPROM records reset times
BE();
}
uchar EEPROM_read(uint EEPROM_ADDR)
{
EEARH = 0X00;
EEARL = EEPROM_ADDR;
EECR |= (1<
return EEDR;
BE();
}
void display(uchar FirstBit,uchar Num)
{
for(i=0;i
{
PORTC=led_discode[10];
Delayms(5);
}
}
void Delayms(uint MS)
{
}
Previous article:AVR128 Program - DS1302 Clock Chip
Next article:AVR128 program - stepper motor forward and reverse control
- Popular Resources
- Popular amplifiers
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
- Share a STMF105RBT6 and 103RCT6_keil_C++ source program
- MSP430 MCU Example 3 - Colored Light Control
- EEWORLD University-What is an isolated gate driver?
- Burning image and mounting USB disk with busybox file system failed
- Switching Circuit
- EEWORLD University Hall----Open Source PWM Robotic Arm (Version 51)
- The project in Xinlinx SDK is working fine but suddenly can't find the header file
- How should we say the "positive and negative poles" of alternating current?
- Ghost video sound
- Wire Harness Tester Related Operation & Application Video (Continuously Updated)