--- In AVR-Chat@yahoogroups.com, David VanHorn <microbrix@...> wrote: > > ... pgm_read_byte_near is returning > values that aren't anything like > what's in the string ... > LCD_Data_A = pgm_read_byte_near(BootString[i]); > lcd_putc(LCD_Data_A); You're passing to pgm_read_byte_near() character values taken from data memory at the address of BootString in program memory. I would expect some kind of warning from the compiler about the implicit cast from the char value to the pointer expected as the argument. Do you have all the warnings turned on? You need to pass to pgm_read_byte_near() the address of the character you want to read, thus: LCD_Data_A = pgm_read_byte_near( &(BootString[i]) ); Graham.
Message
Re: WinAVR / GCC question re Stack
2009-03-25 by Graham Davies
Attachments
- No local attachments were found for this message.