Arduino:将数据存储在 EEPROM 中的轻量级压缩算法 [英] Arduino: Lightweight compression algorithm to store data in EEPROM

查看:34
本文介绍了Arduino:将数据存储在 EEPROM 中的轻量级压缩算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用 ATmega168/将大量数据存储到我的 Arduino 上ATmega328 微控制器,但遗憾的是只有 256 KB/512 KB 的 EEPROM 存储空间.

I want to store a large amount of data onto my Arduino with a ATmega168/ATmega328 microcontroller, but unfortunately there's only 256 KB / 512 KB of EEPROM storage.

我的想法是使用压缩算法来减少大小.但是,我对压缩算法的了解非常少,而且我对现成库的搜索失败了.

My idea is to make use of an compression algorithm to strip down the size. But well, my knowledge on compression algorithms is quite low and my search for ready-to-use libraries failed.

那么,有没有优化存储大小的好方法呢?

So, is there a good way to optimize the storage size?

推荐答案

你可以看看 LZO 算法,设计为轻量级.我不知道AVR系统是否有任何实现,但可能你可以自己实现.

You might have a look at the LZO algorithm, which is designed to be lightweight. I don't know whether there are any implementations for the AVR system, but it might be something you could implement yourself.

不过,您可能对芯片上 EEPROM 中可用的存储量有些误解;根据数据表,我的 EEPROM 大小为:

You may be somewhat misinformed about the amount of storage available in EEPROM on your chip though; according to the datasheet I have the EEPROM sizes are:

ATmega48P:256
ATmega88P:512
ATmega168P:512
ATmega256P:1024

ATmega48P: 256
ATmega88P: 512
ATmega168P: 512
ATmega256P: 1024

请注意,这些值以 字节 为单位,而不是您在问题中提到的 KB.这无论如何都不是垃圾".

Note that those values are in bytes, not KB as you mention in your question. This is not, by any measure, a "shitload".

这篇关于Arduino:将数据存储在 EEPROM 中的轻量级压缩算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆