Jump to content


Recommended Posts

Hello Medsimo,


quick viewed into the attached Energia sketch, so far you forgot that Arduino/Energia do not want "int main()",

they expect "void loop()" instead.

a few more items which are suspect:


>  /*** Watchdog timer and clock Set-Up ***/
> WDTCTL = WDTPW + WDTHOLD;   // Stop watchdog timer
> BCSCTL1 = CALBC1_8MHZ;      // Set range
> DCOCTL = CALDCO_8MHZ;       // Set DCO step + modulation
the MSP-EXP430G2 board is defined and setup running at 16MHz, so if you go and change anything related
to that 16Mhz down to 8Mhz, you may get garbage even if you changed main()->loop().
it may send with 4800 baud.
your way to disable the WD may also cause problems.
below my guesswork
void setup() {
  Serial.begin (9600);
  delay(500);                                <==== some delay
  Serial.println("Setup done");     <==== quick check if setup() did finished.
void loop() {   <=== you need "void loop()" instead of "int main()"
  /*** Watchdog timer and clock Set-Up ***/
  //WDTCTL = WDTPW + WDTHOLD;   // Stop watchdog timer   <=== SUSPECT! So commented out.
  BCSCTL1 = CALBC1_8MHZ;      // Set range   <==== this and the one below, may cause 4800 baud!!!
  DCOCTL = CALDCO_8MHZ;       // Set DCO step + modulation


this should at least show you something on your terminal ~ 4800.

best regards

Peter ;-)

Link to post
Share on other sites

Hello Medsimo,


i would reduce it even more, remove all except Serial.begin() and Serial.println()

in loop(), do some sort of 

int i;



then figure out that is going wrong with your com ports.

double-check the EXP-430G2 user manual, i mean the jumper settings for TX/RX!

i am not a windows user (a hater), so may not able to help much on windows.
however, i saw com port numbers changing similar to linux after flashing the EXP-MSP430G2.
so flash a reduced sketch, close energia, open energia, select com port and try again with serial monitor or a terminal program.

best regards

Peter ;-)

Link to post
Share on other sites
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...