interrupts messin' with vsprintf ?

I have a 1ms fixed time interrupt scanning and debouncing a couple of switches, and a 1200 baud port receiving blocks of 17 chars 4 times a sec.
Asynchronously at 5 times/sec, I'm assembling an 8 character string to display on an 8 character DM display.
This code now uses a vsprintf statement, and occasionally the output string gets leftshifted one character in the buffer.
Surrounding the vsprintf call by EA=0 and EA=1 solves the problem, but the resulting delay to my fixed time interrupt messes up the switch scan.
Anybody have any clues on why vsprintf is getting upset, and how to get around it?
Thanks in advance.

Parents
  • You have only 3 tasks: Background, Timer, Serial.

    What are the priority levels of Timer & Serial?

    Is vsprintf is used only in Background?

    Does "string gets leftshifted one character" mean that it is always the 1st character in the buffer is dropped?

    How do you know the character is being dropped? Is it being detected on the receiver end, or do you break on an assertion while using the ICE?

Reply
  • You have only 3 tasks: Background, Timer, Serial.

    What are the priority levels of Timer & Serial?

    Is vsprintf is used only in Background?

    Does "string gets leftshifted one character" mean that it is always the 1st character in the buffer is dropped?

    How do you know the character is being dropped? Is it being detected on the receiver end, or do you break on an assertion while using the ICE?

Children
More questions in this forum