Jump to content
43oh

Stellaris as a tool


Recommended Posts

The best example of Stellaris as a tool is as a logic analyzer see here.. http://www.sodnpoo.com/posts.xml/variable_sample_rate_stellaris_logic_analyser.xml

 

Currently I am working with the ESP8266 modules and I wanted to see what was being transmitted and received over  the serial interface without cluttering my code with debug.

 

Stellaris is perfect.

 

 

/*
  Software serial multple serial test
 
 Receives from the hardware serial, sends to software serial.
 Receives from software serial, sends to hardware serial.
 
 The circuit:
 * RX is digital pin P1.4 (connect to TX of other device)
 * TX is digital pin P1.3 (connect to RX of other device)
 
 created back in the mists of time
 modified 25 May 2012
 by Tom Igoe
 based on Mikal Hart's example
 modified again 8 Feb 2013
 by Brian Baker for MSP430
 
 This example code is in the public domain.
 Modified as a piece of test equipment
 */
// #include <SoftwareSerial.h>

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

void setup()  
{
  // Open serial communications and wait for port to open:
// #define debugSerial Serial // Using USB serial
 #define debugSerial Serial5 // Using hardware serial via RS232 to TTL convertor
  debugSerial.begin(115200);
  debugSerial.println("Stellaris Serial MUX starting.....");

  // set the data rate for the monitored ports
  Serial1.begin(9600);
  Serial2.begin(9600);
  Serial3.begin(9600);

}

void loop() // run over and over
{
  while (Serial1.available()){
    debugSerial.write("\x1b[37;1m");
    debugSerial.write(Serial1.read());   
  }
 
  while (Serial2.available()){
    debugSerial.write("\x1b[34;1m");
    debugSerial.write(Serial2.read());
  }
    while (Serial3.available()){
    debugSerial.write("\x1b[33;1m");
    debugSerial.write(Serial3.read());
  }  
 
   while (debugSerial.available())  Serial1.write(debugSerial.read());
}
 

Link to post
Share on other sites

Join the conversation

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

Guest
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...