Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workshop — Issue with PWM on MSP430F5529 + EduBP-MK2 #43

Open
rei-vilo opened this issue Jun 5, 2018 · 7 comments
Open

Workshop — Issue with PWM on MSP430F5529 + EduBP-MK2 #43

rei-vilo opened this issue Jun 5, 2018 · 7 comments

Comments

@rei-vilo
Copy link

rei-vilo commented Jun 5, 2018

The following basic sketch sometimes runs and sometimes freezes on the MSP430F5529 LaunchPad and Educational BossterPack-MK2.

// Define variables and constants
#define redLED 39
#define greenLED 38
#define blueLED 37

// Add setup code
void setup()
{
    Serial.begin(9600);
    Serial.println("*** RGB LED");

    pinMode(redLED, OUTPUT);
    pinMode(greenLED, OUTPUT);
    pinMode(blueLED, OUTPUT);
}

// Add loop code
void loop()
{
    for (uint16_t i = 0; i<256; i++) {
        Serial.print("\r Red-Green   ");
        Serial.print(i, DEC);
        analogWrite(redLED, 255-i);
        analogWrite(greenLED, i);
        delay(10);
    }

    for (uint16_t i = 0; i<256; i++) {
        Serial.print("\r Green-Blue  ");
        Serial.print(i, DEC);
        analogWrite(greenLED, 255-i);
        analogWrite(blueLED, i);
        delay(10);
    }

    for (uint16_t i = 0; i<256; i++) {
        Serial.print("\r Blue-Red   ");
        Serial.print(i, DEC);
        analogWrite(blueLED, 255-i);
        analogWrite(redLED, i);
        delay(10);
    }
}
@StefanSch
Copy link
Collaborator

Does it freeze directly after loading or also if it is running while.

@rei-vilo
Copy link
Author

rei-vilo commented Jun 8, 2018

*** RGB LED is sent to the console, so it freezes after.

Problem is, the issue raises randomly.

@StefanSch
Copy link
Collaborator

but only sometimes ?
Can you try the same with a faster baud rate, e.g. 115k?

@StefanSch
Copy link
Collaborator

Can you also check this line
#define redLED 39
the device only has 38 pins

@rei-vilo
Copy link
Author

rei-vilo commented Jun 11, 2018

Same issue with Serial.begin(115200);, but this time nothing is sent to the console, the issue occurs before sending the first Serial.println("*** RGB LED");.

Pressing the RESET or BSL buttons does nothing, only power-cycling the board.

#define redLED 39 refers to the LaunchPad pin 39, as defined in pins_energia.h line 164

static const uint8_t P1_5 = 38;

@StefanSch
Copy link
Collaborator

The link to pins_energia.h goes to the MSP430F5529 but the title says MSP430F2955 ???

@rei-vilo rei-vilo changed the title Workshop — Issue with PWM on MSP430F2955 + EduBP-MK2 Workshop — Issue with PWM on MSP430F5529 + EduBP-MK2 Jun 11, 2018
@rei-vilo
Copy link
Author

Sorry, I was talking about the MSP430F5529.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants