On Wed, 16 Feb 2005 23:20, Rawji, Marc wrote:
In short, I am trying to generate a string and then output it to the uart.
(code snippet)
char str[] = "test";
PORTA = 't'; //properly displays the ascii code for 't'
PORTB = str[0];
(end code snippet)
from what I understand, 'str' should be allocated into SRAM, which is
fine and it should be an array where str[0] = 't', str[1] = 'e', etc...
(snip)
Well, PORT A and PORTB are different. 'str[0]' always returns 0xFF on
the LEDS.
0xff almost certainly means it isn't in SRAM..
I think the problem is because it's static the compiler puts it in PGM space.
Does..
char str[10];
strcpy(str, "test");
work?