This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430 not reacting on hardware IO inputs, serious error

Genius 4170 points

Other Parts Discussed in Thread: MSP430F5529

Hello again,

just another seriously strange problem occured in my device, although only twice until now, it is reproduceable.


I am using CCS 5.1 with the MSP430F5529

I am using the ports 1 as my buttons, so they are all defined as inputs, I can debug my code and also very clearly see that the portpins will switch to 1 when i push a button, eg when a voltage is applied to the pins. So far so good.

Now in my  used code I KNOW there is a high signal ( so button is pushed) but a while loop, looking at exactly those pins is not executed, so for example a long pressed button will not stop sending ones but instead send the 1 over and over again.

By send I mean it applies voltage to the pin, and my code is reacting to it, I also know it is not the best solution, I already got some timer debounce routines, but sometimes it seemed still handy for me to stop the code by polling a certain button.

I am working in a menu-style system and it was just easier to program some parts this way.

But anyway my loop then looks like this:

while ( P1IN& BIT2);

so it will get stuck in there until I release my button. I definetly also know i do not have debounce issues, since my Code was perfectly working, I rather think some strange things do happen beside my Code, but I cannot explain yet what.

So perhaps anyone has similar issues and can support me.

Thanks a lot.

seb

  • Are you saying that the while loop doesn't seem to get executed?

    You haven't provided any context for the one line of code provided. Without knowing what is before and after that line it is difficult to guess.

    But, I would hazard that the pin isn't high at the exact moment that the processor reads the register the first time.

    That could be because of switch bounce or the line of code is in the wrong place in your program.

    You need to provide some more details.

  • Hm , I thought the context of the line is not important, so what can I say it is just inside my menu structure, whenever I want to hold the code and wait until I release a button.

    As I said I am perfectly aware that it could get some serious debounce issues from the buttons attached, but we are working with this routine in some established product, and I did never expirience such problem.

    So my first thought is, that is has to do with my code not with my hardware, of course this might not be true, but its my first guess, judging from my expirience.

    Thanks for reading.

**Attention** This is a public forum