Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use CAT24CXX to realize paging reading and writing data in EEPROM

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

How to use CAT24CXX to read and write data in pages in EEPROM? in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

1. The principle of reading and writing data in pages by CAT24CXX.

CAT24C08, a total of 8KB storage space, you can select the device address area through A2, A9 and A8, that is, = 8 address areas, each address area has 64 pages, each page has 16 bytes, so: 64X16X8=8192B, that is, 8KB.

A2, A9, and A8 select the address area, and the range of values is shown in the following table:

A2a9a8000 address area 0001 address area 1010 address area 2011 address area 3100 address area 4101 address area 5110 address area 6111 address area 7

Therefore, the configuration data can be allocated according to the following address blocks:

Address area 0

Configuration 1 data: 0Byte~1000Byte

Address area 1

Configuration 2 data: 1001Byte~1100Byte

Configuration 3 data: 1101Byte~1200Byte

Configuration 4 data: 1201Byte~1300Byte

2. Code implementation

There is no change in the code-driven process, the focus is to deal with address bits, generally speaking, we use address area 0 by default to meet development needs, and now we need to read and write address bits or address areas on the basis of.

When using address area 0, the default address bit is: 0XA0, read and write data, the address is as follows:

Uint8_t dev_addr_r = dev_addr | 0x01; uint8_t dev_addr_w = dev_addr & 0xFE

When using address area 1, the default address bit is: 0XA2, read and write data, the address is as follows:

Uint8_t dev_addr_r = dev_addr | 0x01; uint8_t dev_addr_w = dev_addr & 0xFE; this is the answer to the question about how to use CAT24CXX to read and write data in paging in EEPROM. I hope the above content can be of some help to everyone. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report