Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/04/06 03:50
Read: times


 
#128887 - SRAM HY62256 interfacing
Hi to all

I am using SRAM with AT89c52 for external ram data processing, i have a problem with interfacing that in programming when i declare an array like unsigned char xdata sbuf[buffer_size]in global than what happens it store the data, when i retreive the data from that to see the result on sbuf than it shows the alternate alphabets and in double form.

My program is like:

unsigned char xdata buff[BUFF_SIZE] = {'P','R','I','Y','A','N','K','A'};

main()
{
unsigned chaR i;
for(i=0 ; i<10 ; i++)
UART_putchar(buff[i]);

SBUF = ' ';
while(TI!=TRUE);
TI =FALSE;

while(1)
{

}

}

unsigned char UART_putchar(unsigned char c)
{
SBUF = c;
while(TI!=TRUE);
TI =FALSE;
return c;
}


And its output on sbuf:

RRYYNNAA



and using same program and only define : unsigned int xdata buff[BUFF_SIZE] = {'P','R','I','Y','A','N','K','A'};

Than it display all characters right . Output is : PRIYANKA

And i dont understand why only takes int ( datatype) to display right characters and why not with char datatype.. If anyone knows about that problem so let me know.....

Thanks & regards
Priyanka Gupta

List of 2 messages in thread
TopicAuthorDate
SRAM HY62256 interfacing            01/01/70 00:00      
   Duplicate Thread!            01/01/70 00:00      

Back to Subject List