Closed pbrier closed 12 years ago
Good catch! I indeed forgot to add the TA1
to the pins_energia.h
when I updated the wiring_analog.c
to include TA1
. Obviously the code is not tested because of missing pin defs in the .h file which makes this a rather sloppy check in :-(.
TA0.2 indeed does not show on the 20 pin flavors. In fact, it does not show on any of the pin outs yet it seems that TA0.2 is on P1.4 on some devices. TA0.2 seems to only be there if the device features a Comparator. E.g. The diagram "Port P1 Pin Schematic: P1.4, Input/Output With Schmitt Trigger" in the g2553 data sheet shows TA0.2 on P1.4. On the contrary, the same diagram in the data sheet for MSP430G2x33 and MSP430G2x03 do not show TA0.2 on P1.4 due to the lack of the comparator. Let me confirm with the msp430 team in TI. I vaguely remember that I did test analogWrite on P1.4 and verified with a scope. If P1.4 indeed lacks TA0.2 then I agree with your pin def. I am OK with you checking in the T1Ax changes but leave the following in there for now.
//TODO:only g-series with comp have TA0.2 on P1.4??
#if defined(__MSP430_HAS_CAPLUS__)
T0A2, /* 6 - P1.4 */
#else
NOT_ON_TIMER, /* 6 - P1.4 */
#endif
Confirmed that the data sheet is incorrect. e.g. MSP430G2553 does not have TA0.2 on P1.4. Some devices do have TA0.2 on P1.4. It is unclear how to figure out which ones do and which ones don't so am leaving P1.4 as NOT_A_TIMER for now. Commit: 1a311af
Are we sure the pin numbering is right for port 2? The TI doc says p2.0 = pin 8 p2.1 = pin 9 p2.2 = pin 10 p2.3 = pin 11 p2.4 = pin 12 p2.5 = pin 13 p2.6 = pin 19 xtal p2.7 = pin 18 xtal
There is a minor error in the file https://raw.github.com/energia/Energia/master/hardware/msp430/variants/launchpad/pins_energia.h naming pin 18 twice. Is this what you are referring to?
I was referring pins 10,11,12 and 13 which do not appear to agree with the launchpad silk screen or the TI data sheet. P2.2 should be on pin 10...
T1A0, /* 8 - P2.0 note: A0 output cannot be used with analogWrite */
T1A1, /* 9 - P2.1 */
T1A1, /* 10 - P2.3 */
T1A0, /* 11 - P2.4 note: A0 output cannot be used with analogWrite */
T1A2, /* 12 - P2.5 */
T1A2, /* 13 - P2.6 */
NOT_ON_TIMER, /\* 8 - P2.0 _/
NOT_ON_TIMER, /_ 9 - P2.1 _/
NOT_ON_TIMER, /_ 10 - P2.3 _/
NOT_ON_TIMER, /_ 11 - P2.4 _/
NOT_ON_TIMER, /_ 12 - P2.5 _/
NOT_ON_TIMER, /_ 13 - P2.6 */
of course I could be reading header files wrong...
You are absolutely right. The pin comments are wrong. I have pushed a fix with commit id: fe9d061
The analog pin/timer definition is incorrect in pins_energia.h. Timer1 outputs are not available.
Note: due to the fact that compare register 0 is used as the PWM period, only two analog outputs are available per timer. And OUT0.2 is not available as a pin, a maximum of 3 independent outputs are available on the 20PIN devices.
Proposed definition: