So when you have a pointer that points to a block of memory, such as an array or a part of an array, you can treat that pointer ``as if'' it were an array, using the convenient notation. In other words, at the beginning of this section when we talked about *ip, *(ip+1), *(ip+2), and *(ip+i), we could have written ip[0], ip[1], ip[2], and ip. As we'll see, this can be quite useful (or at least convenient).
I have to disagree, this is standard C behavior.
Can you try the following, they work fine for me in keil uvision (ARM version) and copy the content of array1 to array2
I'm really grateful for your help but nothing you put here seems to work for me...
So I decided to do it in another completely manner but I also get a problem this way, although it's the nearest thing to get it working that I have, in fact I see the problem as even more weird, maybe you can help me with this.
This is the code:
Code:
#include <p18cxxx.h>
#include "xlcd.h"
#pragma config OSC=INTIO67, FCMEN=ON, WDT=OFF, IESO=ON, XINST=OFF, LVP=OFF
char XLCD_Disp1[] = "1234567890";
char XLCD_Disp2[] = " PIC_UC ";
void main(void)
{
unsigned char config=0xFF,i=0,addr=0,data=0;
ADCON1 = 0xFF;
TRISD = 0;
PORTD = 0;
TRISB = 0; // Port,pin direction configuration
PORTB = 0;
TRISC = 0;
PORTC = 0;
TRISCbits.TRISC7 = 1; // make sure this pin is input
TRISE=0;
config = FOUR_BIT & LINES_5X7;
//******** Configure LCD for four line communication and 5X7 line display *********************************
OpenXLCD(config);
busylcd(); //wait untill LCD controller is busy
//*********** Set the starting address in the LCD RAM for display. This determines the location of display ********
SetDDRamAddr(0x80);
busylcd(); //wait untill LCD controller is busy
putsXLCD(XLCD_Disp1); //Display string of text
busylcd(); //wait untill LCD controller is busy
//********** Set the address in second line for display ****************************************************
SetDDRamAddr(0xC1);
busylcd(); //wait untill LCD controller is busy
putsXLCD(XLCD_Disp2); //Display string of text
busylcd(); //wait untill LCD controller is busy
putcXLCD(0x5F); //dsiplay some chrecter
busylcd(); //wait untill LCD controller is busy
SetDDRamAddr(0x20);
busylcd(); //wait untill LCD controller is busy
while(1); //end of program
}
void busylcd(void)
{
LCDDelay();
LCDDelay();
LCDDelay();
}
void LCDDelay(void)
{
int i=0;
for (i=0;i<250;i++);
}
But the display just shows on first line "1" and on the second "P", nothing more.
Could you please tell me what might be failing? I don't have an idea and I'm seriously going nuts with this thing, so I'd appreciate it a lot.