What does backspace mean in UART?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,
  I am doing the simulation for a system-on-chip project, the processor
is PowerPC and in my code I have something like this,


int main (void) {
   print("Hello \r\n");

   print("ByeBye --\r\n");
   return 0;
}


  But in the simulator I can only see the "\r\n" after "Hello", I can
not see it after "ByeBye --". Instead I see all are 0x8, which is
BackSpace.

  I just wonder why the 2nd line return is missing? And where does all
those BackSpace come from?

Thanks.


Re: What does backspace mean in UART?
clinton__ snipped-for-privacy@hotmail.com writes:

Quoted text here. Click to load it

It's really hard to say given your description.  Don't worry about the
number "8", those backspaces are essentially just random characters
and don't mean anything.

My first guess is that your program is exiting before it has finished
outputting all the characters.  The UART may still be churning out
data even after your program has finished and its memory space has
been reused and overwritten.  Try flushing your output first before
exiting, or have your exit() function do this.

--
Darin Johnson
    "You used to be big."
We've slightly trimmed the long signature. Click to see the full one.
Re: What does backspace mean in UART?
Quoted text here. Click to load it

You execute a return in the main() of an embedded system. Most compilers
either put the CPU on halt or perform a reset. So your system might just
reset and therefore re-initialize the UART before it was able to complete
the transmission of the last byte(s). Try replacing the return with
while(1), which is an endless loop.

Meindert



Re: What does backspace mean in UART?

Quoted text here. Click to load it

That's also good.  I once had a coworker that needed the "simulation"
to actually exit when done, instead of being stuck in a loop, so that
Purify and other memory leak detectors could work.

--
Darin Johnson
    I'm not a well adjusted person, but I play one on the net.

Re: What does backspace mean in UART?
Quoted text here. Click to load it



????

Without posting what the 'print' function does, I'm at a loss. Maybe
'print' does something like 'printf' on your system?

Oh, K&R died a decade ago, go for ANSI my friend :-)

Al.

Re: What does backspace mean in UART?
Quoted text here. Click to load it


??

The snippet looks ANSI to me...

--
Grant Edwards                   grante             Yow!  I'm in direct contact
                                  at               with many advanced fun
We've slightly trimmed the long signature. Click to see the full one.
re:What does backspace mean in UART?
Hello Grant Edwards

My suggestion,  to test, is to put a while (1); loop t the end of you

code to see if this is a problem caused by executing a return. Yo
will face problems if you do not have any OS and execute a retur
from your code. Some compilers, such as the GCC for AVR processor
takes care of this return by a clean up code similar to start u
code


Re: What does backspace mean in UART?
Quoted text here. Click to load it

I think you're addressing the wrong person...

--
Grant Edwards                   grante             Yow!  ... Get me a GIN
                                  at               and TONIC!!...make it
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline