AnsweredAssumed Answered

Losing code flow with MC9S08QG8. Help needed.

Question asked by Alejandro Bermudez on Nov 11, 2008
Latest reply on Nov 13, 2008 by Daniel Lundin
Hi, I've been working on this project with a couple of MC9S08QG8 and some ZigBee devices. Because of data type issues with the communication protocol, I decided to use Technoman64's itoa code.

void cargarpaq()

  char oriDirTmp[1];
  char desDirTmp[1];
  char msgTipTmp[2];
  char msgRecTmp[2];

  ItoaMsg(&oriDirTmp[0], "", device1, 1, 0);
  oriDirSnd = oriDirTmp[0];

  ItoaMsg(&desDirTmp[0], "", coordin, 1, 0);
  desDirSnd = desDirTmp[0];
  ItoaMsg(&msgTipTmp[0], "", msgCateg, 2, 0);
  msgTipSnd[0] = msgTipTmp[0];
  msgTipSnd[1] = msgTipTmp[1];

  ItoaMsg(&msgRecTmp[0], "", msgTarea, 2, 0);   
  msgRecSnd[0] = msgRecTmp[0];                        
  msgRecSnd[1] = msgRecTmp[1];                        


It does the rutine but then it goes lost at the end, it does't return to where it started, instead, it does some assembly code (which I honestly don't know what is about), then goes to a time interruption and finally it jumps back to a wrong point, missing several rutine calls.

Here is a screenshot of the debugger, if it helps.

I'm guessing I'm having ram or flash memory issues but I wouldn't know well how to solve them, so, I could use some ideas :smileyhappy:

Thanks in advance.