Hi

I want to know that is this possible to use such a big variable that can store 256 bits with hserin command?
You seem to be asking two questions here but presenting them as one. As SteveB indicates take a look at Melanie’s thread on Bits bytes words and arrays in the FAQ section, and it should help you over the first problem.

it may be arount 256 bits at a time
although 256 BITS are the maximum number of elements in a BIT array. Think about
creating a BYTE or WORD array and addressing the individual BITS in those arrays. Therefore a maximum number of BITS available in an ARRAY (WORDS or BYTES) for the 16F877 is 768 BITS.


But what when i have to store such a big data in my PIC?
Do you mean you wish to take up the least code space on your device caused by creating an array to be used as a buffer?.

You could consider “preparing your data for transmission” cutting it up into chunks that you then send to your receiving PIC and them reassemble as you wish, then either store them to your external eeprom or use it. HSER has a hardware buffer of two bytes, you could use this as starting point.

Of course once you disassemble your BIT array, you will need to keep track of the sequence.

But I really do think the answer for you, as others have indicated, lies in Melanie’s Post Bits Bytes words and arrays.


I have a project which has a section that combines data contained in several variables of all types Bits bytes and words that is combined into a single array and sent through HSER over an RF link The transmission length is variable. ( I do not think there is any reason that it cannot be up to the maximum for a particular device, I havn't tried it with LONGS to break the 48 WORD barrier, maybe others have )


Anyway mine works well with no probs. Just watch out how you communicate the very first array type following a PIC reset, there have been several posts on the forum about this point.

HTH

Duncan