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.

Timer B on CC2530 ZNP Minikit

Other Parts Discussed in Thread: CC2530

Hi,

I want to control an LED dimmer circuit using the CC2530 ZNP Minikit. I used the timerB example to output the PWM. The kit has the following P2 Connector Pinout as shown below. This detail is from the HW_Users_Guide (http://processors.wiki.ti.com/index.php/HW_Users_Guide).

P2 Connector Pinout
P2 pin number Signal name
1                      GND
2                      VCC
3                      MSP430 P2_2
4                      MSP430 P4_4
5                      MSP430 P2_3
6                      MSP430 P4_5
7                      MSP430 P2_4
8                      MSP430 P4_6
9                      MRDY/ MSP430 P3_6
10                    SRDY/MSP430 P2_6

From the pins, my understanding is that the output P2 Connector pins are connected to MSP 430 Port 2 - pin 2,3,4,6 (SRDY) and Port 4 - pin 4,5,6 and Port 3 - pin 6. 

Am I correct in my assumption?

With this assumption, I wrote the code for port 4 and the code is as follows

WDTCTL = WDTPW + WDTHOLD; // Stop WDT
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ; //
//4.4, 4.5, 4.6

P4SEL = BIT4; // Select Port 4
P4DIR = BIT4; //Set the direction to
TBCCTL0 = CCIE; // TACCR0 interrupt enabled
TBCCR0 = 500; //shorter ON
TBCTL = TBSSEL_2 + MC_2; // SMCLK, contmode

__bis_SR_register( GIE);
And in the ISR the following code
#pragma vector=TIMERB0_VECTOR
__interrupt void Timer_B (void)
{
P4OUT ^= BIT4; // Toggle P4.4
TBCCR0 += 50000; // Add Offset to TBCCR0 (longer OFF)
}
I am using a simple 2N2222 transistor with an LED. The output from Connector P2 pin no. 4 from the table above is connected to the
base of the transistor with a resistor. I tried different TBCCR0 settings for the OFF periods as well as for the ON periods of the Timer.
I dont see any changes in the LED. I have a couple of questions:
1) Will this set up work ?
2) Is the code correct to output from port 4 (pin4) to P2 pin no 4 on the minikit board as the output?
3) Is the frequency setting of 1MHZ too high for any visible effect on the LED?
I put the toggleLed(0) in the interrupt code and the output LED state changes. Unfortunately, I don't have an oscilloscope.
Being new to micro controllers, I would appreciate if the forum members could point me in the right direction.

Thanks,
DAC

**Attention** This is a public forum