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.

MSP430FR5994: Circuit diagram for FRAM-Utilities comp_e_monitor example

Part Number: MSP430FR5994

Hi,

I don't have much electronics background, so please excuse the beginner questions. 

I'm trying to setup the circuit for the "ctpl_ex3_comp_e_monitor" exercise in the FRAM-utilities CTPL examples page 28)


When I run the given example code, I can see the LED1 blinking as expected in the described sequence, but I want to see the backup/restore operation in action, so I'm trying to setup the supporting circuit (as mentioned below). I ran the code as it is without any additional circuits and couldn't get the backup/restore to work as expected.

The circuit in the documentation is as follows:

/           MSP-EXP430FR5994
//           ---------------
//       /|\|           P1.4|---> Vcc
//        | |       (C5)P1.5|---> Vcc/2 (350k/350k voltage divider)
//        --|RST        P4.7|---> GND
//          |               |
//          |           P1.0|---> LED1
//          |               |

However, I'm confused - shouldn't the P1.5 pin be an input <--- (it invokes an interrupt) rather than an output ---> ?

Similarly, are P1.4 and P4.7 outputs or inputs ? should they be connected to Vcc and GND respectively ?

Does anyone have a clear circuit diagram or explain a bit in detail how to get this example working ?

Thank you very much.

  • These arrows show just what the pins are connected to, not the actual signal direction.

    P1.5 should go to the middle of a voltage divider between VCC and GND.
  • Hi Clemens,
    thanks for your reply. So what about the P1.4 and P4.7 ? do we have to connect those physically to Vcc and GND respectively ?
  • The initGpio() function makes all GPIO pins outputs.

    The initCompMonitor() function make P1.4 output a high signal, and P4.7, a low signal. Apparently, you are supposed to use these two pins to construct the voltage divider.

  • Thanks that worked ! The LED continues from where it stopped, after power is switched off / on (I remove the J101 3v jumper to induce a power-cutoff)

    I have a doubt though - when I pull out the 3v jumper on J101, doesn't the power immediately go from 3V -> 0V, how would the MCU have enough power to perform an exhaustive back procedure ?

    Regarding the "COMP_E_ISR(void)" interrupt, is there a way we can see if the ISR code actually gets executed (it should, else the LED blink would reset) ?
  • The supply voltage drops somewhat slowly because of the various capacitors. (The MCU itself does not need much power, the LED uses up the largest part.) If the CPU reacts fast enough, it's quite easy to do something before the BOR happens. (You would need an oscilloscope to measure the timing.)

    The only way to check that the power-loss code has run is to see whether its permanent effects (writing to FRAM or flash) have happened.
  • Not sure if this is the way to measure the CTPL shutdown overhead, but if anyone is interested:

    I have now tried to measure the timing of the "ctpl_enterShutdown(CTPL_SHUTDOWN_TIMEOUT_64_MS);" process.

    I blinked LEDs before and after calling this function and measured on the oscilloscope. like so:

    P3OUT ^= BIT0;
    P3OUT ^= BIT0;
    P3OUT ^= BIT0;

    /* Enter device shutdown with 64ms timeout. */
    ctpl_enterShutdown(CTPL_SHUTDOWN_TIMEOUT_64_MS);

    P3OUT ^= BIT0;
    P3OUT ^= BIT0;
    P3OUT ^= BIT0;

    However I can't see the LED toggling after the function exits - I think the board switched off
    Between the first toggling and board switching off the time duration is ~90us

**Attention** This is a public forum