MSP430 Debounce software

  • Posted:
  • Proposals: 1
  • Remote
  • #34692
  • Completed
Ian G. has already sent a proposal.
  • 0


Experience Level: Intermediate
We monitor Utility meters & also things like Heat meters etc.
We have a number of inputs on a variety of target hardware.
They all use the MSP430, are usually battery powered.
There can be up to 16 inputs on ports1 & 2.

Take a look at the attached files.

We need the attached (or new) code tested & debugged.

The code has NOT been tested & probably won\'t work.
But I think the principle is OK.

The first part selects the inputs that will be debounced & is called from the rest of the system, so don\'t worry about this.
This function is used on a variety of target hardware with varying numbers of inputs that require debouncing. However they are always on Port 1 or Port 2.
This part of the function is probably OK but can be changed if required.

The second part is called at a few millisecond intervals (~ 2mS).
This timer only runs after an interrupt has been received from one of the inputs, it having changed state. (high or low).
Having sampled all the inputs it puts the status into an array.
Then checks to see if the same bits in the array are all high or all low, vertically if you see what i mean.
This is basically a shift register with each new sample being shifted in & the oldest drops out. So if the shift register is all 1\'s or all 0\'s we know the input is stable.

The last two functions are the interrupt handlers for Ports 1 & 2.
They start (or continue) the main debounce timer.

We need to catch both active high and low switches.
If we are monitoring an electricity meter we can see pulses up to 25Hz.
So I think 40mS is the longest switch bounce we could accomodate. My feeling is 30mS would be best ??
On the other had we have water & gas meters that are very slow.

New Proposal

Create an account now and send a proposal now to get this job.

Sign up

Clarification Board Ask a Question

    There are no clarification messages.