This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Memory overflow problem

Hi all,

I'm using 89C52 controller in my application. I'm using a 90 byte buffer to store received message from UART. Based on this received message I'm controlling I/O ports. The same buffer I'm using for transmitting the application dependent internal status message.

To identify the message I'm using absolute address position for example, if(arr[59] == '*'){do something;}

every first message after reset this is working fine. After that the control hangs somewhere thus its giving undetermined behavior.

I set the memory model as Large: all variables in XDATA.

I hope some address overflow is happening here.

Can anyone help me to resolve this issue.

Thanks in Advance.

Regards,
Ramesh

Parents
  • Thank you very much for your message.

    Actually I'm using polling method of message reception not Interrupt method.

    I have used two buffers of size arr[35] arr1[35] one for Txd and other for Rxd. There also same behavior.

    In this method it was working when im keep on reciving the message that means i'm using only arr[35] buffer.

    At the moment i started using the second buffer arr1[35] for transmitting. Its transmitting the message correctly and cpu hangs. only way i have to reset the controller.

    I think there is some severe memory overflow/system stack overflow happens when we are using array of characters.

    Expecting some suggestions.
    Thanks.

Reply
  • Thank you very much for your message.

    Actually I'm using polling method of message reception not Interrupt method.

    I have used two buffers of size arr[35] arr1[35] one for Txd and other for Rxd. There also same behavior.

    In this method it was working when im keep on reciving the message that means i'm using only arr[35] buffer.

    At the moment i started using the second buffer arr1[35] for transmitting. Its transmitting the message correctly and cpu hangs. only way i have to reset the controller.

    I think there is some severe memory overflow/system stack overflow happens when we are using array of characters.

    Expecting some suggestions.
    Thanks.

Children