Serial Monitoring
Hardware products and special guidance are provided by us .So don't refuse to contact +91 7904189145
The standard serial port for the LaunchPad is the USB port, and Energia offers a "serial monitor" for watching what is happening. Initialising the serial port is easy - just add Serial. begin() to your setup routine, and give a baud speed (9600 seems fairly standard, and for Energia the fastest is 115200
Materials required:
- Energia software-version 1.8.7E21-windows
- cc3200 launch pad
- Jumper wire
Software description:
After installing the Energia software if you open you can able to see a empty window open files >> New
Let’s see some basic functions related to serial communication that are frequently used in Energia IDE.
UART
a) Serial.begin(baud_rate)
baud_rate The baud rate that will be used for serial communication. Can be 4800, 9600, 14400, 19200, etc.
This function is used to define the baud rate that will be used for serial communication. For communicating with specific devices, the device baud rate needs to be used.
Example Serial. begin(9600) defines 9600 baud rate for communication.
c) Serial.print(value)
value: character, string, number to be printed.
This function is used to print data to a serial port in a form that is human readable (character, strings, numbers).
Example Serial.print(“Hi 1234”)
Prints Hi 1234 on the serial monitor.
d) Serial.println(value)
value: character, string, number to be printed.
This function is used to print data to a serial port in a form that is human readable (character, strings, numbers) followed by a carriage return (\r) and a new line character (\n).
e) Serial.read()
This function returns a character that was received on the Rx pin of Launchpad.
Example char read_byte
read_byte = Serial.read()
Byte of data read is stored in read_byte.
f) Serial.write(value), Serial.write(string), Serial.write(buff, length)
value: value to be sent as a single byte.
string: string to be sent as a series of bytes.
buff: an array of data to be sent as bytes.
length: several bytes to be sent.
This function writes data in binary form to the serial port. Data is sent in form of bytes or a series of bytes.
Example Serial.write(100)
Serial.write(“Hello”)
Program description:
To enable serial moniter we need to declare the command in the void Setup() as"Serial.begin(baudrate)" inside the prenthesis baud rate of the launch pad cc3200 launch pad . For example : For cc3200 launch pad we need to declare "Serial.begin(115200)" here 115200 is the baud rate of cc3200 launch pad.Hence for each launch pad the baud rate varies we need to be careful while declaring the serial.begin after the declaration serial monitor will be enabled.
In void loop() in order to print the information we need to declare Serial.print("") in order to print information in new line use Serial,println("") command .For example: To print the information 'R2C TECHNOLOGIES' declare as Serial.print("R2C TECHNOLOGIES") and for printing the information in new line declare as Serial.println("R2C TECHNOLOGIES").
Hardware description:
Before uploading this program to the launch pad make sure that the pin 2of SOP is connected to TCK pin 7.