Hello,
I'm trying to hook some LEDs to my pin out and get them to dim on and off. I found some code here: http://focus.ti.com/lit/an/swru227/swru227.pdf (which is shown below) but I'm not able to get it to work and am not exactly sure I see where port 1 pin 1 is either.. :-/ (Maybe its one of the LEDs on the chip? Either way nothing is dimming.)
Anyways, my questions are
- does this simply just enable dimming when this pin is turned on and off?
- how does one make the pin dim if so? just turn it on and off or is there something more to it?
- if I wanted to set it so that Pin0_7 was dimmed, would I add this line:[ P0SEL |= 0x60; // 01100000 ]?
Let me know if anyone has any suggestions and thank you so much!
~A
p.s. I just found this which seems to have code in it, I'm going to comb through:
http://focus.ti.com/lit/an/swra305/swra305.pdf
<pre>
// Turning on and off various pins
P0_7 ^= 1; // toggle pin 7
P0_6 ^= 1; // toggle pin 6
/* Timer 1 set Modulo Mode, pre-scaler = 128 (set in T1CTL) */
/* Freq. set by T1CC0H:T1CC0L = 0x1ff */
/* Counter Tick freq = 13MHz / 128 */
/* PWM freq = 13M / 128 / 511 = 198.75 Hz */
T1CC0L = 0xff; T1CC0H = 0x01;
/* Timer 1 channel 1 set compare mode 4 */
T1CCTL1 |= 0x24;
/* Prescaler set to Tick Freq / 128 */
T1CTL |= 0x0c;
/* Timer 1 CFG set to Alt 2 location */
PERCFG |= 0x40;
/* P1_1 set peripheral func which associated with Timer 1 output */
P1SEL |= 0x2;</pre>