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.

CCS/MSP430FR6972: msp430fr6972

Part Number: MSP430FR6972
Other Parts Discussed in Thread: MSP430F4152

Tool/software: Code Composer Studio

Hello,

I am using MSP430FR6972 Microcontroller.

I am using IRDA program. (IRDA Module : HSDL-4400-031 & HSDL-5400-031) .

There is a customized board, I have to make program according to that board.

I have made partially, actually I am little confused to make full program.

Can you please help me.

PROGRAM:

unsigned char RxByte;
volatile unsigned char RxData[256];
unsigned char TxByte;
volatile unsigned int ir;

void irda();

int main(void)

{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer

PJSEL0 = BIT4 | BIT5;
PJDIR = 0xFFFF;

// Configure GPIO
P3SEL0 |= BIT4 | BIT5; // irda operation
P3SEL1 &= ~(BIT4 | BIT5); //irda operation

 PM5CTL0 &= ~LOCKLPM5;

CSCTL0_H = CSKEY >> 8; // Unlock CS registers 
CSCTL1 = DCOFSEL_3; // Set DCO to 4MHz 
CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK; 
CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1; // Set all dividers to 1 
CSCTL4 &= ~LFXTOFF; // Enable LFXT1 
do 
{ 
CSCTL5 &= ~LFXTOFFG; // Clear XT1 fault flag 
SFRIFG1 &= ~OFIFG; 
}while (SFRIFG1&OFIFG); // Test oscillator fault flag 
CSCTL0_H = 0; // Lock CS registers 


irda();

while(1)
{

for (ir=1000; ir; ir--); // Small delay
while(!(UCA1IFG & UCTXIFG));
UCA1TXBUF = TxByte;

__disable_interrupt();
UCA1IE |= UCRXIE; // Enable RX int

__bis_SR_register(GIE); // Enter interrupts

LCD[3] = lcd_num[5];
RxData[TxByte] = RxByte; // Store RXed character in RAM
LCD[2] = lcd_num[RxByte];
if (TxByte != RxByte)
{
LCD[0] = lcd_num[8];
while(1);
}
TxByte++;

}
// return 0;
}

void irda()
{
UCA1CTL1 |= UCSWRST;
UCA1CTL1 = UCSSEL_2;            //(0x0080)
UCA1BR0 = 26;
UCA1BR1 = 0;
UCA1MCTLW = UCBRF_1 + UCOS16;
UCA1IRTCTL = UCIRTXPL2 + UCIRTXPL0 + UCIRTXCLK + UCIREN;
UCA1CTL1 &= ~UCSWRST;
UCA1IE |= UCRXIE;
}

INTERRUPT PROGRAM  :

#pragma vector = USCI_A1_VECTOR
__interrupt void USCI_A1_ISR(void)
{
RxByte = UCA1RXBUF; // Get RXed character
UCA1IE &= ~UCRXIE;
}

(I took the reference from MSP430F4152)

I also upload the circuit.

(In the circuit there are more pins, needs to be added).

Can you please please help me to solve the problem. (any code).

Regards,

Srijit

  • Hello,
    If this circuit is wrong,
    please suggest me with new circuit as well as program(with this IR Module).

    Regards,
    Srijit.
  • Hey Srijit,

    I've edited you post to use our code insertion tool, wich is the </> button if you clide the "Insert Code, Attach Files and more..." link below your replys. this will help everyone read your code and give advice.

    I took a quick look, but I'm not sure what you need help with. Can you ask a more specific question?

    Also, why did you use an example from MSP430F4152? You can find all basic MSP430FR6972 code examples here: dev.ti.com/.../

    Thanks,
    JD
  • Hi JD,
    Thank you for your reply.
    Basically I need two help.
    1 ) I want to make the IRDA connection with MSP430FR6972 using UCA1 communication.
    (Actually the schematic I uploaded, I do not know is correct or not ?
    OR
    Any modification in the connection in that schematic ?)

    2) How to make program .(if you can help me with any code)
    I was checking the IRDA datasheet, but it is confusing to me.

    My motive is to make communication through IRDA.
    And if I need to check that in Computer,
    please tell me how can I check that.

    Hope to get positive response from you soon.
    Regards,
    Srijit.
  • Hi,
    MSP430F4152 is taken as reference for making IRDA program.
    Regards,
    Srijit
  • Hey Srijit,

    So after some searching, I was able to find this App note on implementing IrDA on MSP430: www.ti.com/.../slaa202b.pdf

    Unfortunantly, it doesn't use a MSP430FR6xxx device, so you would have to port it. Also, it looks to being a IrDA transciever so their hardware connections will be different from what I see in your schematic.

    Thanks,
    JD

**Attention** This is a public forum