-----------------------------------------------------------------------
I2C0SCLH = (Fpclk/fi2c + 1) / 2;
I2C0SCLL = (Fpclk/fi2c)/2;
In I2C0SCLH = (Fpclk/fi2c+ 1) / 2;,
Why is it Fpclk/fi2c+1 instead of Fpclk/fi2c?
-----------------------------------------------------------------------
Answer:
**************************************************************************
According to the formula: I2SCLH + I2SCLL = Fpclk / Fbit (0) Original formula
In computer number crunching, we do this:
I2SCLH = (Fpclk/Fbit + 1)/2(1)
I2SCLL = (Fpclk/Fbit)/2(2)
Then I2SCLH + I2SCLL = (Fpclk / Fbit + 1) / 2 + (Fpclk / Fbit) / 2 (3) In computer digital operations, the two items cannot be combined.
To prove that there is no problem with this, here we give an example:
Assume I2SCLH + I2SCLL = Fpclk / Fbit = 5
Only by doing this:
I2SCLH = (Fpclk / Fbit + 1) / 2 = 3
I2SCLL = (Fpclk/Fbit)/2 = 2
To ensure:
I2SCLH + I2SCLL = 5 which matches the original formula (0).
If, as stated in the question, I2SCLH + I2SCLL = (Fpclk / Fbit) / 2 + (Fpclk / Fbit) / 2 = 4, then it does not match the original formula (0)!
Previous article:ARM Learning 1-LED Flowing Light
Next article:SPI host experiment---7-segment digital tube display
Recommended ReadingLatest update time:2024-11-16 16:22
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- [Factory Visit Live Replay] Arrived at the destination - TE Qingdao Factory
- Useful tutorial | How to quickly splice PCB data at unconventional angles?
- Class AB Audio Amplifier
- Max30102 heart rate blood oxygen sensor measures heart rate problem 2
- Xunwei IMX6 development board non-device tree source code compilation environment construction (I)
- Execution process before keil main
- I need help from a great God to look at this circuit diagram, thank you very much
- FPGA Global Clock Constraints (Xilinx)
- The 2020-2021 ON Semiconductor and Avnet IoT Innovation Design Competition awards have been announced!
- How to measure BLE power consumption (one of the most viewed app reports)