First, let me introduce EEPROM 24LC256, which is an electrically erasable read-only memory EEPROM produced by PIC, with a capacity of 256KB and supports a 2-wire serial interface, that is, an I2C interface (if you don’t know I2C, go online to make up your homework), and its device address is 0X1010A2A1A0. A2A1A0 is configurable, and it is connected to GND on the board, so its device address is 0X50.
If we look at the device connections on the board, we can see that it is connected to I2C1 and has a pull-up resistor.
The function we implemented is to write a character to the EEPROM and then read it out. If they are equal, LED1 will light up, and if they are not equal, LED1 will go out.
OpenI2C1( I2C_EN, BRG_VAL ); // Initialization
mPORTBClearBits(BIT_10); //LED1=0
mPORTBSetPinsDigitalOut(BIT_10);
write_24lc256(0x0440,0x12);
delay(10000);
temp=read_24lc256(0x0440);
if(temp==0x12)
mPORTBSetBits(BIT_10);//LED1=1
else
mPORTBClearBits(BIT_10); //LED1=0
Previous article:Wulin teaches you how to learn PIC32 (11) analog-to-digital conversion ADC10
Next article:Wulin teaches you how to use PIC32 (10) Real-time Clock (RTC)
- Popular Resources
- Popular amplifiers
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
- 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
- UCC28056 PFC Evaluation Board
- In low temperature environment, the battery level of the device is displayed as 90%, but when it is brought to normal temperature, the battery level drops rapidly until it shuts down. What is the principle behind this?
- Qorvo launches payload products into space to commemorate its 5th anniversary, speaking with strength!
- Temperature measurement in the electronics and semiconductor industries
- Working principle and structure analysis of variable frequency series resonance
- EEWORLD University ---- Linux driver strategy and framework
- Phase shifter classification and working principle (Part 1)
- 【RT-Thread Reading Notes】10. RT-Thread Learning Chapter 17 Reading Notes
- [TI recommended course] #Live replay: Application of TI millimeter wave sensors in smart home#
- EEWORLD University ---- Live playback: The most important component of the analog world - Signal chain and power supply: Amplifier special