Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Noob wants to use external Crystal and 19200 Software UART

$
0
0

Hello  :biggrin:  I'm new to MSP430.

 

I want to start with a small project. 
And I want to communicate with a Siemens mobile phone using AT-Commands. 
 
I once had started the project with an ATMega8 before 2-3 years, but I unfortunately buried it.
 
At that time I also had an external crystal, used to achieve the exact baud rate of 19200.
 
How can I achieve that with a Lauchpad Rev. 1.5 and MSP430G2452? 
 
How do I initiate the external 32 kHz Crystal with energia? what I need to add to the setup() function?
 
Can I use any port as RX or TX?
 
 
#include <SoftwareSerial.h>

SoftwareSerial mySerial(P1_4, P1_3); // RX, TX

void setup()  
{
  
  pinMode(RED_LED, OUTPUT);
  pinMode(P1_6, OUTPUT);
  digitalWrite(P1_6, HIGH);

 // How to enable external Crystal?
  
  // set the data rate for the SoftwareSerial port
  mySerial.begin(19200);
}

void loop() // run over and over
{
    //*******************
    //Serial Port
    //*******************
    
    while(mySerial.available())
    {
      .
      .
    }
    
    
    
    delay(10);
}

Viewing all articles
Browse latest Browse all 2077

Trending Articles