├── LICENSE ├── README.md ├── _1_Python3_Codes ├── SerTest.py ├── _1_PySerial_Simple_Transmit.py ├── _2_PySerial_Transmit_2.py ├── _3_PySerial_Transmit_Echo.py ├── _4_PySerial_Exceptions.py ├── _5_PySerial-Receive_String.py ├── _6_PySerial_RTS_DTR_Control.py └── _7_PySerial_RTS_Blinky.py ├── _2_Arduino_Uno_Codes ├── _1_Serial_Reception_LED │ └── _1_Serial_Reception_LED.ino ├── _2_Serial_Echo_Back │ └── _2_Serial_Echo_Back.ino └── _3_Serial_Transmit_String │ └── _3_Serial_Transmit_String.ino ├── _3_MSP430G2553_Codes ├── Reciever (MSP430 Side) │ ├── Code │ │ └── MSP430_uart_receive.c │ ├── Debug │ │ ├── Exe │ │ │ └── MSP430_UART_Receive.d43 │ │ └── Obj │ │ │ ├── MSP430_UART_Receive.pbd │ │ │ └── MSP430_uart_receive.r43 │ ├── MSP430_UART_Receive.dep │ ├── MSP430_UART_Receive.ewd │ ├── MSP430_UART_Receive.ewp │ ├── MSP430_UART_Receive.eww │ ├── path.txt │ └── settings │ │ ├── MSP430_UART_Receive.cspy.bat │ │ ├── MSP430_UART_Receive.dbgdt │ │ ├── MSP430_UART_Receive.dni │ │ └── MSP430_UART_Receive.wsdt └── Transmitter (MSP430 Side) │ ├── Code │ ├── MSP430_UART_Transmit.c │ └── MSP430_UART_TransmitString.c │ ├── Debug │ ├── Exe │ │ └── MSP430_UART_Transmit.d43 │ └── Obj │ │ ├── MSP430_UART_Transmit.pbd │ │ └── MSP430_UART_TransmitString.r43 │ ├── MSP430_UART_Transmit.dep │ ├── MSP430_UART_Transmit.ewd │ ├── MSP430_UART_Transmit.ewp │ ├── MSP430_UART_Transmit.eww │ ├── path.txt │ └── settings │ ├── MSP430_UART_Transmit.cspy.bat │ ├── MSP430_UART_Transmit.dbgdt │ ├── MSP430_UART_Transmit.dni │ └── MSP430_UART_Transmit.wsdt └── _4_ATmega328P_Embedded_C_Codes ├── ATmega328-328P_Datasheet_Full.pdf ├── ATmega328p_Fuse_Bits_Programming_Ext_Crystal.txt ├── _1_Serial_Transmit ├── Makefile └── main.c └── _2_Serial_Receive ├── Makefile └── main.c /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 xanthium enterprises 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cross Platform Serial programming using Python and PySerial 2 | 3 | 4 | ![Python serial programmming using pyserial tutorial](https://www.xanthium.in/sites/default/files/site-images/serial-prog-python/serial-port-programming-python-pyserial.jpg) 5 | ----------------------------------------------------------------------------------------------------------------------------------------- 6 | 7 | A short introduction into serial port programming using Python and PySerial Library on **Windows** and **Linux** Systems. 8 | 9 | - Python 3.8.x language 10 | - Pyserial 3.4 Library 11 | 12 | The Python code running on the **x86/x64** PC communicates with an microcontroller through serial link (TX,RX and Ground). 13 | 14 | - Runs on Both Linux and Windows 15 | - supports only Python 3.x.x Versions 16 | - Added Arduino codes 17 | - Microcontroller used is MSP430G2553 on Launchpad 18 | - MSP430 Codes written in C and Compiled using IAR Embedded WorkBench 19 | - ATmega328P Codes written in Embedded C (WinAVR) 20 | 21 | --------------------------------------------------------------------------------------------------------------------------------------- 22 | ## Youtube Tutorials 23 | 24 | ![](https://www.xanthium.in/sites/all/modules/socialmedia/icons/levelten/glossy/32x32/youtube.png) 25 | 26 | - [Serial Port Communication between PC and Arduino using Python and PySerial Module for Beginners Pt-1](https://www.youtube.com/watch?v=tbrOlIoyRh4) 27 | - [Serial Port Communication between **Linux (ubuntu)** and Arduino using Python and PySerial Module Pt-2](https://www.youtube.com/watch?v=aV14zGqkLN0) 28 | - [Learn to Handle PySerial Exceptions in Python Serial Communication with Arduino](https://www.youtube.com/watch?v=RB-t55DTSoE) 29 | 30 | --------------------------------------------------------------------------------------------------------------------------------------- 31 | ## Pyserial on Linux 32 | 33 | ![Python serial programmming using pyserial on linux tutorial](https://www.xanthium.in/sites/default/files/site-images/serial-prog-python/python-serial-programming-tutorial-banner.jpg) 34 | 35 | - Linux Specific parts of using Pyserial and avoiding access to serial port denied can be found below 36 | - [Python Serial Communication using PySerial on **Linux platform** {*Linux specific parts*}](https://www.xanthium.in/linux-serial-port-programming-using-python-pyserial-and-arduino-avr-pic-microcontroller) 37 | - Codes tested on **Ubuntu 20.04 LTS** and **Rocky Linux 8 (Centos/RHEL Family)** 38 | - Change permissions using **chmod** command before running on Linux. 39 | - Run the codes like *[user@loclahost]$ python3 _Number_PythonCode_repo.py* 40 | - If you are experiencing **permission to /dev/ttyUSB0 denied errors** check the above tutorial 41 | --------------------------------------------------------------------------------------------------------------------------------------- 42 | 43 | ## Codes in Repo 44 | 45 | - **_1_Python3_Codes** 46 | - **_2_Arduino_Uno_Codes** 47 | - **_3_MSP430G2553_Codes** 48 | - **_4_ATmega328P_Embedded_C_Codes** 49 | 50 | -------------------------------------------------------------------------------------------------------------------------------------- 51 | 52 | ## Online Tutorial 53 | 54 | - [Python Serial Communication program for embedded development using PySerial library](https://www.xanthium.in/Cross-Platform-serial-communication-using-Python-and-PySerial) 55 | - [Python Serial Communication using PySerial on **Linux platform** {*Linux specific parts*}](https://www.xanthium.in/linux-serial-port-programming-using-python-pyserial-and-arduino-avr-pic-microcontroller) 56 | 57 | --------------------------------------------------------------------------------------------------------------------------------------- 58 | 59 | ## Circuit 60 | 61 | - Available in the original Tutorial 62 | 63 | ------------------------------------------------------------------------------------------------------------------------------------- 64 | 65 | ## Hardware used 66 | 67 | 68 | - [USB to Serial/RS485 Converter](https://www.xanthium.in/USB-to-Serial-RS232-RS485-Converter) 69 | 70 | - 71 | 72 | -------------------------------------------------------------------------------- /_1_Python3_Codes/SerTest.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3 2 | 3 | # Simple script o open a serial port on Linux and display status 4 | # www.xanthium.in 5 | # Rahul.S 6 | 7 | # Make script executable using chmod +x command 8 | 9 | import serial 10 | 11 | SerialPortName = input('\nEnter Port Name ->') # Enter Portname ttyUSBx /ttyACMx 12 | SerialPortName = '/dev/' + SerialPortName # create Full name by adding /dev/ 13 | 14 | SerialPortObj = serial.Serial(SerialPortName) # open the port with default settings 15 | 16 | print ('\nStatus -> ',SerialPortObj) #display the status of the port 17 | 18 | SerialPortObj.close() #close the port 19 | 20 | print (f'\nSerial Port {SerialPortName} closed\n') -------------------------------------------------------------------------------- /_1_Python3_Codes/_1_PySerial_Simple_Transmit.py: -------------------------------------------------------------------------------- 1 | # Python code transmits a byte 'A' to Arduino /Microcontroller to Blink LED 2 | # Requires PySerial 3 | 4 | # (c) www.xanthium.in 2022 5 | # Rahul.S 6 | 7 | # https://www.xanthium.in/Cross-Platform-serial-communication-using-Python-and-PySerial 8 | 9 | 10 | import serial 11 | import time 12 | 13 | SerialObj = serial.Serial('COM4') # COMxx format on Windows 14 | 15 | 16 | #/dev/ttyUSBx format on Linux 17 | # 18 | #Eg /dev/ttyUSB0 19 | #SerialObj = serial.Serial('/dev/ttyUSB0') 20 | 21 | SerialObj.baudrate = 9600 # set Baud rate to 9600 22 | SerialObj.bytesize = 8 # Number of data bits = 8 23 | SerialObj.parity ='N' # No parity 24 | SerialObj.stopbits = 1 # Number of Stop bits = 1 25 | 26 | #Another way to configure the Ports 27 | #SerialObj.bytesize = serial.EIGHTBITS # Number of data bits = 8 28 | #SerialObj.bytesize = serial.SEVENBITS # Number of data bits = 7 29 | 30 | #SerialObj.parity = serial.PARITY_NONE # No parity 31 | #SerialObj.parity = serial.PARITY_EVEN # Parity Even 32 | 33 | #SerialObj.stopbits = serial.STOPBITS_ONE # Number of Stop bits = 1 34 | 35 | 36 | time.sleep(3) # Only needed for Arduino,For AVR/PIC/MSP430 & other Micros not needed 37 | # opening the serial port from Python will reset the Arduino. 38 | # Both Arduino and Python code are sharing Com11 here. 39 | # 3 second delay allows the Arduino to settle down. 40 | 41 | BytesWritten = SerialObj.write(b'A') # transmit 'A' (8bit) to micro/Arduino 42 | # Declare A as a Byte (b'A') 43 | 44 | print('BytesWritten = ', BytesWritten) 45 | 46 | SerialObj.close() # Close the port 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /_1_Python3_Codes/_2_PySerial_Transmit_2.py: -------------------------------------------------------------------------------- 1 | # Python code transmits a byte to Arduino /Microcontroller 2 | 3 | 4 | import serial 5 | import time 6 | 7 | COMPort_Name = input("Enter COM Port number -") 8 | 9 | SerialObj = serial.Serial(COMPort_Name) 10 | 11 | # COMxx format on Windows 12 | #/dev/ttyUSBx format on Linux 13 | # 14 | #Eg /dev/ttyUSB0 15 | #SerialObj = serial.Serial('/dev/ttyUSB0') 16 | #SerialObj = serial.Serial('COM11',9600) 17 | 18 | print(SerialObj) #display default parameters 19 | 20 | time.sleep(3) # Only needed for Arduino,For AVR/PIC/MSP430 & other Micros not needed 21 | # opening the serial port from Python will reset the Arduino. 22 | # Both Arduino and Python code are sharing Com11 here. 23 | # 3 second delay allows the Arduino to settle down. 24 | 25 | SerialObj.baudrate = 9600 # set Baud rate to 9600 26 | SerialObj.bytesize = 8 # Number of data bits = 8 27 | SerialObj.parity ='N' # No parity 28 | SerialObj.stopbits = 1 # Number of Stop bits = 1 29 | 30 | print(SerialObj) 31 | 32 | BytesWritten = SerialObj.write(b'A') 33 | 34 | #Convert String to Byte format 35 | text = 'H' 36 | text = bytearray(text,'utf8') 37 | 38 | SerialObj.write(text) 39 | 40 | SerialObj.close() 41 | 42 | -------------------------------------------------------------------------------- /_1_Python3_Codes/_3_PySerial_Transmit_Echo.py: -------------------------------------------------------------------------------- 1 | # Python code transmits a byte to Arduino /Microcontroller 2 | # Arduino sends back received byte. 3 | # Requires PySerial 4 | 5 | # (c) www.xanthium.in 2021 6 | # Rahul.S 7 | 8 | 9 | 10 | import serial 11 | import time 12 | 13 | SerialObj = serial.Serial('COM11') # COMxx format on Windows 14 | #/dev/ttyUSBx format on Linux 15 | # 16 | #Eg /dev/ttyUSB0 17 | #SerialObj = serial.Serial('/dev/ttyUSB0') 18 | 19 | 20 | #SerialObj = serial.Serial('COM11',9600) 21 | 22 | #print(SerialObj) #display default parameters 23 | 24 | SerialObj.baudrate = 9600 # set Baud rate to 9600 25 | SerialObj.bytesize = 8 # Number of data bits = 8 26 | SerialObj.parity ='N' # No parity 27 | SerialObj.stopbits = 1 # Number of Stop bits = 1 28 | 29 | time.sleep(3) # Only needed for Arduino,For AVR/PIC/MSP430 & other Micros not needed 30 | # opening the serial port from Python will reset the Arduino. 31 | # Both Arduino and Python code are sharing Com11 here. 32 | # 3 second delay allows the Arduino to settle down. 33 | 34 | BytesWritten = SerialObj.write(b'A') #transmit 'A' (8bit) to micro/Arduino 35 | EchoedVar = SerialObj.read() # wait for Arduino to echo received byte 36 | 37 | print (EchoedVar ) 38 | 39 | 40 | SerialObj.close() 41 | -------------------------------------------------------------------------------- /_1_Python3_Codes/_4_PySerial_Exceptions.py: -------------------------------------------------------------------------------- 1 | # Serial Port exceptions 2 | # (c) www.xanthium.in 3 | 4 | import serial 5 | 6 | try: 7 | SerialObj = serial.Serial('COM4',9600) # open the Serial Port 8 | # /dev/ttyUSBx format on Linux 9 | # 10 | # Eg /dev/ttyUSB0 11 | # SerialObj = serial.Serial('/dev/ttyUSB0') 12 | print('Port Details ->',SerialObj) # display the properties of Serial Port 13 | SerialObj.close() 14 | 15 | except serial.SerialException as var : 16 | print('An Exception Occured') 17 | print('Exception Details-> ', var) 18 | 19 | else: 20 | print('Serial Port Opened') 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /_1_Python3_Codes/_5_PySerial-Receive_String.py: -------------------------------------------------------------------------------- 1 | # Receives a string from Arduino using readline() 2 | # Requires PySerial 3 | 4 | # (c) www.xanthium.in 2021 5 | # Rahul.S 6 | 7 | import serial 8 | import time 9 | 10 | SerialObj = serial.Serial('COM11',9600) # COMxx format on Windows 11 | # /dev/ttyUSBx format on Linux 12 | # 13 | # Eg /dev/ttyUSB0 14 | # SerialObj = serial.Serial('/dev/ttyUSB0') 15 | 16 | time.sleep(3) # Only needed for Arduino,For AVR/PIC/MSP430 & other Micros not needed 17 | # opening the serial port from Python will reset the Arduino. 18 | # Both Arduino and Python code are sharing Com11 here. 19 | # 3 second delay allows the Arduino to settle down. 20 | 21 | 22 | SerialObj.timeout = 3 # set the Read Timeout 23 | ReceivedString = SerialObj.readline() #readline reads a string terminated by \n 24 | 25 | print(ReceivedString) 26 | 27 | SerialObj.close() # Close the port -------------------------------------------------------------------------------- /_1_Python3_Codes/_6_PySerial_RTS_DTR_Control.py: -------------------------------------------------------------------------------- 1 | # RTS DTR Control using Python and PySerial 2 | # Requires PySerial 3 | 4 | # (c) www.xanthium.in 2021 5 | # Rahul.S 6 | 7 | import serial 8 | import time 9 | 10 | HIGH = 1 11 | LOW = 0 12 | 13 | SerialObj = serial.Serial('COM6',9600) # COMxx format on Windows 14 | # /dev/ttyUSBx format on Linux 15 | # 16 | # Eg /dev/ttyUSB0 17 | # SerialObj = serial.Serial('/dev/ttyUSB0') 18 | 19 | SerialObj.rts = HIGH #Make RTS High 20 | time.sleep(1) 21 | 22 | SerialObj.rts = LOW #Make RTS LOW 23 | time.sleep(1) 24 | 25 | SerialObj.dtr = HIGH 26 | time.sleep(1) 27 | 28 | SerialObj.dtr = LOW 29 | time.sleep(1) 30 | 31 | SerialObj.close() -------------------------------------------------------------------------------- /_1_Python3_Codes/_7_PySerial_RTS_Blinky.py: -------------------------------------------------------------------------------- 1 | # RTS Blinking 2 | # Requires PySerial 3 | 4 | # (c) www.xanthium.in 2021 5 | # Rahul.S 6 | 7 | import serial 8 | import time 9 | 10 | HIGH = 1 11 | LOW = 0 12 | 13 | SerialObj = serial.Serial('COM6',9600) # COMxx format on Windows 14 | #/dev/ttyUSBx format on Linux 15 | # 16 | #Eg /dev/ttyUSB0 17 | #SerialObj = serial.Serial('/dev/ttyUSB0') 18 | 19 | while 1 : 20 | SerialObj.rts = HIGH #Make RTS High 21 | time.sleep(1) 22 | SerialObj.rts = LOW #Make RTS LOW 23 | time.sleep(1) 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /_2_Arduino_Uno_Codes/_1_Serial_Reception_LED/_1_Serial_Reception_LED.ino: -------------------------------------------------------------------------------- 1 | // Arduino Uno 2 | // Receives A ,Switches on LED on Pin13 for 2 seconds 3 | // Rahul.S 4 | 5 | // (c) www.xanthium.in 2021 6 | // Tutorial - https://www.xanthium.in/Cross-Platform-serial-communication-using-Python-and-PySerial 7 | 8 | 9 | void setup() 10 | { 11 | //An LED is Connected Pin12 12 | pinMode(12,OUTPUT); //Make Pin12 Output 13 | digitalWrite(12,LOW);//Make Pin12 OFF 14 | 15 | Serial.begin(9600); // opens serial port, sets data rate to 9600 bps 8N1 16 | 17 | } 18 | 19 | void loop() 20 | { 21 | char RxedByte = 0; 22 | 23 | if (Serial.available()) 24 | { 25 | 26 | RxedByte = Serial.read(); 27 | 28 | switch(RxedByte) 29 | { 30 | case 'A': digitalWrite(12,HIGH); 31 | delay(1000); 32 | digitalWrite(12,LOW); 33 | break; 34 | 35 | case 'B': //your code 36 | break; 37 | default: 38 | break; 39 | }//end of switch() 40 | }//endof if 41 | } 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /_2_Arduino_Uno_Codes/_2_Serial_Echo_Back/_2_Serial_Echo_Back.ino: -------------------------------------------------------------------------------- 1 | // Arduino Uno 2 | // Echos back received data 3 | // Rahul.S 4 | 5 | // (c) www.xanthium.in 2021 6 | // Tutorial - https://www.xanthium.in/Cross-Platform-serial-communication-using-Python-and-PySerial 7 | 8 | 9 | void setup() 10 | { 11 | //An LED is Connected Pin12 12 | pinMode(12,OUTPUT); //Make Pin12 Output 13 | digitalWrite(12,LOW);//Make Pin12 OFF 14 | 15 | Serial.begin(9600); // opens serial port, sets data rate to 9600 bps 8N1 16 | 17 | } 18 | 19 | void loop() 20 | { 21 | char RxedByte = 0; 22 | 23 | if (Serial.available()) 24 | { 25 | RxedByte = Serial.read(); 26 | Serial.print(RxedByte); 27 | 28 | }//endof if 29 | } 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /_2_Arduino_Uno_Codes/_3_Serial_Transmit_String/_3_Serial_Transmit_String.ino: -------------------------------------------------------------------------------- 1 | // Arduino Uno 2 | // Transmits a string to PC 3 | // Rahul.S 4 | 5 | // (c) www.xanthium.in 2021 6 | // Tutorial - https://www.xanthium.in/Cross-Platform-serial-communication-using-Python-and-PySerial 7 | 8 | 9 | void setup() 10 | { 11 | Serial.begin(9600); // opens serial port, sets data rate to 9600 bps 8N1 12 | 13 | } 14 | 15 | void loop() 16 | { 17 | char TextToSend[] = " Hello From Arduino Uno"; 18 | Serial.println(TextToSend); // sends a \n with text 19 | delay(1000); 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/Code/MSP430_uart_receive.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------------------------------// 2 | // Serial Reception (Reciever side) // 3 | //----------------------------------------------------------------------------------------------------// 4 | // Program to recieve the data send from the PC through Serial link.MSP430G2553 is interfced with // 5 | // USB2Serial Converter through TTL lines(RXD,TXD,GND). // 6 | // MSP430 waits for a Character send from the PC and toggles the LED. // 7 | // PC sends Character 'A' or 'B'. // 8 | // MSP430 on Rxing A toggles LED connected to P1.0. // 9 | // MSP430 on Rxing B toggles LED connected to P1.1. // 10 | //----------------------------------------------------------------------------------------------------// 11 | 12 | //====================================================================================================// 13 | // www.xanthium.in // 14 | // Copyright (C) 2014 Rahul.S // 15 | //====================================================================================================// 16 | 17 | //----------------------------------------------------------------------------------------------------// 18 | // // 19 | // |------------| // 20 | // | USB2SERIAL | USB2SERIAL V2.0 +---------------+ // 21 | // | Write.exe | +--------------------+ | |(+) (-) // 22 | // |------------| | RX |<---------------- |P1.2(TXD) P1.0|---LED---+ // 23 | // \ [][][][][] \===========|(USB -> Serial) TX |----------------->|P1.1(RXD) | | // 24 | // \------------\ USB | GND |------------------|GND P1.1|---LED---+ // 25 | // Laptop +--------------------+ TTL link | | | // 26 | // +---------------+ GND // MSP430G2553 27 | // MSP430G2553 // 28 | // [Transmitter] ---------------------------------------------> [--------Reciever-----------] // 29 | // Data Transmission Direction // 30 | //====================================================================================================// 31 | // Hardware // 32 | // // 33 | // USB2SERIAL Converter // 34 | // MSP430G2553 on LaunchPad Development board // 35 | // Clocks :- DC0 @ 1MHz ,SMCLK @1MHz // 36 | // Baudrate :- 9600bps // 37 | //----------------------------------------------------------------------------------------------------// 38 | // Compiled on IAR Embedded Workbench for MSP430 version 5.30.1 // 39 | // 02-October-2014 // 40 | // Rahul.S // 41 | //----------------------------------------------------------------------------------------------------// 42 | 43 | 44 | #include "msp430g2553.h" 45 | void main(void) 46 | { 47 | WDTCTL = WDTPW + WDTHOLD; // Stop the Watch dog 48 | 49 | //------------------- Configure the Clocks -------------------// 50 | 51 | if (CALBC1_1MHZ==0xFF) // If calibration constant erased 52 | { 53 | while(1); // do not load, trap CPU!! 54 | } 55 | 56 | DCOCTL = 0; // Select lowest DCOx and MODx settings 57 | BCSCTL1 = CALBC1_1MHZ; // Set range 58 | DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation 59 | 60 | //------------------- Configure the Ports -------------------// 61 | 62 | // Setting the UART function for P1.1 & P1.2 63 | P1SEL |= BIT1 + BIT2; // P1.1 UCA0RXD input 64 | P1SEL2 |= BIT1 + BIT2; // P1.2 UCA0TXD output 65 | 66 | // Setting the direction for P1.0 and P1.6 67 | P1DIR |= BIT0 + BIT6 ; // P1.0,P1.6 output(leds) 68 | P1OUT &= ~BIT0 + BIT6; // Clear P1.0 69 | 70 | 71 | 72 | //-------------- Configure USCI_A0 in UART mode --------------// 73 | 74 | UCA0CTL1 |= UCSSEL_2 + UCSWRST; // USCI Clock = SMCLK,USCI_A0 disabled 75 | UCA0BR0 = 104; // 104 From datasheet table- 76 | UCA0BR1 = 0; // -selects baudrate =9600,clk = SMCLK 77 | UCA0MCTL = UCBRS_6; // Modulation value = 6 from datasheet 78 | 79 | UCA0CTL1 &= ~UCSWRST; // Clear UCSWRST to enable USCI_A0 80 | 81 | //-------------- Configure USCI_A0 interrupts --------------// 82 | 83 | IE2 |= UCA0RXIE; //Enable Recieve interrupt 84 | 85 | _BIS_SR(LPM0_bits + GIE); // Going to LPM0 86 | 87 | }//end of main() 88 | 89 | //----------------- USCI_A0 Recieve ISR --------------------------// 90 | 91 | #pragma vector = USCIAB0RX_VECTOR 92 | __interrupt void USCI_A0_RecieveInterrupt(void) 93 | { 94 | IFG2 &= ~UCA0RXIFG; //Clear the UCA0RXIFG 95 | // Switch to ontrol P1.0 and P1.6 96 | switch(UCA0RXBUF) 97 | { 98 | case 'A': P1OUT ^= BIT0; 99 | break; 100 | case 'B': P1OUT ^= BIT6; 101 | break; 102 | } 103 | 104 | } -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/Debug/Exe/MSP430_UART_Receive.d43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_3_MSP430G2553_Codes/Reciever (MSP430 Side)/Debug/Exe/MSP430_UART_Receive.d43 -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/Debug/Obj/MSP430_UART_Receive.pbd: -------------------------------------------------------------------------------- 1 | This is an internal working file generated by the Source Browser. 2 | 12:58 33s 3 | D:\USB2SERIAL V2.0 Codes\Serial\Serial Comm using PySerial\USB2SERIAL_Write\Reciever (MSP430 Side)\Debug\Obj\MSP430_uart_receive.pbi 4 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/Debug/Obj/MSP430_uart_receive.r43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_3_MSP430G2553_Codes/Reciever (MSP430 Side)/Debug/Obj/MSP430_uart_receive.r43 -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/MSP430_UART_Receive.dep: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 2088372105 6 | 7 | Debug 8 | 9 | $PROJ_DIR$\Code\MSP430_uart_receive.c 10 | $PROJ_DIR$\Debug\Exe\MSP430_UART_Receive.d43 11 | $PROJ_DIR$\Debug\Obj\MSP430_uart_receive.pbi 12 | $TOOLKIT_DIR$\inc\intrinsics.h 13 | $TOOLKIT_DIR$\inc\in430.h 14 | $PROJ_DIR$\Debug\Obj\MSP430_UART_Receive.pbd 15 | $PROJ_DIR$\Debug\Obj\MSP430_uart_receive.r43 16 | $TOOLKIT_DIR$\lib\dlib\dl430fn.r43 17 | $TOOLKIT_DIR$\config\lnk430G2553.xcl 18 | $TOOLKIT_DIR$\inc\msp430g2553.h 19 | 20 | 21 | $PROJ_DIR$\Code\MSP430_uart_receive.c 22 | 23 | 24 | BICOMP 25 | 2 26 | 27 | 28 | ICC430 29 | 6 30 | 31 | 32 | 33 | 34 | BICOMP 35 | 9 4 3 36 | 37 | 38 | ICC430 39 | 9 4 3 40 | 41 | 42 | 43 | 44 | $PROJ_DIR$\Debug\Exe\MSP430_UART_Receive.d43 45 | 46 | 47 | XLINK 48 | 8 6 7 49 | 50 | 51 | 52 | 53 | $PROJ_DIR$\Debug\Obj\MSP430_UART_Receive.pbd 54 | 55 | 56 | BILINK 57 | 2 58 | 59 | 60 | 61 | 62 | [ROOT_NODE] 63 | 64 | 65 | XLINK 66 | 1 67 | 68 | 69 | 70 | 71 | 72 | Release 73 | 74 | 75 | [MULTI_TOOL] 76 | XLINK 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/MSP430_UART_Receive.ewd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 6 | Debug 7 | 8 | MSP430 9 | 10 | 1 11 | 12 | C-SPY 13 | 4 14 | 15 | 25 16 | 1 17 | 1 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | 54 | 58 | 62 | 66 | 70 | 74 | 78 | 82 | 86 | 90 | 94 | 98 | 102 | 106 | 110 | 114 | 118 | 122 | 126 | 130 | 134 | 138 | 142 | 143 | 144 | 145 | 430FET 146 | 1 147 | 148 | 23 149 | 1 150 | 1 151 | 155 | 159 | 163 | 167 | 171 | 175 | 179 | 183 | 188 | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | 224 | 228 | 233 | 237 | 241 | 245 | 249 | 253 | 257 | 261 | 265 | 269 | 273 | 277 | 281 | 285 | 286 | 287 | 288 | SIM430 289 | 1 290 | 291 | 4 292 | 1 293 | 1 294 | 298 | 302 | 306 | 310 | 314 | 318 | 319 | 320 | 321 | 322 | $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin 323 | 1 324 | 325 | 326 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin 327 | 0 328 | 329 | 330 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin 331 | 0 332 | 333 | 334 | $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin 335 | 0 336 | 337 | 338 | $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin 339 | 0 340 | 341 | 342 | $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin 343 | 0 344 | 345 | 346 | $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin 347 | 0 348 | 349 | 350 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin 351 | 0 352 | 353 | 354 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin 355 | 0 356 | 357 | 358 | $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin 359 | 1 360 | 361 | 362 | $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin 363 | 0 364 | 365 | 366 | $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin 367 | 1 368 | 369 | 370 | 371 | 372 | Release 373 | 374 | MSP430 375 | 376 | 0 377 | 378 | C-SPY 379 | 4 380 | 381 | 25 382 | 1 383 | 0 384 | 388 | 392 | 396 | 400 | 404 | 408 | 412 | 416 | 420 | 424 | 428 | 432 | 436 | 440 | 444 | 448 | 452 | 456 | 460 | 464 | 468 | 472 | 476 | 480 | 484 | 488 | 492 | 496 | 500 | 504 | 508 | 509 | 510 | 511 | 430FET 512 | 1 513 | 514 | 23 515 | 1 516 | 0 517 | 521 | 525 | 529 | 533 | 537 | 541 | 545 | 549 | 554 | 558 | 562 | 566 | 570 | 574 | 578 | 582 | 586 | 590 | 594 | 599 | 603 | 607 | 611 | 615 | 619 | 623 | 627 | 631 | 635 | 639 | 643 | 647 | 651 | 652 | 653 | 654 | SIM430 655 | 1 656 | 657 | 4 658 | 1 659 | 0 660 | 664 | 668 | 672 | 676 | 680 | 684 | 685 | 686 | 687 | 688 | $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin 689 | 1 690 | 691 | 692 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin 693 | 0 694 | 695 | 696 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin 697 | 0 698 | 699 | 700 | $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin 701 | 0 702 | 703 | 704 | $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin 705 | 0 706 | 707 | 708 | $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin 709 | 0 710 | 711 | 712 | $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin 713 | 0 714 | 715 | 716 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin 717 | 0 718 | 719 | 720 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin 721 | 0 722 | 723 | 724 | $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin 725 | 1 726 | 727 | 728 | $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin 729 | 0 730 | 731 | 732 | $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin 733 | 1 734 | 735 | 736 | 737 | 738 | 739 | 740 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/MSP430_UART_Receive.ewp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 6 | Debug 7 | 8 | MSP430 9 | 10 | 1 11 | 12 | General 13 | 8 14 | 15 | 27 16 | 1 17 | 1 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | 54 | 59 | 63 | 67 | 71 | 76 | 80 | 85 | 89 | 94 | 98 | 102 | 106 | 110 | 114 | 118 | 122 | 126 | 131 | 135 | 139 | 143 | 148 | 152 | 153 | 154 | 155 | ICC430 156 | 4 157 | 158 | 32 159 | 1 160 | 1 161 | 165 | 169 | 173 | 177 | 181 | 185 | 189 | 193 | 197 | 201 | 205 | 209 | 213 | 217 | 221 | 225 | 230 | 234 | 238 | 242 | 246 | 250 | 254 | 258 | 262 | 266 | 270 | 274 | 278 | 282 | 286 | 290 | 294 | 298 | 302 | 306 | 310 | 314 | 318 | 322 | 326 | 330 | 334 | 338 | 342 | 346 | 350 | 355 | 359 | 363 | 368 | 373 | 377 | 381 | 385 | 389 | 393 | 397 | 401 | 405 | 409 | 413 | 417 | 421 | 425 | 429 | 433 | 437 | 441 | 445 | 446 | 447 | 448 | A430 449 | 4 450 | 451 | 13 452 | 1 453 | 1 454 | 458 | 462 | 467 | 471 | 475 | 479 | 483 | 487 | 491 | 495 | 499 | 503 | 507 | 511 | 515 | 519 | 523 | 527 | 531 | 535 | 539 | 543 | 547 | 551 | 555 | 559 | 563 | 567 | 571 | 575 | 579 | 583 | 587 | 591 | 595 | 599 | 603 | 607 | 608 | 609 | 610 | CUSTOM 611 | 3 612 | 613 | 614 | 615 | 616 | 617 | 618 | BICOMP 619 | 0 620 | 621 | 622 | 623 | BUILDACTION 624 | 1 625 | 626 | 627 | 628 | 629 | 630 | 631 | XLINK 632 | 4 633 | 634 | 22 635 | 1 636 | 1 637 | 641 | 645 | 650 | 655 | 659 | 663 | 667 | 671 | 675 | 679 | 683 | 687 | 691 | 695 | 699 | 703 | 707 | 711 | 715 | 719 | 723 | 727 | 732 | 736 | 740 | 745 | 749 | 753 | 757 | 761 | 765 | 770 | 775 | 779 | 783 | 787 | 791 | 795 | 799 | 803 | 807 | 811 | 815 | 819 | 823 | 827 | 831 | 835 | 839 | 844 | 849 | 853 | 857 | 861 | 865 | 869 | 873 | 877 | 881 | 885 | 889 | 893 | 897 | 901 | 905 | 909 | 910 | 911 | 912 | XAR 913 | 4 914 | 915 | 0 916 | 1 917 | 1 918 | 922 | 926 | 930 | 931 | 932 | 933 | BILINK 934 | 0 935 | 936 | 937 | 938 | 939 | Release 940 | 941 | MSP430 942 | 943 | 0 944 | 945 | General 946 | 8 947 | 948 | 27 949 | 1 950 | 0 951 | 955 | 959 | 963 | 967 | 971 | 975 | 979 | 983 | 987 | 992 | 996 | 1000 | 1004 | 1009 | 1013 | 1018 | 1022 | 1027 | 1031 | 1035 | 1039 | 1043 | 1047 | 1051 | 1055 | 1059 | 1064 | 1068 | 1072 | 1076 | 1081 | 1085 | 1086 | 1087 | 1088 | ICC430 1089 | 4 1090 | 1091 | 32 1092 | 1 1093 | 0 1094 | 1098 | 1102 | 1106 | 1110 | 1114 | 1118 | 1122 | 1126 | 1130 | 1134 | 1138 | 1142 | 1146 | 1150 | 1154 | 1158 | 1163 | 1167 | 1171 | 1175 | 1179 | 1183 | 1187 | 1191 | 1195 | 1199 | 1203 | 1207 | 1211 | 1215 | 1219 | 1223 | 1227 | 1231 | 1235 | 1239 | 1243 | 1247 | 1251 | 1255 | 1259 | 1263 | 1267 | 1271 | 1275 | 1279 | 1283 | 1288 | 1292 | 1296 | 1301 | 1306 | 1310 | 1314 | 1318 | 1322 | 1326 | 1330 | 1334 | 1338 | 1342 | 1346 | 1350 | 1354 | 1358 | 1362 | 1366 | 1370 | 1374 | 1378 | 1379 | 1380 | 1381 | A430 1382 | 4 1383 | 1384 | 13 1385 | 1 1386 | 0 1387 | 1391 | 1395 | 1400 | 1404 | 1408 | 1412 | 1416 | 1420 | 1424 | 1428 | 1432 | 1436 | 1440 | 1444 | 1448 | 1452 | 1456 | 1460 | 1464 | 1468 | 1472 | 1476 | 1480 | 1484 | 1488 | 1492 | 1496 | 1500 | 1504 | 1508 | 1512 | 1516 | 1520 | 1524 | 1528 | 1532 | 1536 | 1540 | 1541 | 1542 | 1543 | CUSTOM 1544 | 3 1545 | 1546 | 1547 | 1548 | 1549 | 1550 | 1551 | BICOMP 1552 | 0 1553 | 1554 | 1555 | 1556 | BUILDACTION 1557 | 1 1558 | 1559 | 1560 | 1561 | 1562 | 1563 | 1564 | XLINK 1565 | 4 1566 | 1567 | 22 1568 | 1 1569 | 0 1570 | 1574 | 1578 | 1583 | 1588 | 1592 | 1596 | 1600 | 1604 | 1608 | 1612 | 1616 | 1620 | 1624 | 1628 | 1632 | 1636 | 1640 | 1644 | 1648 | 1652 | 1656 | 1660 | 1665 | 1669 | 1673 | 1678 | 1682 | 1686 | 1690 | 1694 | 1698 | 1703 | 1708 | 1712 | 1716 | 1720 | 1724 | 1728 | 1732 | 1736 | 1740 | 1744 | 1748 | 1752 | 1756 | 1760 | 1764 | 1768 | 1772 | 1777 | 1782 | 1786 | 1790 | 1794 | 1798 | 1802 | 1806 | 1810 | 1814 | 1818 | 1822 | 1826 | 1830 | 1834 | 1838 | 1842 | 1843 | 1844 | 1845 | XAR 1846 | 4 1847 | 1848 | 0 1849 | 1 1850 | 0 1851 | 1855 | 1859 | 1863 | 1864 | 1865 | 1866 | BILINK 1867 | 0 1868 | 1869 | 1870 | 1871 | 1872 | $PROJ_DIR$\Code\MSP430_uart_receive.c 1873 | 1874 | 1875 | 1876 | 1877 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/MSP430_UART_Receive.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\MSP430_UART_Receive.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/path.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_3_MSP430G2553_Codes/Reciever (MSP430 Side)/path.txt -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/settings/MSP430_UART_Receive.cspy.bat: -------------------------------------------------------------------------------- 1 | @REM This batch file has been generated by the IAR Embedded Workbench 2 | @REM C-SPY Debugger, as an aid to preparing a command line for running 3 | @REM the cspybat command line utility using the appropriate settings. 4 | @REM 5 | @REM You can launch cspybat by typing the name of this batch file followed 6 | @REM by the name of the debug file (usually an ELF/DWARF or UBROF file). 7 | @REM Note that this file is generated every time a new debug session 8 | @REM is initialized, so you may want to move or rename the file before 9 | @REM making changes. 10 | @REM 11 | 12 | 13 | "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\bin\430proc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\bin\430fet.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\bin\430bat.dll" --backend -B "-p" "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\config\MSP430G2553.ddf" "--iv_base" "0xFFE0" "-d" "fet" "--erase_main_and_info" "--derivative" "MSP430G2xx3" "--protocol" "automatic" "--eem" "EMEX_LOW" "--port" "Automatic" "--connection" "ti_usb" "--settlingtime=0" "--msp430_dll" "msp430.dll" "--vccDefault" "3.3" 14 | 15 | 16 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/settings/MSP430_UART_Receive.dbgdt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 201307 10 | 11 | 12 | 13 | 14 | 15 | 2098026165 16 | 17 | 18 | 19 | 20 | 21 | 22 | 124272727 23 | 24 | 25 | 26 | 27 | 28 | Disassembly_I0 29 | 30 | 31 | 32 | 50020 33 | 34 | 35 | 36 | 00 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | TabID-26835-1313 46 | Debug Log 47 | Debug-Log 48 | 49 | 50 | 51 | TabID-4292-1326 52 | Build 53 | Build 54 | 55 | 56 | 57 | 58 | 0 59 | 60 | 61 | TabID-4815-1316 62 | Workspace 63 | Workspace 64 | 65 | 66 | MSP430_UART_Receive 67 | 68 | 69 | 70 | 0 71 | 72 | 73 | TabID-26312-1323 74 | Disassembly 75 | Disassembly 76 | 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 84 | 85 | 86 | 0100000010000001 87 | 88 | 89 | 90 | 91 | 92 | 93 | iaridepm.enu1debuggergui.enu1430fet1-2-2395198-2-2200200146413291545146413578717-2-2395198-2-2200200146413291545146413578717-2-21981368-2-213702001002928291545146413291545 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/settings/MSP430_UART_Receive.dni: -------------------------------------------------------------------------------- 1 | [InterruptLog] 2 | LogEnabled=0 3 | SumEnabled=0 4 | GraphEnabled=0 5 | ShowTimeLog=1 6 | ShowTimeSum=1 7 | SumSortOrder=0 8 | [Stack] 9 | FillEnabled=0 10 | OverflowWarningsEnabled=1 11 | WarningThreshold=90 12 | SpWarningsEnabled=1 13 | WarnLogOnly=1 14 | UseTrigger=1 15 | TriggerName=main 16 | LimitSize=0 17 | ByteLimit=50 18 | [Breakpoints2] 19 | Count=0 20 | [Interrupts] 21 | Enabled=1 22 | [MemoryMap] 23 | Enabled=0 24 | Base=0 25 | UseAuto=0 26 | TypeViolation=1 27 | UnspecRange=1 28 | ActionState=1 29 | [Trace1] 30 | Enabled=0 31 | ShowSource=1 32 | [DebugChecksum] 33 | Checksum=260861632 34 | [State Storage] 35 | Control Register=0 36 | [Sequencer] 37 | Control Register=0 38 | NextState0=0 39 | NextState1=0 40 | [Action Register] 41 | Break=2 42 | State Storage=2 43 | [CallStack] 44 | ShowArgs=0 45 | [Disassembly] 46 | MixedMode=1 47 | [Breakpoints] 48 | Count=0 49 | [FET] 50 | Clock mode=38 51 | Extended Clock mode=-1 52 | Secure Password= 53 | Extended Clock Control Enable=1 54 | Advanced Extended Clock Control=0 55 | Emulation mode=0 56 | Free running=0 57 | Shutting Down=3 58 | [Memory Dump] 59 | Start address= 60 | Lenghth= 61 | Address info=0 62 | Format=0 63 | Dump registers=0 64 | PC=0 65 | SP=0 66 | SR=0 67 | all registers=0 68 | File name= 69 | [Log file] 70 | LoggingEnabled=_ 0 71 | LogFile=_ "" 72 | Category=_ 0 73 | [TermIOLog] 74 | LoggingEnabled=_ 0 75 | LogFile=_ "" 76 | [Aliases] 77 | A0=_ "D:\USB2SERIAL V2.0 Codes\USB2SERIALCode_Win32\USB2SERIAL_Write\Reciever (MSP430 Side)\Code\MSP430_uart_receive.c" "D:\USB2SERIAL V2.0 Codes\Serial\Serial Comm using PySerial\USB2SERIAL_Write\Reciever (MSP430 Side)\Code\MSP430_uart_receive.c" 78 | Count=1 79 | SuppressDialog=0 80 | [CallStackLog] 81 | Enabled=0 82 | [DriverProfiling] 83 | Enabled=0 84 | Mode=0 85 | Graph=0 86 | Symbiont=0 87 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Reciever (MSP430 Side)/settings/MSP430_UART_Receive.wsdt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MSP430_UART_Receive/Debug 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 280272727 16 | 17 | 18 | 19 | 20 | 21 | 22 | 2098026165 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | TabID-15208-712 32 | Workspace 33 | Workspace 34 | 35 | 36 | MSP430_UART_ReceiveMSP430_UART_Receive/main.c 37 | 38 | 39 | 40 | 0 41 | 42 | 43 | TabID-8475-1248 44 | Build 45 | Build 46 | 47 | 48 | 49 | 50 | 0 51 | 52 | 53 | 54 | 55 | 56 | TextEditor$WS_DIR$\Code\MSP430_uart_receive.c0364302430200100000010000001 57 | 58 | 59 | 60 | 61 | 62 | 63 | iaridepm.enu1debuggergui.enu1430fet1-2-2443354-2-2200200146413291545260615648688-2-21981368-2-213702001002928291545146413291545 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Code/MSP430_UART_Transmit.c: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------------------------------// 2 | // Serial Transmission (Transmitter side) // 3 | //----------------------------------------------------------------------------------------------------// 4 | // Program to send data from MSP430 to PC through serial link.MSP430 sends a character to PC which is // 5 | // read by the PC side software. // 6 | // MSP430 sends string "A" . // 7 | //----------------------------------------------------------------------------------------------------// 8 | 9 | //====================================================================================================// 10 | // www.xanthium.in // 11 | // Copyright (C) 2014 Rahul.S // 12 | //====================================================================================================// 13 | 14 | //----------------------------------------------------------------------------------------------------// 15 | // // 16 | // |------------| // 17 | // | USB2SERIAL | USB2SERIAL V2.0 +---------------+ // 18 | // | Read.exe | +--------------------+ | |(+) (-) // 19 | // |------------| | RX |<---------------- |P1.2(TXD) P1.0|---LED---+ // 20 | // \ [][][][][] \===========|(USB -> Serial) TX |----------------->|P1.1(RXD) | | // 21 | // \------------\ USB | GND |------------------|GND P1.1|---LED---+ // 22 | // Laptop +--------------------+ TTL link | | | // 23 | // +---------------+ GND // MSP430G2553 24 | // MSP430G2553 // 25 | // [Receiver] <--------------------------------------------- [--------Transmitter-----------] // 26 | // Data Transmission Direction // 27 | //====================================================================================================// 28 | // Hardware // 29 | // // 30 | // USB2SERIAL Converter // 31 | // MSP430G2553 on LaunchPad Development board // 32 | // Clocks :- DC0 @ 1MHz ,SMCLK @1MHz // 33 | // Baudrate :- 9600bps // 34 | //----------------------------------------------------------------------------------------------------// 35 | // Compiled on IAR Embedded Workbench for MSP430 version 5.30.1 // 36 | // 02-October-2014 // 37 | // Rahul.S // 38 | //----------------------------------------------------------------------------------------------------// 39 | 40 | 41 | 42 | #include "msp430g2553.h" 43 | void main(void) 44 | { 45 | WDTCTL = WDTPW + WDTHOLD; // Stop the Watch dog 46 | 47 | //------------------- Configure the Clocks -------------------// 48 | 49 | if (CALBC1_1MHZ==0xFF) // If calibration constant erased 50 | { 51 | while(1); // do not load, trap CPU!! 52 | } 53 | 54 | DCOCTL = 0; // Select lowest DCOx and MODx settings 55 | BCSCTL1 = CALBC1_1MHZ; // Set range 56 | DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation 57 | 58 | 59 | 60 | //------------------- Configure the Ports -------------------// 61 | 62 | // Setting the UART function for P1.1 & P1.2 63 | P1SEL |= BIT1 + BIT2; // P1.1 UCA0RXD input 64 | P1SEL2 |= BIT1 + BIT2; // P1.2 UCA0TXD output 65 | 66 | // Setting the direction for P1.0, P1.6, P2.0 and P2.1 67 | P1DIR |= BIT0 + BIT6 ; // P1.0,P1.6 output(leds) 68 | P2DIR |= BIT0 + BIT1; // P2.0 -> DE,P2.1 -> ~RE Output 69 | P1OUT &= ~BIT0 + BIT6; // Clear P1.0 70 | 71 | //Enabling MAX485 in Transmit mode 72 | P2OUT |= BIT0; //P2.0 -> DE (high) 73 | P2OUT |= BIT1; //P2.1 -> ~RE (high) RE is active Low 74 | 75 | 76 | 77 | //-------------- Configure USCI_A0 in UART mode --------------// 78 | 79 | UCA0CTL1 |= UCSSEL_2 + UCSWRST; // USCI Clock = SMCLK,USCI_A0 disabled 80 | UCA0BR0 = 109; // 104 From datasheet table- 81 | UCA0BR1 = 0; // -selects baudrate =9600,clk = SMCLK 82 | UCA0MCTL = UCBRS_2; // Modulation value = 6 from datasheet 83 | 84 | UCA0CTL1 &= ~UCSWRST; // Clear UCSWRST to enable USCI_A0 85 | 86 | UCA0TXBUF = 'A'; 87 | 88 | _BIS_SR(LPM0_bits + GIE); // Going to LPM0 89 | 90 | }//end of main() 91 | 92 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Code/MSP430_UART_TransmitString.c: -------------------------------------------------------------------------------- 1 | 2 | //----------------------------------------------------------------------------------------------------// 3 | // Serial Transmission (Transmitter side) // 4 | //----------------------------------------------------------------------------------------------------// 5 | // Program to send data from MSP430 to PC through serial link.MSP430 sends a string to PC which is // 6 | // read by the PC side software. // 7 | // MSP430 sends string "Hello" . // 8 | //----------------------------------------------------------------------------------------------------// 9 | 10 | //====================================================================================================// 11 | // www.xanthium.in // 12 | // Copyright (C) 2014 Rahul.S // 13 | //====================================================================================================// 14 | 15 | //----------------------------------------------------------------------------------------------------// 16 | // // 17 | // |------------| // 18 | // | USB2SERIAL | USB2SERIAL V2.0 +---------------+ // 19 | // | Read.exe | +--------------------+ | |(+) (-) // 20 | // |------------| | RX |<---------------- |P1.2(TXD) P1.0|---LED---+ // 21 | // \ [][][][][] \===========|(USB -> Serial) TX |----------------->|P1.1(RXD) | | // 22 | // \------------\ USB | GND |------------------|GND P1.1|---LED---+ // 23 | // Laptop +--------------------+ TTL link | | | // 24 | // +---------------+ GND // MSP430G2553 25 | // MSP430G2553 // 26 | // [Receiver] <--------------------------------------------- [--------Transmitter-----------] // 27 | // Data Transmission Direction // 28 | //====================================================================================================// 29 | // Hardware // 30 | // // 31 | // USB2SERIAL Converter // 32 | // MSP430G2553 on LaunchPad Development board // 33 | // Clocks :- DC0 @ 1MHz ,SMCLK @1MHz // 34 | // Baudrate :- 9600bps // 35 | //----------------------------------------------------------------------------------------------------// 36 | // Compiled on IAR Embedded Workbench for MSP430 version 5.30.1 // 37 | // 02-October-2014 // 38 | // Rahul.S // 39 | //----------------------------------------------------------------------------------------------------// 40 | 41 | 42 | 43 | #include "msp430g2553.h" 44 | void main(void) 45 | { 46 | WDTCTL = WDTPW + WDTHOLD; // Stop the Watch dog 47 | 48 | //------------------- Configure the Clocks -------------------// 49 | 50 | if (CALBC1_1MHZ==0xFF) // If calibration constant erased 51 | { 52 | while(1); // do not load, trap CPU!! 53 | } 54 | 55 | DCOCTL = 0; // Select lowest DCOx and MODx settings 56 | BCSCTL1 = CALBC1_1MHZ; // Set range 57 | DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation 58 | 59 | //char Text[] = {'H','e','l','l','o',' ','f','r','o','m',' ','M','S','P','4','3','0'}; 60 | char Text[50] = "Hello From MSP430 \n"; 61 | char Count = 0; 62 | //------------------- Configure the Ports -------------------// 63 | 64 | // Setting the UART function for P1.1 & P1.2 65 | P1SEL |= BIT1 + BIT2; // P1.1 UCA0RXD input 66 | P1SEL2 |= BIT1 + BIT2; // P1.2 UCA0TXD output 67 | 68 | // Setting the direction for P1.0, P1.6, 69 | P1DIR |= BIT0 + BIT6 ; // P1.0,P1.6 output(leds) 70 | P1OUT &= ~BIT0 + BIT6; // Clear P1.0 71 | 72 | //-------------- Configure USCI_A0 in UART mode --------------// 73 | 74 | UCA0CTL1 |= UCSSEL_2 + UCSWRST; // USCI Clock = SMCLK,USCI_A0 disabled 75 | UCA0BR0 = 109; // 104 From datasheet table- 76 | UCA0BR1 = 0; // -selects baudrate =9600,clk = SMCLK 77 | UCA0MCTL = UCBRS_2; // Modulation value = 6 from datasheet 78 | 79 | UCA0CTL1 &= ~UCSWRST; // Clear UCSWRST to enable USCI_A0 80 | 81 | while(Text[Count] != '\0') 82 | { 83 | while(!(UCA0TXIFG & IFG2)); 84 | UCA0TXBUF = Text[Count]; 85 | Count++; 86 | } 87 | 88 | _BIS_SR(LPM0_bits + GIE); // Going to LPM0 89 | 90 | }//end of main() 91 | 92 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Debug/Exe/MSP430_UART_Transmit.d43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Debug/Exe/MSP430_UART_Transmit.d43 -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Debug/Obj/MSP430_UART_Transmit.pbd: -------------------------------------------------------------------------------- 1 | This is an internal working file generated by the Source Browser. 2 | 15:43 05s 3 | D:\USB2SERIAL V2.0 Codes\Serial\Serial Comm using PySerial\USB2SERIAL_Read\Transmitter (MSP430 Side)\Debug\Obj\MSP430_UART_TransmitString.pbi 4 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Debug/Obj/MSP430_UART_TransmitString.r43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/Debug/Obj/MSP430_UART_TransmitString.r43 -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/MSP430_UART_Transmit.dep: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 2564055060 6 | 7 | Debug 8 | 9 | $PROJ_DIR$\Code\MSP430_UART_TransmitString.c 10 | $TOOLKIT_DIR$\config\lnk430G2553.xcl 11 | $PROJ_DIR$\Debug\Obj\MSP430_UART_Transmit.pbd 12 | $TOOLKIT_DIR$\inc\in430.h 13 | $PROJ_DIR$\Debug\Exe\MSP430_UART_Transmit.d43 14 | $TOOLKIT_DIR$\inc\msp430g2553.h 15 | $TOOLKIT_DIR$\lib\dlib\dl430fn.r43 16 | $TOOLKIT_DIR$\inc\intrinsics.h 17 | $PROJ_DIR$\Debug\Obj\MSP430_UART_TransmitString.pbi 18 | $PROJ_DIR$\Debug\Obj\MSP430_UART_TransmitString.r43 19 | 20 | 21 | $PROJ_DIR$\Code\MSP430_UART_TransmitString.c 22 | 23 | 24 | BICOMP 25 | 8 26 | 27 | 28 | ICC430 29 | 9 30 | 31 | 32 | 33 | 34 | BICOMP 35 | 5 3 7 36 | 37 | 38 | ICC430 39 | 5 3 7 40 | 41 | 42 | 43 | 44 | $PROJ_DIR$\Debug\Obj\MSP430_UART_Transmit.pbd 45 | 46 | 47 | BILINK 48 | 8 49 | 50 | 51 | 52 | 53 | $PROJ_DIR$\Debug\Exe\MSP430_UART_Transmit.d43 54 | 55 | 56 | XLINK 57 | 1 9 6 58 | 59 | 60 | 61 | 62 | [ROOT_NODE] 63 | 64 | 65 | XLINK 66 | 4 67 | 68 | 69 | 70 | 71 | 72 | Release 73 | 74 | 75 | [MULTI_TOOL] 76 | XLINK 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/MSP430_UART_Transmit.ewd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 2 5 | 6 | Debug 7 | 8 | MSP430 9 | 10 | 1 11 | 12 | C-SPY 13 | 4 14 | 15 | 25 16 | 1 17 | 1 18 | 22 | 26 | 30 | 34 | 38 | 42 | 46 | 50 | 54 | 58 | 62 | 66 | 70 | 74 | 78 | 82 | 86 | 90 | 94 | 98 | 102 | 106 | 110 | 114 | 118 | 122 | 126 | 130 | 134 | 138 | 142 | 143 | 144 | 145 | 430FET 146 | 1 147 | 148 | 23 149 | 1 150 | 1 151 | 155 | 159 | 163 | 167 | 171 | 175 | 179 | 183 | 188 | 192 | 196 | 200 | 204 | 208 | 212 | 216 | 220 | 224 | 228 | 233 | 237 | 241 | 245 | 249 | 253 | 257 | 261 | 265 | 269 | 273 | 277 | 281 | 285 | 286 | 287 | 288 | SIM430 289 | 1 290 | 291 | 4 292 | 1 293 | 1 294 | 298 | 302 | 306 | 310 | 314 | 318 | 319 | 320 | 321 | 322 | $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin 323 | 1 324 | 325 | 326 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin 327 | 0 328 | 329 | 330 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin 331 | 0 332 | 333 | 334 | $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin 335 | 0 336 | 337 | 338 | $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin 339 | 0 340 | 341 | 342 | $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin 343 | 0 344 | 345 | 346 | $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin 347 | 0 348 | 349 | 350 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin 351 | 0 352 | 353 | 354 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin 355 | 0 356 | 357 | 358 | $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin 359 | 1 360 | 361 | 362 | $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin 363 | 0 364 | 365 | 366 | $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin 367 | 1 368 | 369 | 370 | 371 | 372 | Release 373 | 374 | MSP430 375 | 376 | 0 377 | 378 | C-SPY 379 | 4 380 | 381 | 25 382 | 1 383 | 0 384 | 388 | 392 | 396 | 400 | 404 | 408 | 412 | 416 | 420 | 424 | 428 | 432 | 436 | 440 | 444 | 448 | 452 | 456 | 460 | 464 | 468 | 472 | 476 | 480 | 484 | 488 | 492 | 496 | 500 | 504 | 508 | 509 | 510 | 511 | 430FET 512 | 1 513 | 514 | 23 515 | 1 516 | 0 517 | 521 | 525 | 529 | 533 | 537 | 541 | 545 | 549 | 554 | 558 | 562 | 566 | 570 | 574 | 578 | 582 | 586 | 590 | 594 | 599 | 603 | 607 | 611 | 615 | 619 | 623 | 627 | 631 | 635 | 639 | 643 | 647 | 651 | 652 | 653 | 654 | SIM430 655 | 1 656 | 657 | 4 658 | 1 659 | 0 660 | 664 | 668 | 672 | 676 | 680 | 684 | 685 | 686 | 687 | 688 | $TOOLKIT_DIR$\plugins\Lcd\lcd.ewplugin 689 | 1 690 | 691 | 692 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin 693 | 0 694 | 695 | 696 | $TOOLKIT_DIR$\plugins\rtos\CMX\CmxTinyArmPlugin.ENU.ewplugin 697 | 0 698 | 699 | 700 | $TOOLKIT_DIR$\plugins\rtos\embOS\embOSPlugin.ewplugin 701 | 0 702 | 703 | 704 | $TOOLKIT_DIR$\plugins\rtos\OpenRTOS\OpenRTOSPlugin.ewplugin 705 | 0 706 | 707 | 708 | $TOOLKIT_DIR$\plugins\rtos\PowerPac\PowerPacRTOS.ewplugin 709 | 0 710 | 711 | 712 | $TOOLKIT_DIR$\plugins\rtos\SafeRTOS\SafeRTOSPlugin.ewplugin 713 | 0 714 | 715 | 716 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-286-KA-CSpy.ewplugin 717 | 0 718 | 719 | 720 | $TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin 721 | 0 722 | 723 | 724 | $EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin 725 | 1 726 | 727 | 728 | $EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin 729 | 0 730 | 731 | 732 | $EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin 733 | 1 734 | 735 | 736 | 737 | 738 | 739 | 740 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/MSP430_UART_Transmit.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\MSP430_UART_Transmit.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/path.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/path.txt -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/settings/MSP430_UART_Transmit.cspy.bat: -------------------------------------------------------------------------------- 1 | @REM This batch file has been generated by the IAR Embedded Workbench 2 | @REM C-SPY Debugger, as an aid to preparing a command line for running 3 | @REM the cspybat command line utility using the appropriate settings. 4 | @REM 5 | @REM You can launch cspybat by typing the name of this batch file followed 6 | @REM by the name of the debug file (usually an ELF/DWARF or UBROF file). 7 | @REM Note that this file is generated every time a new debug session 8 | @REM is initialized, so you may want to move or rename the file before 9 | @REM making changes. 10 | @REM 11 | 12 | 13 | "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\common\bin\cspybat" "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\bin\430proc.dll" "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\bin\430fet.dll" %1 --plugin "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\bin\430bat.dll" --backend -B "-p" "C:\Program Files\IAR Systems\Embedded Workbench 6.0 Kickstart\430\config\MSP430G2553.ddf" "--iv_base" "0xFFE0" "-d" "fet" "--erase_main_and_info" "--derivative" "MSP430G2xx3" "--protocol" "automatic" "--eem" "EMEX_LOW" "--port" "Automatic" "--connection" "ti_usb" "--settlingtime=0" "--msp430_dll" "msp430.dll" "--vccDefault" "3.3" 14 | 15 | 16 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/settings/MSP430_UART_Transmit.dbgdt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 201307 10 | 11 | 12 | 13 | 14 | 15 | 2098026165 16 | 17 | 18 | 19 | 20 | 21 | 22 | 124272727 23 | 24 | 25 | 26 | 27 | 28 | Disassembly_I0 29 | 30 | 31 | 32 | 50020 33 | 34 | 35 | 36 | 00 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | TabID-29972-6371 46 | Debug Log 47 | Debug-Log 48 | 49 | 50 | 51 | TabID-29450-6381 52 | Build 53 | Build 54 | 55 | 56 | 57 | 58 | 0 59 | 60 | 61 | TabID-7953-6375 62 | Workspace 63 | Workspace 64 | 65 | 66 | MSP430_UART_Transmit 67 | 68 | 69 | 70 | 0 71 | 72 | 73 | TabID-18701-6378 74 | Disassembly 75 | Disassembly 76 | 77 | 78 | 79 | 80 | 0 81 | 82 | 83 | 84 | 85 | 86 | 0100000010000001 87 | 88 | 89 | 90 | 91 | 92 | 93 | iaridepm.enu1debuggergui.enu1430fet1-2-2395198-2-2200200146413291545146413578717-2-2395198-2-2200200146413291545146413578717-2-21981368-2-213702001002928291545146413291545 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/settings/MSP430_UART_Transmit.dni: -------------------------------------------------------------------------------- 1 | [InterruptLog] 2 | LogEnabled=0 3 | SumEnabled=0 4 | GraphEnabled=0 5 | ShowTimeLog=1 6 | ShowTimeSum=1 7 | SumSortOrder=0 8 | [Stack] 9 | FillEnabled=0 10 | OverflowWarningsEnabled=1 11 | WarningThreshold=90 12 | SpWarningsEnabled=1 13 | WarnLogOnly=1 14 | UseTrigger=1 15 | TriggerName=main 16 | LimitSize=0 17 | ByteLimit=50 18 | [Breakpoints2] 19 | Count=0 20 | [Interrupts] 21 | Enabled=1 22 | [MemoryMap] 23 | Enabled=0 24 | Base=0 25 | UseAuto=0 26 | TypeViolation=1 27 | UnspecRange=1 28 | ActionState=1 29 | [Trace1] 30 | Enabled=0 31 | ShowSource=1 32 | [DebugChecksum] 33 | Checksum=603540375 34 | [State Storage] 35 | Control Register=0 36 | [Sequencer] 37 | Control Register=0 38 | NextState0=0 39 | NextState1=0 40 | [Action Register] 41 | Break=2 42 | State Storage=2 43 | [CallStack] 44 | ShowArgs=0 45 | [Disassembly] 46 | MixedMode=1 47 | [Breakpoints] 48 | Count=0 49 | [FET] 50 | Clock mode=38 51 | Extended Clock mode=-1 52 | Secure Password= 53 | Extended Clock Control Enable=1 54 | Advanced Extended Clock Control=0 55 | Emulation mode=0 56 | Free running=0 57 | Shutting Down=3 58 | [Memory Dump] 59 | Start address= 60 | Lenghth= 61 | Address info=0 62 | Format=0 63 | Dump registers=0 64 | PC=0 65 | SP=0 66 | SR=0 67 | all registers=0 68 | File name= 69 | [Log file] 70 | LoggingEnabled=_ 0 71 | LogFile=_ "" 72 | Category=_ 0 73 | [TermIOLog] 74 | LoggingEnabled=_ 0 75 | LogFile=_ "" 76 | [Aliases] 77 | A0=_ "D:\USB2SERIAL V2.0 Codes\USB2SERIALCode_LinuxAPI\USB2SERIAL_Read\Transmitter (MSP430 Side)\Code\MSP430_UART_TransmitString.c" "D:\USB2SERIAL V2.0 Codes\Serial\Serial Comm using PySerial\USB2SERIAL_Read\Transmitter (MSP430 Side)\Code\MSP430_UART_TransmitString.c" 78 | Count=1 79 | SuppressDialog=0 80 | [CallStackLog] 81 | Enabled=0 82 | [DriverProfiling] 83 | Enabled=0 84 | Mode=0 85 | Graph=0 86 | Symbiont=0 87 | -------------------------------------------------------------------------------- /_3_MSP430G2553_Codes/Transmitter (MSP430 Side)/settings/MSP430_UART_Transmit.wsdt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | MSP430_UART_Transmit/Debug 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 124272727 16 | 17 | 18 | 19 | 20 | 21 | 22 | 2098026165 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | TabID-25559-1541 32 | Workspace 33 | Workspace 34 | 35 | 36 | MSP430_UART_Transmit 37 | 38 | 39 | 40 | 0 41 | 42 | 43 | TabID-10567-6326 44 | Build 45 | Build 46 | 47 | 48 | 49 | 50 | 0 51 | 52 | 53 | 54 | 55 | 56 | TextEditor$WS_DIR$\Code\MSP430_UART_TransmitString.c0334000400000100000010000001 57 | 58 | 59 | 60 | 61 | 62 | 63 | iaridepm.enu1debuggergui.enu1430fet1-2-2395198-2-2200200146413291545146413578717-2-21981368-2-213702001002928291545146413291545 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /_4_ATmega328P_Embedded_C_Codes/ATmega328-328P_Datasheet_Full.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_4_ATmega328P_Embedded_C_Codes/ATmega328-328P_Datasheet_Full.pdf -------------------------------------------------------------------------------- /_4_ATmega328P_Embedded_C_Codes/ATmega328p_Fuse_Bits_Programming_Ext_Crystal.txt: -------------------------------------------------------------------------------- 1 | avrdude -c usbasp -p m328p -U lfuse:w:0xFF:m -------------------------------------------------------------------------------- /_4_ATmega328P_Embedded_C_Codes/_1_Serial_Transmit/Makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xanthium-enterprises/CrossPlatform-Serial-Port-Programming-using-Python-and-PySerial/0b2d64cf47f8fb61defa079103d3a0a675b31a31/_4_ATmega328P_Embedded_C_Codes/_1_Serial_Transmit/Makefile -------------------------------------------------------------------------------- /_4_ATmega328P_Embedded_C_Codes/_1_Serial_Transmit/main.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | // AVR Send Character string "Hello from ATmega328p" Continously to the PC using Serial port. 5 | // PC receives the data and displays on terminal. 6 | // External Oscillator = 11.0592MHz 7 | 8 | //+------------------------------------------------------------------------------------------------+ 9 | //| Compiler : AVR GCC (WinAVR) | 10 | //| Microcontroller : ATmega328p | 11 | //| Programmer : Rahul.Sreedharan | 12 | //| Date : 16-July-2019 | 13 | //+------------------------------------------------------------------------------------------------+ 14 | 15 | //(C) www.xanthium.in 16 | // Visit to Learn More 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | // +-----------------------------------------------------------------------+ // 23 | // | ATmega328p Baudrate values for UBRRn for external crystal 11.0592MHz | // 24 | // +-----------------------------------------------------------------------+ // 25 | 26 | #define BAUD_RATE_4800_BPS 143 // 4800bps 27 | #define BAUD_RATE_9600_BPS 71 // 9600bps 28 | 29 | #define BAUD_RATE_14400_BPS 47 // 14.4k bps 30 | #define BAUD_RATE_19200_BPS 35 // 19.2k bps 31 | #define BAUD_RATE_28800_BPS 23 // 28.8k bps 32 | #define BAUD_RATE_38400_BPS 17 // 38.4k bps 33 | #define BAUD_RATE_57600_BPS 11 // 57.6k bps 34 | #define BAUD_RATE_76800_BPS 8 // 76.8k bps 35 | 36 | #define BAUD_RATE_115200_BPS 5 // 115.2k bps 37 | #define BAUD_RATE_230400_BPS 2 // 230.4k bps 38 | 39 | // +-----------------------------------------------------------------------+ // 40 | 41 | 42 | 43 | int main() 44 | { 45 | int i = 0; 46 | unsigned int ubrr = BAUD_RATE_230400_BPS; 47 | 48 | unsigned char data[] = "Hello from ATmega328p "; 49 | 50 | /* Set Baudrate */ 51 | UBRR0H = (ubrr>>8); // Shift the 16bit value ubrr 8 times to the right and transfer the upper 8 bits to UBBR0H register. 52 | UBRR0L = (ubrr); // Copy the 16 bit value ubrr to the 8 bit UBBR0L register,Upper 8 bits are truncated while lower 8 bits are copied 53 | 54 | 55 | 56 | UCSR0C = 0x06; /* Set frame format: 8data, 1stop bit */ 57 | UCSR0B = (1< 20 | #include 21 | #include 22 | 23 | // +-----------------------------------------------------------------------+ // 24 | // | ATmega328p Baudrate values for UBRRn for external crystal 11.0592MHz | // 25 | // +-----------------------------------------------------------------------+ // 26 | 27 | #define BAUD_RATE_4800_BPS 143 // 4800bps 28 | #define BAUD_RATE_9600_BPS 71 // 9600bps 29 | 30 | #define BAUD_RATE_14400_BPS 47 // 14.4k bps 31 | #define BAUD_RATE_19200_BPS 35 // 19.2k bps 32 | #define BAUD_RATE_28800_BPS 23 // 28.8k bps 33 | #define BAUD_RATE_38400_BPS 17 // 38.4k bps 34 | #define BAUD_RATE_57600_BPS 11 // 57.6k bps 35 | #define BAUD_RATE_76800_BPS 8 // 76.8k bps 36 | 37 | #define BAUD_RATE_115200_BPS 5 // 115.2k bps 38 | #define BAUD_RATE_230400_BPS 2 // 230.4k bps 39 | 40 | // +-----------------------------------------------------------------------+ // 41 | 42 | 43 | int main() 44 | { 45 | 46 | unsigned int ubrr = BAUD_RATE_230400_BPS; 47 | 48 | PORTC = 0x00; //All LED's OFF 49 | PORTD = 0x00; 50 | 51 | /* Set Baudrate @ 230.4k bps */ 52 | UBRR0H = (ubrr>>8); 53 | UBRR0L = (ubrr); 54 | 55 | /*Enable receiver */ 56 | UCSR0B = (1<