Jump to content
43oh

Serial1 VS Serial in cc3200 uart


Recommended Posts

This is in continuation with this post where I was working with two cc3200 

 

one for transmit 

second for receive 

 

so my Energia code as described in other posted was

/* Serial Transmit:*/

 

 

 

 
#define LED RED_LED
 
 
char ch;
void setup()
{
  
  Serial1.begin(9600);
  // put your setup code here, to run once:
  
}
 
void loop()
{
  Serial1.write('c');
  delay(1000);
  
  
  // put your main code here, to run repeatedly:
  
}
 

 

and for receive 

 

 

/*

  Multple serial test
 
  Receives from the main serial port, sends to the others. 
  Receives from serial port 1, sends to the main serial (Serial 0).
 
  The circuit: 
  * Any serial device attached to Serial port 1
  * Serial monitor open on Serial port 0:
 
  created 30 Dec. 2008
  by Tom Igoe
 
  This example code is in the public domain.
 
*/
 
 
void setup() {
  // initialize both serial ports:
  pinMode(GREEN_LED,INPUT);
  Serial.begin(115200);
  Serial1.begin(9600);
}
 
void loop() {
  // read from port 1, send to port 0:
  if (Serial1.available()) {
    int inByte = Serial1.read();
    if(inByte == '\r')
      Serial.write("carriage");
    Serial.write(inByte); 
  }
}

 

 

Please note: 

TX pin (P01) in transmit CC3200 is connected to RX pin (P02) of receiver CC3200 

PS: P01 == P1-10

P02 == P1-9

 

 

The above is working fine and could see character "c" printed in console :)

 

Now... when I change the Transmitter code as below where I have replaced "serial1" with "Serial" as shown below ... I'm NOT see any results - what is that I'm missing 

 

 

 

 
#define LED RED_LED
 
 
char ch;
void setup()
{
  
  Serial.begin(9600);
  // put your setup code here, to run once:
  
}
 
void loop()
{
  Serial.write('c');
  delay(1000);
  
  
  // put your main code here, to run repeatedly:
  
}
 

 

Please note - I've connected 

 

TX pin (P03) in transmit CC3200 is connected to RX pin (P02) of receiver CC3200 

PS:

P04 == P1- 3

P03 == P1-4

 

 

 

Thanks!

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