avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Problem with Strings and Serial I/O


From: E. Weddington
Subject: Re: [avr-gcc-list] Problem with Strings and Serial I/O
Date: Fri, 29 Jul 2005 21:25:33 -0600
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

User Tomdean wrote:

I have another problem with porting an application from 68hc11 to an
stk500.

I have an ATmega16-16 processor, clocked at 3.6864Mhz.

I have a lot of strings loaded into flash, as a processor learning
tool.  Things that dump registers out the UART, etc.

The strings appear to be overwritten by code, etc.  Some are missing
in the output and others appear jumbled.

I reduced the application to one that only sends strings out the UART.
I use a serial_send() and a serial_print() function for the strings.
The serial_print() function calls the serial_send() function until the
end of the string, '\0'.

Looking at flash with avrdude, the strings look OK after a run where I
see strange characters.

Looking at code with avr-objdump -d , I don't see anything wrong.
But, I only looked for an hour.

Any ideas?  I can post the code, if anyone is willing to try it.  At
this point, this would help.

I think that other than compiler options, all that needs changing in
the code is the serial_init() function, to set the proper baud rate.
I have a table at the top of the function.

I only use the avr-gcc supplied avr/io.h.

tomdean
That sound suspiciously like you have pointers that are messed up and getting text from a pointer to RAM and not the pointer to Flash. Look carefully over your code and compare the cases where you are correctly getting the text and the cases where you are getting garbage. See if there is any differences in how it's coded.

HTH
Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]