Hello, I am facing following issues with P2.6 and P2.7 on MSP430F2001. Below you can see test cases. From my pointo of view it is strongly suspected that there is bug in the silicon (more devices were put under these tests with the same results).
Test cases #1 to #3 and #6 show the expected behaviour, the other tests show unexpected behaviour.
Prerequisites: MSP430F2001 powered by VCC - GND. VCC = 3.3V
CA0 - CA2 : analog values, for Comparator_A+. These signals are connected to the resistive divider of 12V, through ~1kR resistors (e.g. for monitoring ~14V, there is 5.6kR and 1kR resistor to produce ~1.6V).
---Test #1: Timer_A---
LFXT1S = 2 => select VLOCLK, XTS = 0 => LFXT1 off (anyway, unsupported on my device), XT2OFF = 1 => (XT2 is not used)
SELS = 1 => SMLCK from VLOCLK (to be sure not to have it from DCOCLK, but it is not important for this and next tests)
SELM = 3 => MCLK = VLOCLK
SCG1 = 1 => SMCLK off
SCG0 = 1 => DCOCLK off
DIVA = 0 => ACLK = VLOCLK
Timer_A configuration:
TASSEL = 1 => Timer_A+ clock source from ACLK
ID = 3 => divider / 8 => Timer_A+ clock is ACLK / 8
TAIE = 1 (enable interrupts)
CCR0 = 0xFFFF
TAR = 0 (cleared with TACLR = 1)
MC = 3 => start up/down mode timer
Now, let's compute:
VLOCLK = 12kHz => ACLK = 12kHz
Timer_A+ frequency = 1.5kHz => up/down mode period is 2 * 0x10000 / 1.5kHz = ~87 seconds
TEST RESULT:
The measured value is ~87 seconds.
---Test #2: GPIO outputs on XIN and XOUT---
The same configuration as in test #1 plus next:
P2SEL = 0x00 (pins P2.6 and P2.7 used as GPIO pins)
P2DIR = 0xC0 (pins P2.6 and P2.7 used for output)
P2OUT = {0x00, 0x40, 0x80, 0xC0}
TEST RESULT:
Driving P2OUT pins works.
---Test #3: GPIO inputs on XIN and XOUT---
The same configuration as in test #1, plus next:
P2SEL = 0x00 (pins P2.6 and P2.7 used as GPIO pins)
P2DIR = 0x00 (pins P2.6 and P2.7 used for input)
Input circuit on P2.6 and P2.7 pins: pins connected to GND via button and to +VCC via 1kR.
TEST RESULT:
Reading P2IN pins works, interrupt run properly.
---Test #4: Timer_A with GPIO outputs on XIN and XOUT---
The same configuration as in test #2.
Testing time with Timer_A+ (as in the test #1).
TEST RESULT:
The measured timeout is 49 seconds.
---Test #5: Timer_A with GPIO inputs on XIN and XOUT---
The same configuration as in test #2.
Testing time with Timer_A+ (as in the test #1).
TEST RESULT:
The measured timeout is 49 seconds.
---Test #6: Comparator_A+---
The same configuration as in test #1 plus following:
CARREF = 2 (Vcc / 2 reference used)
P2CA = 4, CARSEL = 1, CASHORT = 0 (CA0 in one branch, next branch disconnected from CAx inputs, but connected to reference)
CAEX = 0 (V+ to CA0, V- to reference)
CAON = 1 (comparator on)
TEST RESULT:
Vcc = 3.20 to 3.23, CA0 analog, the comparator works always as expected.
---Test #7: Comparator_A+ and GPIO inputs/outputs on XIN and XOUT---
The same configuration as in test #3 (or test #4) plus Comparator_A+ configured as in the test #6.
TEST RESULT:
In the case that button is not pressed (P2.6 or P2.7 pin is not grounded, but is pulled to Vcc via 1kR), the comparator works always as expected.
Vcc = 3.20 to 3.23, CA0 analog input = 2.0V.
In the case that button is pressed (P2.6 or P2.7 pin is grounded), this results in 10% cases in false comparative value.
Vcc = 3.20 to 3.23, CA0 analog input = 1.95V.
In the case that button is pressed (P2.6 or P2.7 pin is grounded), this results in 90% cases in false comparative value.
---Test #8: Comparator_A+ and GPIO inputs/outputs on XIN and XOUT plus Timer_A---
The same configuration as in the test #7.
TEST RESULT:
The measured timeout is 49 seconds, not regarding on pin setting.