
pkowalski
-
Content Count
8 -
Joined
-
Last visited
Posts posted by pkowalski
-
-
Sorry to keep adding to this. After some debugging it appears that I am getting data one byte at a time. And if the data is sent faster than the receiver can receive it some kind of overflow happens.
Is it possible to send entire strings over serial or is it only possible to get one byte at a time?
Also, I still haven't figured out why I'm not getting data from the hardware UART. It would seem to me that if I use serial.write on the sending board I should be able to pull up the serial monitor on the receiver board and see the messages coming through without having to use
Serial.write(Serial.read());
Is this assumption on my part wrong?
Thanks.
-
After doing some more testing am I correct in assuming that the serial data is sent one byte at a time? Am I also correct in assuming that the buffer can only store 14 bytes?
I am basing this by looking at the mySerial.available() function. When my wires are connected the value is always 14. As soon as I disconnect the RX/TX pins the value drops by 1 each loop until finally it gets to 0.
Thanks.
-
To add to my post above, if on the board that is receiving the serial commands I comment out the serial.write code so that no serial.write exists shouldn't I get the information in the serial console coming from the board that is sending the information? I have pin 1.1 and 1.2 crossed for both boards. However, when I do this and open up the console I get nothing.
I am attaching a picture of my setup to make sure I have the wires connected correctly:
http://i.imgur.com/TMNaEgg.jpg?1
Thanks!
-
Did you look at the SoftwareSerial example?
That should let you use hardware serial on the G2553 and 'bit bang' serial on other pins.
Thank you for your help with this, looks like it got me on the right path.
However, I am having an issue which I'm sure is due to me not understanding how serial communication works on these devices. I looked at the serial reference library on Energia as well as the more detailed one on Arduino and unfortunately I'm still lost.
It appears that when I try to send a string of characters the characters are sent (or possibly read) back one by one and only up to a certain point (like the buffer is getting full).
Here is what I am getting using serial monitor:
-
Edit: Never mind, I didn't select the right processor. Thanks, giving this example a try now.
-
A part of my post above got cut off after the quote tag, sorry about that.
I was saying I searched around but couldn't find anything in regards to this so my apologies if it was already covered. I also can't find where serial1 is defined.
This is my code from the example:
/* 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: Serial.begin(9600); Serial1.begin(9600); } void loop() { // read from port 1, send to port 0: if (Serial1.available()) { int inByte = Serial1.read(); Serial.write(inByte); } }
-
Hello,
I am just getting started with the MSP-EXP430G2 development board so that I can use it for a project. For this project I need to receive/send serial commands on one port and then send/receive them on another. I pulled up the MultiSerial example to get me a quick example and I get an error when trying to compile:
MultiSerial.ino: In function 'void setup()':MultiSerial.ino:22:3: error: 'Serial1' was not declared in this scopeMultiSerial.ino: In function 'void loop()':MultiSerial.ino:27:7: error: 'Serial1' was not declared in this scope
MultiSerial Example Not working
in Energia - MSP
Posted
I wanted to pass the state of the digital pins and a couple of the analog pins between a network of boards and act on the information (anywhere from 2 to maybe even 8 boards). Each board will have a unique address and be daisy chained sort of like RS-485. I intent to also add a checksum in case bits get lost.
After playing with this some more it seems that this works ok:
Receiver Board (Which will ultimately be the sender as well):
Send Board (which will also be receiver eventually):
The while loop allows me to get all the bytes out of the buffer in one cycle. I'm not sure if this is the best way of doing it.
I hope that with this I can combine the data from the while loop, parse it, and create a network of boards.
Any thoughts on this would be greatly appreciated.
Edit: I noticed I am limited to how long the string can be, about 15 bytes. I'm not sure if that's due to the datatype that println uses.