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.
Hello,
This is my first time using the Timer A Capture/Compare Mode and for what I am doing I need to do this by hardware, since I need a faster frequency.
The question is how can I specify to which port I set the output signal ?
#include "msp430g2231.h"
/* Function Definitions */
void main(void) {
WDTCTL = WDTPW + WDTHOLD; // disable watchdog
P1OUT=BIT0;
P1DIR=0x41; //P1.0 y P1.6 to relay(LED)
//BCSCTL1 = CALBC1_1MHZ; // Set DCO to calibrated 1 MHz.
//DCOCTL = CALDCO_1MHZ;
TACCR0 =10; // A period of 10.
TACCR1= 8; //A period of 8.
TACTL = TASSEL_2 + MC_1 ; // SMCLK,up mode,
TACCTL0= OUTMOD2;
__enable_interrupt();
for(;;) { // Do nothing while waiting for interrupts. This would be an
} // an ideal place to use low power modes!
} // main
You should review the datasheet found on the MSP430G2231 Product Folder. You will want to look at the pins which have TA0.0 and TA0.1. Then review the Pin Schematics found in the Application Information section of the datasheet to determine how to configure the targeted pins to propagate out the TimerA0 CCR0 and CCR1 output.
For example, you can see the output of CCR0 (ie. TA0.0) on pin P1.1 and P1.5. CCR1 (ie. TA0.1) on pin P1.2 and P1.6.
P1DIR |= 0x03 ;
P1SEL |= 0x03 ;
or
P1DIR |= 0x60 ;
P1SEL |= 0x60 ;
**Attention** This is a public forum