PDA

View Full Version : PIC18F4515 Serin2 Maximum Array size



millersamsr
- 5th April 2007, 21:59
Can anyone help, please. I'm using a PIC18F4515 and PBP. I'm trying to recieve serial data into a byte array of 805 bytes. Everything I can find states that this should be possible, but anytime I go over 256 bytes it does not work. In fact this is one of the reasons I switched up from a 16F877(a) part, due to it's 96 byte limitation. I no longer get the error on compile, but it still doesn't work.

Am I missing a configuration bit, include, ???

Thanks in advance for any input.

Sam

skimask
- 5th April 2007, 22:20
Can anyone help, please. I'm using a PIC18F4515 and PBP. I'm trying to recieve serial data into a byte array of 805 bytes. Everything I can find states that this should be possible, but anytime I go over 256 bytes it does not work. In fact this is one of the reasons I switched up from a 16F877(a) part, due to it's 96 byte limitation. I no longer get the error on compile, but it still doesn't work.

Am I missing a configuration bit, include, ???

Thanks in advance for any input.

Sam

Are we supposed to guess at what your source code looks like?
Even if we are, my guess is that your index variable for your array is a byte variable instead of a word variable.

Darrel Taylor
- 5th April 2007, 23:03
While the 18F's can have very large arrays, the STR function of SERIN, HSERIN etc, can only receive 255 bytes.

To get around this limitation you can just use multiple STR's in the xSERxxx command. For instance...
HSERIN [STR MyArray\255, STR MyArray(255)\255, STR MyArray(510)\295]

HTH,

skimask
- 5th April 2007, 23:08
..........Deleted.......

skimask
- 5th April 2007, 23:09
For instance...
HSERIN [STR MyArray\255, STR MyArray(255)\255, STR MyArray(510)\295]

HTH,

Somehow it looks like that last MyArray(510) won't work according to your explanation :)

Darrel Taylor
- 5th April 2007, 23:11
Why not? Oops OK, but you get the idea.

Fix it for me skimask :)
<br>

skimask
- 5th April 2007, 23:36
Why not? Oops OK, but you get the idea.

Fix it for me skimask :)
<br>

Hey...
You're the asst_admin, not me.

Darrel Taylor
- 6th April 2007, 00:23
I meant, fix the Statement, not the post.

It's your quiz for the day. :)

millersamsr
- 6th April 2007, 00:29
Skimask and Darrel,

Thanks. I'm sorry about not posting the code. I didn't have it with me when I posted the question. Thankfully, you've answered it before I had a chance to. I'll check it out in the morning.

I appreciate the rapid response. Have a great night.

Sam