Jump to content

Search the Community

Showing results for tags 'UART'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks


There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start



Website URL





Found 76 results

  1. I tried to change the settings used by UART for Serial or Serial1 on an MSP432 (stopbits, parity etc.). After hours of detective work I now guess the settings are applied by some code of the wiring framework in the emt432 framework. There is much code, but almost nothing of it is used, as most of wiring and the TI runtime seems to be precompiled to binary libraries like the wiring_msp432.m4fg.lib file. There are no Makefiles, nor any references how those binaries are built as far as I can see. So how to fiddle with anything below the Energia provided API? Do I now need external IDEs / Compilers / whatever to change something? I am not used to that stuff from the Arduino framework :-p
  2. Hi experts!! I'm a beginner and working on CC3200 LP along with Energia IDE. I'm working on a simple project where I've an external device which has RS485 o/p and I need to fetch the values in specified addr location in that device to CC3200 LP. My doubts are #1) we have external module that has device ID+parameter Address and we need to transmit the value in LP through UART, here I'm not sure how to use the UART function to specifically target device+address and return/get the same.... #2) what I'm looking/exploring is that in above example (UART code which Andy shared here ) what function specifically reads DeviceID+parameter Addr and returns that string value to my LP My experiments: I've been checking uart.h file and following lines looks close to what I need to do - but not sure... extern void UARTConfigSetExpClk(unsigned long ulBase, unsigned long ulUARTClk, unsigned long ulBaud, unsigned long ulConfig); extern void UARTConfigGetExpClk(unsigned long ulBase, unsigned long ulUARTClk, unsigned long *pulBaud, unsigned long *pulConfig); I'm planning to have my framework Energia sketch might be like calling below functions in specified order 1) UARTIntClear ==> to initialize/clear in LP 2) UARTIntEnable ==> enable UART of my LP 3) UARTConfigSetExpClk ==> to set what I need to read from the external device to my LP 4) UARTConfigGetExpClk ==> to GET what I need to read from the external device to my LP 5) perform step 1 to 4 after 5 sec ==> loop it Am I missing something in above flow?? My Setup I've installed Tera Term in my PC to monitor com port I've got Rs485 to RS232/TTL converter which can be connected to my cc3200 LP UART PIN_02, PIN_01 (RX_1 & TX_1) ... or nay other UART pin which is applicable. my external device which has RS485 o/p ==> Baud rate of 9600, Parity = Even, Device Address = 1, Stop bit = 1, Data type = 32 bit float real, Data to be red from address (Float) 3913, 3909, 3903, 3965, please advice
  3. I am using TM4C129 Launchpad launchpad and trying to connect XBee Series 2 (S2C) through UART. Looking into the pinout of TM4C129, I am connecting like below XBee TX <---> RX (UART0) XBee RX <---> TX (UART0) XBee 3.3V <---> pin#41 XBee GND <---> pin#62 I use below code on the LaunchPad at Energia void setup() { Serial.begin(9600); //pinMode(13, OUTPUT); } void loop() { Serial.println('H'); delay(1000); Serial.println('L'); delay(1000); } And the below python code runs on my Mac as a coordinator #!/usr/bin/python import serial ser = serial.Serial('/dev/tty.usbserial-A104IC2U', 9600) while True: incoming = ser.readline().strip() print '%s' % incoming But it doesn't work. FYI, this code worked on Arduino. Has anyone tried this before? Any suggestion? Am I missing some connection? jumper settings? Anything on the code?
  4. 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:*/ and for receive 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 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!
  5. I want to resend each character from one UART port to another. Hardware: Lauchpad TivaC EK-TM4C123GXL. First port is the default port that is connected to microUSB on the board. The second port is UART2 (Rx = PD6; Tx = PD7) connected to DB9 through MAX3232:. Power is VBUS - GND. DB9 is now connected to computer through RS232-USB adapter. I communicate with 1st serial port through serial monitor in Energia (ttyACM0). I communicate with 2nd serial port through serial terminal in Linux (ttyUSB0). Code is very simple: void setup() { // initialize ports: Serial.begin(9600); //connected with USB delay(100); Serial2.begin(9600); //RS232: Rx = PD6; Tx = PD7 delay(100); } void loop() { } void serialEvent() { while (Serial.available()) { // get the new byte: char inChar = (char)Serial.read(); //send it to RS232 Serial2.print(inChar); } while (Serial2.available()) { // get the new byte: char inChar = (char)Serial2.read(); //send it to UI Serial.print(inChar); } } I got the following: Then I send something from Energia serial monitor (serial) - this message is displayed in linux serial terminal (serial2) - this is all good. Another way (from Serial2 to Serial) it does not work - I send messages from linux terminal, but nothing changes in Energia serial monitor. What is wrong with my setup?
  6. Hy, I worked on a source half a year ago with an older Energia (I do not know exactly which one.). I was able to acces UartIntHandler and UartIntHandler2() functions directly. As I remember I do not change the content of Energia under OSX. Now I try to modify 1-2 things for example in the startup_gcc.c or hardwareserial.c, but the are not working. Can you help me how could I reach the UART interrupt handlers from Energia? (The setup of UART module worked on CCS or IAR before.) Can I use something like attachinterrupt()?
  7. I'm trying to understand the two possible configurations of the headers on the MSP430G2, rev 1.5, at the top near the border between the emulator and the uart. The silk screen seems to indicate that one configuration is appropriate for hardware uart, and the other configuration is appropriate for software uart. I'm wondering, why does it matter? Whether using a software uart or chip with a hardware uart on board, either way doesn't the TX pin of the MSP still need to go to the RX pin of the emulator (likewise for RX-TX) in order to get data back and forth from a PC? And when the direction is rotated, this seems even stranger since it looks like we're connecting TX-TX and RX-RX. So what's really going on here? Thanks
  8. Hi, I am trying to send data through UART from MSP430G2553 to sensorTag CC2650 and then through Bluetooth we are seeong value on BLESCANNER app we are using SPPBLE server program but we are not getting any data on the app .Can any one help me out as i am still stuck on it..
  9. hi my friends; i work on the msp430fg439 for my project and it has only one spi/uart channel and i used this channel for sd card operation. Now i want to apply uart operation to my code. how can i make a bit banging uart application? In my code, tx and rx pins are useable but timing pins were used. Thanks for your helping...
  10. j UART communication - Can't type anything in PuTTY.
  11. Hi, I wonder if it is possible to cause a interrupt when receiving serial data. This would have the big advantage to be able to wake up from sleep mode if new serial data is available. By now, serial data is written in the rx buffer even in sleep mode, but afaik it's not possible to notice that in Energia. I found lots of code for CCS for exactly this application, but i'm not able to port it for Energia. Does anybody already has some example code or may help me to make the CCS code working in Energia? Thanks!
  12. I've got an F5229LP app that sets SMCLK to XT2 with a divider of 4. (XT2 = 25Mhz crystal, which is also the source for MCLK) When I initialize the clocks, HardwareSerial no longer produces an accurate Baud Rate, and it breaks terminal communication. I see that HardwareSerial.cpp contains: #define SMCLK F_CPU //SMCLK = F_CPU for now I've tried changing it to F_CPU / 4 but the situation did not improve. Here is my recreation code: (Uncomment initClocks(25000000l); and change HardwareSerial.cpp to see it fail) #include <WString.h> void initClocks(uint32_t mclkFreq); void SerialTestText() { Serial.println("Back channel active."); char* selfTest = (char*) ("Performing Self Test."); while (*selfTest) Serial.print(*selfTest++); Serial.println(selfTest); } void setup() { // put your setup code here, to run once: // initClocks(25000000l); Serial.begin(115200); delay(10); //Turn on LED pinMode(RED_LED, OUTPUT); digitalWrite(RED_LED, true); Serial.println(' ');//Sacrificial character. (First character is often garbled.) SerialTestText(); } int _previous = 0; void loop() { // put your main code here, to run repeatedly: int _now = millis()/2000; digitalWrite(RED_LED, (int)(millis()/500) & 0x1); if (_previous != _now) SerialTestText(); _previous = _now; } void initClocks(uint32_t mclkFreq) { #ifdef __MSP430F5529__ //Enable XT2 P5SEL |= BIT3 + BIT2; UCSCTL6 &= ~XT2OFF; delay(100); //Give time for XT2 to settle // Assign the XT1 as the FLL reference clock UCSCTL3 &= ~0x7; UCSCTL3 |= 0x2;//FLL reference clock divider of 1 // Assign the XT2 as the MCLK reference clock UCSCTL4 &= ~0x7;//MCLK source bits UCSCTL4 |= 0x5;//Source = XT2 when available otherwise DCOCLKDIV UCSCTL5 &= ~0x7;//Clock divider of 1 (25Mhz) // Assign the XT2 as the SMCLK reference clock UCSCTL4 &= ~0x70; UCSCTL4 |= 0x50;//SMCLK UCSCTL5 &= ~0x70; UCSCTL5 |= 0x10; //Clock divider of 4 (6.25Mhz) // Assign the XT1 as the source for ACLK UCSCTL4 &= ~0x700; UCSCTL4 |= 0x100;//ACLK UCSCTL5 &= ~0x700; UCSCTL5 |= 0x100; //Clock divider of 16 (~4khz) #endif } How do I use HardwareSerial with a custom value of SMCLK?
  13. Hi there! I am not very much experienced in MSP430 platform. I am kind of stuck in a problem. Let me describe my project goal first. What I want to do is: 1) I will input a letter (suppose "K") via serial monitor to my MSP430G2553, 2) Upon receiving the letter, the launchpad will vary the voltage level a GPIO PIN (let's assume P1.4) based on the input, which is connected to an LED, 3) As the LED blinks based on the input bit pattern (K, ASCII value = 75, Binary equivalent = 01001011), one light dependent resistor will read this variation, which is connected to another Launchpad, and stores it a buffer 4) The launchpad will read this buffer value, and print it to serial monitor So, this is essentially a chat module between two launchpad, using serial monitor and some electronic stuff. My Problem: (I am using Energia for coding) I can read the character from Energia Serial Monitor, however, I don't know 1. How to transmit the received BIT pattern through a GPIO pin, towards a external LED. I am using the Hardware UART for communication with computer- Is there any other way, I can send data serially over regular GPIO PINs? Please let me know, if my question requires further clarification. I am working on it... if I can solve it, or have any update, I am gonna post it here. I'd really appreciate your help. Thank you in advance!
  14. Hello! I am a fresh beginner in the domain of embedded systems and this MSP430F5529 is my very first development board. I am now trying to make an ADC conversion and send it through the UART to try a signal treatment algorithm with real-world values. I used an example code in Energia that i modified a little bit: void setup() { // initialize serial communication at 9600 bits per second: Serial.begin(9600); // Comment: I see many people preferring the 115200 BR for this board. // Is there a particular reason for this choice? } // the loop routine runs over and over again forever: void loop() { // read the input on analog pin A3: int sensorValue = analogRead(A3); // Comment: I think the F5529 actually writes its ADC results on 12 bits. // Should i try to use a long, 16-bit integer? // print out the value you read: Serial.println(sensorValue); } The Energia console gives me expected readings, using an AA battery and an old function generator. For my first UART tests, I tried using Processing, a multipurpose javascript program that i use for drawing. import processing.serial.*; float[] y; // Array to contain the values read through the UART Serial myPort; // Create object from Serial class int val; // Data received from the serial port void setup() { // I define the size of the drawing board to be 600 X 400 pixels. size(600, 400); // I initialize my 'y' array y = new float[width]; for(int i = 0; i<width; i++){ y[i] = 0.0; } // This is to open the correct port. The number in square brackets might vary. String portName = Serial.list()[3]; // Here i define the baudrate, so it's the same as the one in Energia. myPort = new Serial(this, portName, 9600); } void draw() { // This draws a white background background(255); // This tells that i want to draw with the color black. stroke(0); for (int i = 0; i<width; i++){ // For every entry in my 'y' array, I draw a black dot. point(i,y[i]); } // I read a new value from the UART and feed it to my "update" routine. val = myPort.read(); update(val); } void update(int value){ // I shift every value to the left in my array. // This is to get a "strip-chart" feeling to my graph. for (int i = 0; i<width-1; i++){ y[i] = y[i+1]; } // For the last value, i use the value read from the serial port. // I convert it so that i have a correspondance: // min(UART) = bottom of screen, max(UART) = 2^12 - 1 = 4095 = top of screen. y[width-1] = (float)height - value * (float)height / 4095.0; // I also print the UART read value to this software's console for debugging. print(value,"\n"); } What prints on the console is a repetitive pattern of something like 13-10-48-13-10-48-etc. when my pin is grounded. When it's not grounded i get pretty much the same exact numbers with a little bit more variations. At first I thought it was a long int problem with the UART, beacause of the 12-bit ADC conversion, but i'm not so sure anymore. Help me! Thank you very much! readVoltage_ver1.ino
  15. Hi all, I am trying to control the PWM through UART usb serial at high speed, but the micro seems to pick up the input inconsistently(I am trying to create a 100 micro sec pulse using the PWM, but the micro sometimes does not pick up the input). So i am guessing the best way to do it is via interrupt(when the RX picks up any kind of input ), but I have no idea how to implement one. Can someone provide an example code for such application please? Thanks in advance. My Code: #include <stdbool.h> #include <stdint.h> #include "inc/hw_memmap.h" #include "driverlib/adc.h" #include "driverlib/gpio.h" #include "driverlib/sysctl.h" #include "driverlib/adc.h" #include "inc/hw_types.h" #include "driverlib/debug.h" //uart #include "inc/hw_types.h" #include "driverlib/pin_map.h" #include "driverlib/uart.h" //PWM #include "driverlib/pwm.h" #include "inc/hw_gpio.h" #include "driverlib/rom.h" #define PWM_FREQUENCY 100000// 100KHz int main(void) { uint32_t ui32ADC0Value[4]; volatile float ui32Avg; volatile float ui32Voltage; volatile char print[7]; volatile char power[1]; volatile uint32_t ui32Load; volatile uint32_t ui32PWMClock; //Set the clock SysCtlClockSet( SYSCTL_SYSDIV_64 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ); //400MHz / 2 (PLL) /64 = 3.125MHZ SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0); //Enable ADC0 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE); //Enable GPI0E ADCReferenceSet(ADC0_BASE, ADC_REF_INT); //Set reference to the internal reference GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_5); //Configure GPIO Port E Pin 5 as ADC ADCSequenceDisable(ADC0_BASE, 1); //It is always a good practice to disable ADC prior //to usage ,else the ADC may not be accurate // due to previous initializations ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0); //Use the 1st Sample sequencer ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_CH8); ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_CH8); ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_CH8); ADCSequenceStepConfigure(ADC0_BASE, 1, 3, ADC_CTL_CH8 | ADC_CTL_IE | ADC_CTL_END); //Configure ADC to read from channel 8 ,trigger the interrupt to end data capture // ADCSequenceEnable(ADC0_BASE, 1); //Enable the ADC //UART SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 230400, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE)); //PWM SysCtlPWMClockSet(SYSCTL_PWMDIV_1); // 3.125MHz SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM1); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD); GPIOPinTypePWM(GPIO_PORTD_BASE, GPIO_PIN_0); GPIOPinConfigure(GPIO_PD0_M1PWM0); ui32PWMClock = SysCtlClockGet(); ui32Load = (ui32PWMClock / PWM_FREQUENCY) - 1; PWMGenConfigure(PWM1_BASE, PWM_GEN_0, PWM_GEN_MODE_DOWN); PWMGenPeriodSet(PWM1_BASE, PWM_GEN_0, ui32Load); PWMPulseWidthSet(PWM1_BASE, PWM_OUT_0, ui32Load); //100% PWMOutputState(PWM1_BASE, PWM_OUT_0_BIT, false); PWMGenEnable(PWM1_BASE, PWM_GEN_0); while (1) { ADCIntClear(ADC0_BASE, 1); //Clear interrupt to proceed to data capture ADCProcessorTrigger(ADC0_BASE, 1); //Ask processor to trigger ADC while (!ADCIntStatus(ADC0_BASE, 1, false)) { //Do nothing until interrupt is triggered } ADCSequenceDataGet(ADC0_BASE, 1, ui32ADC0Value); //pui32ADC0Value is the value read ui32Avg = (ui32ADC0Value[0] + ui32ADC0Value[1] + ui32ADC0Value[2] + ui32ADC0Value[3]) / 4; ui32Voltage = (ui32Avg / 4095) * 3.3; sprintf(print, "%f", ui32Voltage); UARTCharPut(UART0_BASE, print[0]); UARTCharPut(UART0_BASE, print[1]); UARTCharPut(UART0_BASE, print[2]); UARTCharPut(UART0_BASE, print[3]); UARTCharPut(UART0_BASE, print[4]); UARTCharPut(UART0_BASE, print[5]); UARTCharPut(UART0_BASE, print[6]); UARTCharPut(UART0_BASE, '\n'); UARTCharPut(UART0_BASE, '\r'); //SysCtlDelay(10); while (UARTCharsAvail(UART0_BASE)) { int i = 0; power = UARTCharGet(UART0_BASE); i++; if (power[0] == '1') { PWMOutputState(PWM1_BASE, PWM_OUT_0_BIT, true); SysCtlDelay(104);//104us pulse PWMOutputState(PWM1_BASE, PWM_OUT_0_BIT, false); } else { PWMOutputState(PWM1_BASE, PWM_OUT_0_BIT, false); } } } }
  16. Dear Sir/Madam, I am trying to use MSP430 to talk with a wifi module using UART, technically, the msp430G2553 does not need to know the ip address for the wifi module, so the wifi module can be considered as another mcu. I have done the hardware and the calculation of voltage received and also converted to a string value. I can also read the values using hardware UART on serial monitor, but I now wants to send the results to the wifi module and check if the wifi module receives it on socket tools. My code are as below: #include <SoftwareSerial.h> // to the pins used: const int analogInPin = P1_4; //Analog input pin that the output from the current sensor is attached to const int txPin = P1_1;// TXD const int rxPin = P1_2;//RXD SoftwareSerial mySerial(P1_2,P1_1); // I defined a new serial using .....//some definitions here cut that for your easier to read and hopefully help !! void setup() { //initialize serial communications at 9600bps: Serial.begin(9600); mySerial.begin(57600); pinMode(analogInPin,INPUT); } void loop() { // put your main code here, to run repeatedly: //read the analog in value: ............... something here to read and calculate //convert to String //char str[5]; //sprintf(str, "%.2d", current); char curr[6]; itoa(int((current*10+5)/10),curr,10); //int dec = (current - (int)current)*100; //itoa(abs (dec) , buffer, 10); char pow[6]; itoa((power*10+5)/10,pow,10); Serial.println(curr); if (Serial.available()) { mySerial.write(Serial.read()); } } Thank you so much if you can help!
  17. Hi! I've got a launchpad MSP-EXP430G2 rev. 1.5 (with msp430g2553) and I need to use two pair of UART (2xRx and 2xTx). To be more specific, here's what I have to do: PC transmits 'data' to MSP --> MSP process that 'data' --> MSP transmits 'processed data' to another MCU... PC receives 'processed data' from MSP <-- MSP process that 'data' <-- MSP receives 'data' from another MCU... In short: PC -> MSP -> another MCU -> MSP -> PC Is it possible to do this with that launchpad? If it is, could you hint me some examples? I'm completely new with MSP.
  18. Hello, I'm currently working on a project involving G2553 MCU and Sparkfun Bluesmirf Silver BT module. I'm programming my MCU using the MSP430 Launchpad as a programmer and Energia IDE. I'm trying to configure the Bluetooth module using the firmware that I upload to the MCU. I connected the MCU's hardware UART pins to the Bluesmirf pins. Pin 1.1 (HW RX) to the module's RX and vice versa. I supply the same voltage to the MCU and the module (supply voltage connected to the breadboard from the Launchpad itself, multimeter shows values at around 3.5V). Bluesmirf's datasheet says the Vcc should be between 3.3V and 6V. My code looks like this: void setup() { Serial.begin(9600); initBTModule(); delay(delayReset); pinMode(RED_LED, OUTPUT); } void loop() { digitalWrite(RED_LED, HIGH); // turn the LED on (HIGH is the voltage level) delay(2000); // wait for a second digitalWrite(RED_LED, LOW); // turn the LED off by making the voltage LOW delay(2000); // wait for a second } // Sets up the Sparkfun Bluesmirf Silver Bluetooth module void initBTModule() { delay(2000); sendUART("$$$"); // enter command mode delay(200); sendUART("SN,Kanarek0000\n"); // set name of the device delay(200); sendUART("SP,kanarek0000\n"); // set security PIN code delay(200); sendUART("SU,96\n"); // set baud rate to 9600 delay(200); sendUART("R,1\n"); // reset device for changes to take effect delay(3000); } // Sends a char sequence using the hardware UART // pin 1.1 RX // pin 1.2 TX void sendUART(char msg[]) { Serial.print(msg); delay(3000); } After I upload the code however, nothing happens. After entering the Bluesmirf's command mode ($$$) it's power LED should start blinking rapidly, but it doesen't. When I tried with Arduino UNO and entering the commands manualy using the Serial Monitor (loop was constantly waiting for serial communication), It worked (With Arduino I was using the Software Serial however). I don't know if there is a problem with the AT commands or the code. Any help will be greatly appretiated! Thanks!
  19. On the 'Serial Communication' wiki entry, I see that the 'Software UART' case has not been elaborated or explained, unlike the Hardware UART feature available on v1.5 Launchpads. Can it be used to communicate with a Processing sketch running on PC (running Linux) ? Can someone please confirm that they have got the serial communication working (bidrectional) between MSP launchpad ?
  20. I've just started to toy around with Digi's XBee S2 ZigBee modules and my Tiva C-Series Launchpad. The XBees receive all their commands from any attached microcontroller via UART. I'm reading through the TivaWare UART API documentation, and it looks like the only function available to send data takes an ASCII character as an input rather than a hex value. Am I overlooking some other function that would take a hex value as an input, or do I have to convert my string of hex "characters" into ASCII first, then use the UARTCharPut() function?
  21. Hi all, I was playing around with the MSP430G2553 and the UART at the weekend, then remembered I had a cheap HC06 bluetooth module. The result being a basic Android app that you can control your launchpad using voice control, it's far from polished but a bit of fun all the same Project tutorial. C code and Android App http://coder-tronics.com/msp430-voice-control-over-bluetooth/ Video demonstration https://www.youtube.com/watch?v=8Z5ixK30Ddc Cheers, Ant
  22. Hi I am using tm4c123gh6pz UART. I am getting Interrupt but while I enable FIFO and try to get interrupt using following command, UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8); for the Receive, I get interrupt after 2 byte. I think Receive FIFO is 12 bit x 16 FIFO. To get interrupt after each byte I have to disable the FIFO. Is there any other way to keep the FIFO and get interrrupt after each Byte. Please let me know Thanks
  23. Just as an FYI - I was concerned about using the built in DCO in the FR5969 for UART because the spec sheet says although it's factory trimmed, it's still +/-3.5%. Generally it needs to be within 2% for a UART to work correctly so I measured the two FR5969's I have on our 2.4GHz frequency counter and this is what I got. 2 is obviously not a big sample size, but the frequency trimmed DCO on the FR series looks pretty good @ room temp and 8MHz or under. I found another doc from TI that's a comparison between F5xxx and FR5xxx and it mentions the DCO is generally within 2% "within a restricted temperature range" and within 3.5 in the full temperature range (-40C to 85C). I may need to re-measure at 4C because that's typically where our project will be operating.
  24. I'm fairly new to specifically MSP430 development, so any help here is appreciated! I'm trying to send data to and from a Raspberry Pi connected over hardware UART. This I've tested and works. I'm also trying to run two servos on the MSP430 and the basic code I have for them has been tested and also works. The problem occurs when I try to put them together as my timer setup must clash somewhere. It seems to me that the serial communication is all set on TA0 while the other timer is set to TA1. I don't understand why this would prevent the UART from sending and receiving. Edit: I'm using the MSP430G2553 int main(void){ WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer init_servos(); init_UART(); _BIS_SR(GIE); // Enable CPU interrupts while(1){ // Wait for incoming character _BIS_SR(LPM0_bits); // Enter low poser mode if (rxBuffer == 'a') { P1OUT |= BIT0; } } } void init_UART() { DCOCTL = 0x00; // Set DCOCLK to 1MHz BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1OUT = 0x00; // Initialize all GPIO P1SEL = UART_TXD + UART_RXD; // Timer function for TXD/RXD pins P1DIR = UART_TXD + BIT0; // TX and LED1 to Output // Configures Timer_A for full-duplex UART operation TA0CCTL0 = OUT; // Set TXD Idle as Mark = '1' TA0CCTL1 = SCS + CM1 + CAP + CCIE; // Sync, Neg Edge, Capture, Int TA0CTL = TASSEL_2 + MC_2; // SMCLK, start in continuous mode } void init_servos() { P2SEL |= BIT0 | BIT1; P2DIR |= BIT0 | BIT1; // Duty Cycle (585 - 675 - 765) TA1CCTL0 = OUTMOD_7; // reset/set (0) TA1CCTL1 = OUTMOD_7; // reset/set (1) TA1CTL = TASSEL_2 + MC_1; // SMCLK, up mode BCSCTL1 = 0x84; // CLK Info TA1CCR0 = 675; // Duty Cycle (2.0) TA1CCR1 = 675; // Duty Cycle (2.1) } void TimerA_UART_print(char *string) { // Prints a string using the Timer_A UART while (*string) TimerA_UART_tx(*string++); } void TimerA_UART_tx(unsigned char byte) { while (TACCTL0 & CCIE); // Ensure last char got TX'd TACCR0 = TAR; // Current state of TA counter TACCR0 += UART_TBIT; // One bit time till first bit TACCTL0 = OUTMOD0 + CCIE; // Set TXD on EQU0, Int txData = byte; // Load global variable txData |= 0x100; // Add mark stop bit to TXData txData <<= 1; // Add space start bit } #pragma vector = TIMER0_A0_VECTOR // Timer_A UART - Transmit Interrupt Handler __interrupt void Timer_A0_ISR(void) { static unsigned char txBitCnt = 10; TA0CCR0 += UART_TBIT; // Add Offset to CCRx if (txBitCnt == 0) { // All bits TXed? TA0CCTL0 &= ~CCIE; // All bits TXed, disable interrupt txBitCnt = 10; // Re-load bit counter } else { if (txData & 0x01) TA0CCTL0 &= ~OUTMOD2; // TX Mark '1' else TA0CCTL0 |= OUTMOD2; // TX Space '0' } txData >>= 1; // Shift right 1 bit txBitCnt--; } #pragma vector = TIMER0_A1_VECTOR // Timer_A UART - Receive Interrupt Handler __interrupt void Timer_A1_ISR(void) { static unsigned char rxBitCnt = 8; static unsigned char rxData = 0; switch (TA0IV) { // Use calculated branching case TA0IV_TACCR1: // TACCR1 CCIFG - UART RX TA0CCR1 += UART_TBIT; // Add Offset to CCRx if (TA0CCTL1 & CAP) { // Capture mode = start bit edge TA0CCTL1 &= ~CAP; // Switch capture to compare mode TA0CCR1 += UART_TBIT_DIV_2; // Point CCRx to middle of D0 } else { rxData >>= 1; if (TA0CCTL1 & SCCI) // Get bit waiting in receive latch rxData |= 0x80; rxBitCnt--; if (rxBitCnt == 0) { // All bits RXed? rxBuffer = rxData; // Store in global variable rxBitCnt = 8; // Re-load bit counter TA0CCTL1 |= CAP; // Switch compare to capture mode _BIC_SR_IRQ(LPM0_bits); // wake up from low power mode. } } break; } }
  • Create New...