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.

MSP430FR2355: trying to use CIO on MSP430FR2355EVM??

Part Number: MSP430FR2355

Hello...

I've been spending all morning looking for a simple good explanation on how to just print an A/D value to the console but to no avail.  I have reviewed the tips suggestion that uses puts but it doesn't seem to help here unless I convert A/D to string.  I have increased both stack and heap to 400 and am successful at printing Hello World using puts.  

I have a simple TI example that takes A/D data and would like to print it to the console every time the ISR triggers so as to see the value.  Can someone tell me if this is possible with this EVM and if so how do I do it?  The puts statement is annoying as the code breaks somewhere in trgmsg.c each time plus only does strings.  printf doesn't seem to work???

Thanks

Steve

  • More info......

    Thru some action (Heap and Stack are at 400) the printf is now working.  I changed them to 1024 and it sort of 'kick - started'....went back to 400 and it is till working.

    The only thing to iron out is (even though I have no breakpoints set) why does the code ALWAYS stop prior to a print to the console at line:

        for (i = 0; i < length; i++) PACKCHAR(*data++, p, i+8);
    

    in trgmsg.c?

    Is there a way to have code just keep running and printing to screen?

  • Hi Steve,

    Have you ever try to redirect printf ? Printf will call fputc. You can redefine the fputc() to send the data you want like through UART.

  • Hi Allen.

    I have never tried to re-direct.  Not sure how to do this.  I have done this (with the help of a youtube video) with STM32 products, but here I seem to have access to the .c files where system functions are accessible.  When I place printf or putc or fputc into main I cannot get the code to jump to the source file.  Any help on this?

    Thanks

    Steve

  • The puts statement is annoying as the code breaks somewhere in trgmsg.c each time plus only does strings.

    For a MSP430FR2355 that appears to be cause by errata EEM23 - see MSP430FR2675: How to enable printf output to console in CCS 10? for the same issue seen on other MSP430FR devices for which could also replicate on a MSP430FR2355.

  • printf doesn't seem to work???

    I had a look at that using CCS 10.4.0.00006 and TI compiler v21.6.0.LTS:

    1. Create a new "Empty Project (with main.c)" for a MSP430FR2355. This gets created with "Level of printf/scanf support required (--printf_support)" set to minimal.

    2. Use the following code, for a example example of a formatted string:

    #include <msp430.h> 
    #include <stdio.h>
    
    
    /**
     * main.c
     */
    int main(void)
    {
    	WDTCTL = WDTPW | WDTHOLD;	// stop watchdog timer
    	
    	printf ("Hello World! (FRCTL0=0x%x)\n", FRCTL0);
    
    	return 0;
    }
    

    3. In the CCS project properties under CCS Build -> MSP430 Linker -> Basic Options set the heap size and stack size both to 300 bytes (sufficient on other examples).

    4. When run it stops in trgmsg.c, but if resume after has stopped then the printf output does appear on the CCS Console:

    Hello World! (FRCTL0=0x9610)

    5. If after has halted at main, in the Registers view under FRCTL set the value of FRCTL to 0xa500 to change NWAITS from the default of 1 to 0.

    Now, when run the program get the following output on the CCS Console without the program stopping in trgmsg.c (and the reported value of FRCTL0 shows NWAITS is now zero):

    Hello World! (FRCTL0=0x9600)

    Note that the work-around of setting NWAITS to zero to stop the debugger halting in trgmsg.c, apparently due errata EEM23, is only valid if the program is setting the Processor frequency (maximum MCLK frequency) <= 8 MHz.

  • Thank you!

    Yes this works.....

**Attention** This is a public forum