hi,
can anyone point me in the right direction on how to use cap touch button with the msp430f2618. have worked with the msp430g2553 before but it had cap touch enabled i/o so im a little lost.
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.
hi,
can anyone point me in the right direction on how to use cap touch button with the msp430f2618. have worked with the msp430g2553 before but it had cap touch enabled i/o so im a little lost.
There are two ways. Eitehr you simulate the oscillation circuit of the G sereis cap-touch support externally (You'll need an inverter, a resistor, and connect the inverter output through a multiplexer into the timer external clock input), or you use a completely different charge/discharge approach.Manjit Singh said:how to use cap touch button with the msp430f2618
Works for up to 6 pads simultaneously with one TImerB7. (TimerA works too, but has usually less CCRs)
Hi,
Thx for replying.
For my project i will need 4 buttons so il try to use the same method with timer_b.
i'ts a very intresting way of doing it.
i will try to do a simple blink led the way you discibed.
could you be kind and supply me with a demo code just on how to implement the function?
regards
This is part of the code I wrote for my employer, so I'm sorry, but I cannot post it. (there's almost no MSP-related code form me that doesn't belong to my company)Manjit Singh said:could you be kind and supply me with a demo code just on how to implement the function?
ok, im trying it right now and getting a change in the square wave on touch the pad, but only when i touch it not on proximity.
also i'm not quite sure on how to interupt on the compare like you discribed. and at what frequency have you set on the timer? becuse when i set the freq to 50 khz my square only gets smaller on touch.
regards
A touch will turn the capacitor into a resistive load. You must ensure that there is at least a small insulating layer between the pad and the finger.Manjit Singh said:ok, im trying it right now and getting a change in the square wave on touch the pad, but only when i touch it not on proximity.
There might be a hardware problem. I used BAT42 diodes. Schottky. Not every diode is suitable (large or too small leakage, large voltage drop etc.). Check polarity. The anode goes to the CCR0 output, the (usually marked) kathode to the pads.
For my own experients, I started with a piece of insulated wire instead of a pad. Last time I used it, the timer was running on 16MHz with a cycle count of 2000. So charge and detection cycle were 125µs each.
The compare interurpt is enabled by setting CCIE bit in TBCCTL0. It will trigger a TIMER_B0_VECTOR interrupt each time the timer reaches the value in TBCCR0. On every second call, there is a new value in each TBCCRx register.
The output mode to use is OUTMOD_4 (toggle).
The timer runs in up mode, clocked by whatever clock speed you have.The higher the clock speed, the higher the resolution of the measured discharge time. However, the cycle time, which is controlled by the value in TBCCR0, depends on the application (size of the pads, surrounding GND traces or - bad thing - a GND layer below.
The individual CCR registers are set for CM_NEG, CAP and the proper input pin (e.g. CCIS_CCIA). and of course need the pins to be configured for module usage.
**Attention** This is a public forum