Confused by Arraywrite

I've looked at the examples and posts on here and they are helpful but.....

OK I have a 38x25 display.
I can talk to it using hserout and have a 1ms interrupt running so want to send it 1 character every ms.
No problems so far. I can do that.

I've modded the pb3 library (using the example post) to allow a 1000 element array to store my display data (38x25 = 950)
Not sure i need to do this and might be better using a smaller array (38 elements) and line at a time... :?

So some questions.. when i write to the array using array write what happens when it gets to the end? 1000th character is sent to it.
Yes it exit's but how do you reset it and start filling it from the beginning?
Does it reset every time you do an Array write?
What happens to the overflowed characters?
Do you have to manage the length to ensure the message you are sending so it will fit in?

The ARRAYWRITE command loads what you want into a Table. In the code above, the ASCii "SOMETHING" is contained in the Table. The LOOKUP command pulls the ASCii letters from the Table one at a time and makes them available to the variable b1. If you wanted to send a dynamic value you could use:

In the above code an ADC value is read from AN3 to Pot then turned to ASCii ([#Pot]). If the Pot value is 133, "ARRAYWRITE Letter, [#Pot]" will load the Array "Letter" with "1", "3", and "3". The code is abbreviated to get the idea across, not intended to be plug-n-play.

As for a 1000 Byte Array, PIC pages are limited to 256 bytes. You'll probably have to create 4 separate Tables to accommodate all 1000 variables. Consider an Array that contains the alphabet and numeric characters, or whatever, or a subroutine that converts your desired output to display-compatible format.

Re: Confused by Arraywrite

mikes quote here is very wrong

As for a 1000 Byte Array, PIC pages are limited to 256 bytes. You'll probably have to create 4 separate Tables to accommodate all 1000 variables.

from the manual

Arrays must fit entirely within one RAM-bank on 12-bit and 14-bit devices (PIC10, PIC12, and PIC16). Arrays may span banks on PIC18 devices. On PIC18 devices, BYTE, WORD and LONG-sized arrays are only limited in length by the amount of available memory. The compiler will assure that arrays, as well as scalar variables, will fit in memory before successfully compiling.

Re: Confused by Arraywrite

Well Richard, Making the statement LOOKUP2 does not seem to work. I have no idea where the data is coming from but, it is not what I set the ARRAYWRITE statement with. The only thing that is correct as I can see it is the string length.

Re: Confused by Arraywrite

your correct dave , I have fallen into a trap set by mike, a sram array is not a valid source for any pbp lookup command . the concept seems flawed anyway surely the lookup table source should be the translated data table and the outarray data the index. we already have b0 as a pointer to the outarray data .
my intent was just to demonstrate how to cycle through an array of variable length using a null as the end marker

Re: Confused by Arraywrite

Retypesnikrep, what are you wanting to display? Is there constants like "Temperature is " along with variables like "TempC VAR BYTE"? I've used the HD44780 based LCD for several projects. A display line would look like: