Question

I am doing a project with a PIC microcontroller. I have an ADC sampling and saving data to a RAM memory, once the RAM is filled I need to send it via Bluetooth with a PIC microcontroller.

My data is very redundant, I have about 10-20 consecutive bytes which are the same value, then it changes and still the same for about 10-20 consecutive bytes.

I want to compress the data which is about 512Kbytes to send it faster through bluetooth, 512Kbytes of data takes about 2 second to transfer by Bluetooth at 2Mbps. The decompression will be fast because the data is transferred to a Dual Core ARM Platform so there is no problem with that.

Is there any algorithm to compress data relatively fast for a PIC microcontroller like PIC24 or dsPIC at about 40MIPS ?

Was it helpful?

Solution

Based on that description, it sounds like run-length encoding would be perfect for you. It's a very simple algorithm; it only requires a few lines of code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top