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.

MSP430FR5969: Random number generator example

Part Number: MSP430FR5969

I'm trying to use the random number generator code from this example:
http://processors.wiki.ti.com/index.php/MSP430_FAQ#How_to_generate_random_number_with_MSP430_devices.3F 
Additionally I set the ACLK to use the VLO using:  
CSCTL2 = SELA__VLOCLK | SELS__DCOCLK | SELM__DCOCLK;

When I run this code it hangs on: 
while(!(TA0CCTL1 & CCIFG));
This is probably because I'm using a different MSP family: MSP430FR59xx

I found this additional info: https://e2e.ti.com/support/microcontrollers/msp430/f/166/t/446531

But I'm not sure what to change to make it work.
Page 62 of the datasheet http://www.ti.com/lit/ds/symlink/msp430fr5969.pdf

  • Just like mentioned by Dennis in the other E2E post you referred to, CCI2B for ACLK (internal) operates from TA2 for the FR5969 so you should be initializing this timer instead of TA0 for an ACLK input capture.

    Regards,
    Ryan
  • I get confused by the table, the name is : TA0 Signal Connections
    and then TA2 is the MODULE SIGNAL

    I replaced TA0CCTL1 with TA0CCTL2 and TA0CCR1 with TA0CCR2 and now it seems to work...

    I also changed this line:
    TA0CTL = (TA0CTL & 0xFCFF) | ((TA0CCR1 & 0x03) << 8);
    into:
    TA0CTL = (TA0CTL & 0xFF3F) | ((TA0CCR2 & 0x03) << 6);

    because it changed the clock source instead of the timer division.
  • My mistake, once again I was just basing my recommendations from Dennis' suggestions. It makes sense to use CCR2 since that is the module block tied to the internal ACLK input signal. At any rate I'm glad to hear that you have the example working.

    Regards,
    Ryan

**Attention** This is a public forum