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.

G2452 Capacitive Sensing works only on P1.0

I am using the MSP-EXP430G2 Launch Pad. I have successfully used the WatchDog in interval mode and the TACLK in Timer0 to measure the frequency of Pin Oscillator on P1.0. In the WatchDog interrupt, I stop the timer, read TAR, clear TAR and start the timer for the next interval.

However, when I use the same code and change only the pin that has a running oscillator, I see the oscillations with my scope but TAR is always zero. I have ensured that the pin is not tied to some other option on the Launch Pad. I used Grace to set up the pins (and WD and TMR) and checked the code to ensure the correct bit is being set in P1SEL2 with P1SEL being zero. Also, as I say, I see the oscillations on the pin. I suspect I am missing a setting to route the pin to TACLK, but I can't find any reference to indicate such. It appears they are all connected and the reference indicates some may be OR'ed together. Hence only one pin at a time should be allowed to oscillate. For Timer0_A3, I have TACLK selected but the TA0CLK Input OFF (not routed to the pin). As I have said this works for P1.0.

Weird, yes! Ideas?

Regards,

JRockel

  • Hi Jeffry,

    Have you looked at any of the example projects?  There are code examples that show basic functionality.  Also we have a full featured library that handles all of this for you (along with base line tracking, etc).  I recommend using the library as it abstracts out the need to do the low level handling of the pinosc.

    Mike

  • Mike,

    I have seen the capsenselibrary and understand how to use it but would like to avoid the code-space overhead. Plus, I'm a hardware guy and abstraction takes me away from what I love and understand.

    I have not found example projects in the TI MSP430Gxxx section of the web site. I may not know where to look for the code examples you refer to. I only found the CAPTOUCH booster pack code (which I have successfully used with the booster board).

    Jeff
  • Mike, et. al.

    I found my problem, and solution. I went back to the CapacitiveTouchLibrary and began to dissect the HAL (Hardware Abstraction Layer) code. I LOVE how CCS grey's out all the undefined #ifdef sections. Anyway, the key is using the correct clock source for TimerA.

    In the MSP430x2xx Family Users Guide (SLAU144J) in Figure 8-1 it shows "TAxCLK" coming from the pin oscillator to TASESEL. In Grace in CCS, Timer0_A3>Power User - CCR0>Clock Source, I selected TACLK. However, Figure 8-1 shows the pin oscillator clock going to select input 3 (AKA INCLK). Changing TASSEL in TACTL from 0 to 3 (choosing INCLK in Grace) fixed the problem. (See section 12.3.1 in Family Guide).

    I greatly admire the software gals / guys who write the abstraction code. And I greatly appreciate the tools written into CCS to allow de-referencing the abstractions to get to the hardware. Thanks to all!

    Regards,
    Jeff

**Attention** This is a public forum