Jump to content
43oh

johnsondavies

Members
  • Content Count

    25
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by johnsondavies

  1. Checking back through my notes I've realised that I never had my program working with an SD Card library, so you can close this thread.

    However, it would be very useful if Arduino-compatible SD card support could be added to the Arduino core for the MSP430 range at some stage.

  2. I was developing a program for the EXP430FR5994LP in June 2018, using version 1.0.3 of the Energia IDE, and I'm pretty sure I was successfully able to read/write an SD card. I recently upgraded my installation to the latest version, 1.0.5, and now when I try and compile the same program I get the error:

    SD.h: No such file or directory

    referring to the line:

    #include <SD.h>

    Has the SD card support been removed from the Energia core, or am I remembering incorrectly?

  3. A bit more information:

    - The error occurs for the board MSP-EXP4305529LP, but seems to occur whatever board I have selected.

    - The error occurs for minimal sketches, eg Blink.

    - I think the last time it worked was before upgrading my Mac from El Capitan to High Sierra.

    - The Arduino IDE (version 1.8.5) works fine.

    I hope someone can help, as I am a bit stuck without the Energia IDE.

  4. I am storing data in program memory using PROGMEM, and reading it using pgm_read_byte() and pgm_read_word(), to save RAM.

    However, the compiler gives warnings:

    In function 'int lookupnumber(int)':
    warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

    I've read that it's not good practice to ignore these warnings, but I can't see how to eliminate them. A demonstration program is:

    const int numbers[] PROGMEM = { 2, 3, 5, 7, 11, 13, 17, 23 };
    
    int lookupnumber (int i) {
      return pgm_read_word(&numbers[i]);
    }
    
    void setup() {
      Serial.begin(9600);
    }
    
    void loop() {
      Serial.println(lookupnumber(4));
      for (;;);
    }

    Thank you.

  5. I am trying to set up a watchdog timer on the MSP430F5529 LaunchPad, and I can't seem to get it to work.

    My code is:

    void watchdogenable (int interval) {
      WDTCTL = WDTPW | WDTCNTCL | interval;
    }
    
    void watchdogreset () {
      WDTCTL = WDTPW | WDTCNTCL | (WDTCTL & 0x07);
    }
    
    void setup() {
      Serial.begin(9600);
      Serial.println("Start");
      watchdogenable(1);
    }
    
    int count = 0;
    
    void loop() {
      Serial.println(count++);
      delay(1000);
    }

    It prints:

    Start
    0

    and then gets no further before being reset by the watchdog 8 seconds later. I would expect it to count up to 8.

    If I take out the delay() statement it seems to work properly.

    Any suggestions?

  6. I've figured out why I got confused: I'd been testing the same source file (uLisp Zero) on ATmega boards, under the Arduino IDE, and on MSP430 boards, under the Energia IDE.

    I have the Preferences set the same on both IDEs, in particular, Compiler warnings: All.

    On the Arduino IDE the source compiles fine with no errors or warnings.

    On Energia when you select a different board any source, even BareMinimum, compiles with about 60 warnings the first time you compile it, many of these trivial and relating to the core; for example:

    <command-line>:0:12: warning: missing whitespace after the macro name [enabled by default]

    Compiling the same source a second time seems to suppress these warnings, but my source file still gives some warnings related to "strict-aliasing rules", presumably due to differences between the C compilers on the two platforms. But it runs OK.

    I installed the Energia MSP432 boards by Energia" package from Boards Manager to try the same source on the MSP432P401R LaunchPad, and I think the reappearance of the warnings confused me, and I falsely attributed them to the newly installed package. I should have taken more care to figure out what was going on before posting on the forum, and thanks for your tolerance!

  7. Thank you for your reply.

    The sketch is here: https://github.com/technoblogy/ulisp-msp430/blob/master/ulisp.ino

    There are several warnings, but the error when compiling for MSP430FR5969 is:

    Lisp102:442: error: return-statement with no value, in function returning 'boolean {aka unsigned char}' [-fpermissive]

    I have previously successfully uploaded and run this.

    (Note that I have also recently installed CCS7.1.0 in case this might have had an effect)

    Thank you,
    David

  8. I've been using Energia successfully (on Mac) with several programs and the MSP430FR5969 and MSP430F5529 LaunchPad boards for a couple of weeks now.

    Today I acquired an MSP432P401R LaunchPad and so installed the "Energia MSP432 boards by Energia" package from Boards Manager, version 3.8.0.

    After that all my MSP430 sources compile with large numbers of errors, and I can't get them to work.

    Is there some way I can undo the effect of installing the MSP432 update and get back to how things were before? I've tried downloading a fresh copy of the Energia application, and deleting the Energia15 folder in my Library folder, but I still get the errors and nothing works.

    Help!

×
×
  • Create New...