Jump to content

Search the Community

Showing results for tags 'help'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 12 results

  1. Hi ! I am new to use TI processor and CCS studio... I have setup the Environment and executed the Sample programs provided in Evaluation Board. By using project_zero_app_cc2650launchxl & project_zero_stack_cc2650 , i am able to communicate with Mobile application... Now i need help in Creating a New project with my preferable name(Garimella_BLE_Project) and adding the required components/folders for BLE working .... Please help me in this .. Thanks & Regards Garimella Srinivasu garimellasrinivasu@gmail.com
  2. I have been trying to generate a simple ms timer. Non of the examples compile that come with 17 or 18. the Timer.h and Timer.cpp files fail. Any help would be appreciated. Thanks
  3. Hello I have problems with the two NRF24L01 and two tm4c123gxl. I can not get it running. Pins 1. Tm4c123gxl (RX): PC_6 (CE), PD_2 (MISO), PD_3 (MOSI), PD_1 (CS), PD_0 (SCK), PE_1 (IRQ) Pins 2. Tm4c123gxl (TX): PC_7 (CE), PD_2 (MISO), PD_3 (MOSI), PD_1 (CS), PD_0 (SCK), PE_1 (IRQ) I will use a simply Sketch. I have found this in the Forum [Energia Library] Nordic nRF24L01+ library I have download this Enrf24_v1_8.zip from the Forum. Enerf24_RXdemo #include <Enrf24.h> #include <nRF24L01.h> #include <string.h> #include <SPI.h> Enrf24 radio(PC_6, PD_1, PE_1); const uint8_t rxaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 }; const char *str_on = "ON"; const char *str_off = "OFF"; void dump_radio_status_to_serialport(uint8_t); void setup() { Serial.begin(9600); SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(MSBFIRST); radio.begin(); // Defaults 1Mbps, channel 0, max TX power dump_radio_status_to_serialport(radio.radioState()); radio.setRXaddress((void*)rxaddr); radio.enableRX(); // Start listening } void loop() { char inbuf[33]; dump_radio_status_to_serialport(radio.radioState()); // Should show Receive Mode while (!radio.available(true)) ; if (radio.read(inbuf)) { Serial.print("Received packet: "); Serial.println(inbuf); if (!strcmp(inbuf, str_on)) Serial.println("HIGH"); if (!strcmp(inbuf, str_off)) Serial.println("LOW"); } } void dump_radio_status_to_serialport(uint8_t status) { Serial.print("Enrf24 radio transceiver status: "); switch (status) { case ENRF24_STATE_NOTPRESENT: Serial.println("NO TRANSCEIVER PRESENT"); break; case ENRF24_STATE_DEEPSLEEP: Serial.println("DEEP SLEEP <1uA power consumption"); break; case ENRF24_STATE_IDLE: Serial.println("IDLE module powered up w/ oscillators running"); break; case ENRF24_STATE_PTX: Serial.println("Actively Transmitting"); break; case ENRF24_STATE_PRX: Serial.println("Receive Mode"); break; default: Serial.println("UNKNOWN STATUS CODE"); } } Enrf24_TXdemo #include <Enrf24.h> #include <nRF24L01.h> #include <string.h> #include <SPI.h> Enrf24 radio(PC_7, PD_1, PE_1); // CE, CSN, IRQ const uint8_t txaddr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0x01 }; const char *str_on = "ON"; const char *str_off = "OFF"; void dump_radio_status_to_serialport(uint8_t); void setup() { Serial.begin(9600); SPI.begin(); SPI.setDataMode(SPI_MODE0); SPI.setBitOrder(MSBFIRST); radio.begin(); // Defaults 1Mbps, channel 0, max TX power dump_radio_status_to_serialport(radio.radioState()); radio.setTXaddress((void*)txaddr); } void loop() { Serial.print("Sending packet: "); Serial.println(str_on); radio.print(str_on); radio.flush(); // Force transmit (don't wait for any more data) dump_radio_status_to_serialport(radio.radioState()); // Should report IDLE delay(1000); Serial.print("Sending packet: "); Serial.println(str_off); radio.print(str_off); radio.flush(); // dump_radio_status_to_serialport(radio.radioState()); // Should report IDLE delay(1000); } void dump_radio_status_to_serialport(uint8_t status) { Serial.print("Enrf24 radio transceiver status: "); switch (status) { case ENRF24_STATE_NOTPRESENT: Serial.println("NO TRANSCEIVER PRESENT"); break; case ENRF24_STATE_DEEPSLEEP: Serial.println("DEEP SLEEP <1uA power consumption"); break; case ENRF24_STATE_IDLE: Serial.println("IDLE module powered up w/ oscillators running"); break; case ENRF24_STATE_PTX: Serial.println("Actively Transmitting"); break; case ENRF24_STATE_PRX: Serial.println("Receive Mode"); break; default: Serial.println("UNKNOWN STATUS CODE"); } } When i am upload this, i don't see the Sending objects. I see only in both Serial.monitor this: "Enrf24 radio transceiver status NO TRANSCEIVER PRESENT". Can someone help me?
  4. efixler

    Hello from New York!

    Hi everyone. I just got a cc3200 launchpad and am coding on a Mac with Energia. I'm impressed with what this setup can do. I'm trying to get a handle on how on how to how to use the timer functions to create one-shots or functions called at specific intervals. I can find references in Energia.h and driverlib/timer.h but no docs or samples. If anyone has any tips on getting started please pass them on, I'd appreciate it. Looking forward to coding... - eric
  5. help950

    ButtonsPoll()

    Hi, I'm having a lot of issues trying to get the ButtonsPoll() function working as recommended at the end of tutorial 3 from TI. I've done the first 3 lab instruction videos, followed the guidance on http://unboxnbeyond.wordpress.com/2013/04/14/using-button-h-for-inbuilt-buttons/#more-166, and also followed the guidance on a previous topic: http://forum.stellarisiti.com/topic/577-polling-a-switch/ . I think I've managed to set the include options to the right place, they are identical to the first link, same with the file search paths, and set the macros ( compliler|advanced options|predefined symbols) to what is recommended in the other topic. They are in the correct order (not sure why that makes a difference but seems to reduce my errors), The errors I am getting are: Description Resource Path Location Type <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/225.html">#225-D</a> function "ROM_GPIOPadConfigSet" declared implicitly buttons.c /lab3/drivers line 178 C/C++ Problem <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/225.html">#225-D</a> function "ROM_GPIOPinRead" declared implicitly buttons.c /lab3/drivers line 185 C/C++ Problem <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/10234.html">#10234-D</a> unresolved symbols remain lab3 C/C++ Problem #10010 errors encountered during linking; "lab3.out" not built lab3 C/C++ Problem unresolved symbol ROM_GPIOPinRead, first referenced in ./drivers/buttons.obj lab3 C/C++ Problem unresolved symbol ROM_SysCtlPeripheralEnable, first referenced in ./drivers/buttons.obj lab3 C/C++ Problem unresolved symbol ROM_GPIODirModeSet, first referenced in ./drivers/buttons.obj lab3 C/C++ Problem Warnings: <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/225.html">#225-D</a> function "ROM_GPIOPinRead" declared implicitly buttons.c /lab3/drivers line 93 C/C++ Problem unresolved symbol ROM_GPIOPadConfigSet, first referenced in ./drivers/buttons.obj lab3 C/C++ Problem <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/225.html">#225-D</a> function "ROM_SysCtlPeripheralEnable" declared implicitly buttons.c /lab3/drivers line 163 C/C++ Problem <a href="file:/C:/ti/ccsv5/tools/compiler/dmed/HTML/225.html">#225-D</a> function "ROM_GPIODirModeSet" declared implicitly buttons.c /lab3/drivers line 177 C/C++ Problem I tried inserting the macro 'CCS = "CCS" ' (blindly, have no idea what its doing), this gets rid of the errors, and just causes a fatal compilation error. I hope someone can help me solve this issue. I understand how to do the button polling through other means, but I think getting my head around a seemingly ridiculous maze of includes and search paths is more important.
  6. ClydeTombaugh

    Output Pins Don't Work

    Hi, I'm running Energia on Windows 7 x64. My Launch Pad model is the MSP-EXP430F5529LP (25Hz) My board's green LED will light up when connecting to the computer, the red LED will flash while compiling and all onboard LEDs and buttons function when programed. However, whenever I try to program output pins and connect the output in question to ground, I get no current out. I have plenty of experience with Arduino and all programs I write for the Launch Pad work for Arduino. The GND, 5V and 3.3V pins on the LaunchPad all work fine. I have also used a number of sample programs, all to no avail. Here is a schematic sheet for my model. http://energia.nu/img/LaunchPadMSP430F5529.jpg Here is a quick program that I have written to demonstrate one way that I have been testing it. const int led = 19; // LED is hooked to P2.0 aka 19 with at 220 Ohm resistor and then connected to ground. void setup() { pinMode(led, OUTPUT); } void loop() { digitalWrite(led, HIGH); //LED should turn on and quickly flash off and on again delay(1000); //I know for sure that the LED is not broken because I digitalWrite(led, LOW); // repeatedly test it with my Arduino between compiling delay(500); }
  7. Hey guys. I recently got a Launch pad -- MSP430G2 board ( Rev B ) [only the board and the USB cable from a friend]. I downloaded Energia for my Mac running OS X 10.9. [maverics]. Though the Power LED lights up, the board is not recognised by the IDE. I don't know if the problem is with the board, the cable or the IDE. Though the board was detected for a short period of time and I was able to just uplaod the Blink sketch into it. Now when I connect to a USB power or my MAC, led1 just keeps blinking. I am unable to program it. I hope you guys can help me spot the problem so that I can rectify it and make use of the board to learn Embedded systems. Thanks in advance.
  8. I've just started playing around with my msp430 ez-2013 that my uncle gave me a while back (I've been too busy with school and whatnot until now ) and am trying to use the ez-2013 to control a transistor that will flash an externally powered LED. So far I've had no luck with it. I'm using a 2n222 transistor with a 10k ohm resistor from P1.0 on the ez-2013 to the base and a 10k ohm resistor on the emitter, with the anode of the LED attatched to the collector and the cathode attached to +6V. The resistor on the emitter is attached to ground. The led is powered seperately from the microcontroller (the MC is powered by USB) and the led/transistor is powered by 4 AA batteries. The transistor does work (the LED lights up when i connect the base to +6V) but does not turn on when attatched to the MC. I am just using the "Flashing the LED" program to eliminate the possibility of coding error. Is there something that I've done wrong, something I'm missing/have overlooked? Does the MC have to be powered by the same source as the LED or something in order for it to work? Would appreciate some help with my noob problem! Thanks in advance! Londonlad PS I attatched a photo of the setup, might provide some help in figuring out what I've done (wrong)
  9. Hello everyone, I recently purchased a stellaris for a school and I am having trouble finding a code for the space invaders game that I can play on a 16x2 LCD. can anyone help me?
  10. babisr

    Hi from Brazil

    Hi, I'm from Brazil! First thing I want to say: nice f
  11. Gareeeesh

    Sending Image as RGB Array to G2553

    Hi everybody, Hopefully someone will be able to help. The aim of this project is to send an image from my laptop over a serial port to the MSP430G2553 where the data will be processed and then the image will be shown on my RGB LED display. At present I'm looking at methods of converting an image into an RGB array. I found that using GIMP, a file can be exported as a ".c" source code file which converts the image into an array. - Although the syntax is unlike any I have seen before. Anyways, i am using a program I found on the web to do the sending of the data over the serial port (http://batchloaf.wordpress.com/2013/02/13/writing-bytes-to-a-serial-port-in-c/) then I am simply changing the "bytes_to_send" array to the image array. On the receiving end of the transmission, I am unsure how to process the data - should I do it in the "USCI0RX_ISR" ? Here's the code from which I am working: #include <msp430g2553.h> #include <msp430.h> // TLC inputs #define VPRG_PIN BIT0 // TIE TO GND? #define RX_PIN BIT1 #define TX_PIN BIT2 #define GSCLK_PIN BIT4 #define SCLK_PIN BIT5 #define DATA BIT6 // DS -> 1.6 | 595 DATA PIN #define MOSI_PIN BIT7 #define DCPRG_PIN BIT0 // TIE IT TO GND? #define XLAT_PIN BIT1 #define BLANK_PIN BIT2 #define CLOCK BIT3 // SH 11 -> 2.3 // 595 OUTPUTS #define LATCH BIT4 // ST 12 -> 2.4t typedef unsigned char u_char; typedef unsigned int u_int; typedef unsigned short u_short; typedef unsigned long u_long; // ================================// // Prototypes // // ================================// void init( void ); void SPI( void ); void UART(void); void updateTLC( void ); void shiftOut( u_long ); void HSV2RGB( u_short*, u_short*, u_short*, short,u_char); void set_row_char_hue (u_char, u_long, short,u_char); void row_refresh(u_char,short,short,short,short,short,short,short,short,short,short,short,short,short,short,short,short); void clearArray(void); void serialSnake(void); void extractRGB(); // ===================================================================================== #define UPDATE {P2OUT |= (BLANK_PIN);P2OUT |= (XLAT_PIN);P2OUT &= ~(XLAT_PIN);P2OUT &= ~(BLANK_PIN);updateTLC();} #define NUMBER_OF_OUTS 48 // TLC OUTPUTS #define NUMBER_OF_ROWS 16 #define NUMBER_OF_COLUMNS 16 #define max_COLUMN NUMBER_OF_COLUMNS-1 #define max_ROW NUMBER_OF_ROWS-1 #define OFF 0 u_short leds[NUMBER_OF_OUTS]; // 0 - 15 Red Rows, 16 - 31 Blue Rows, 32 - 47 Green Rows {0, } short columnArray[16] = {0x8000,0x4000,0x2000,0x1000,0x0800,0x0400,0x0200,0x0100,0x0080,0x0040,0x0020,0x0010,0x0008,0x0004,0x0002,0x0001}; u_char rowArray[16] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; u_char cnt = 0; u_char SAT = 255; // full colour // ========== SERIAL GLOBAL VARIABLES =================================== u_char rxRow = 0; u_char rxCol = 0; u_char image[16][16]; u_char colour[3]; u_char Count = 0; u_char cCount = 0; u_char rCount = 0; // ====================================================================== void init(void) { WDTCTL = WDTPW + WDTHOLD; // disable WDT BCSCTL1 = CALBC1_16MHZ; // 16MHz clock DCOCTL = CALDCO_16MHZ; BCSCTL2 |= DIVS_0; // divide clock by 1 // Setup TLC and 595 outputs P1DIR |= (VPRG_PIN + GSCLK_PIN + DATA); P1SEL |= GSCLK_PIN; // port 1.4 configured as SMCLK out P2DIR |= (BLANK_PIN + XLAT_PIN + CLOCK + LATCH + DCPRG_PIN); P1OUT &= ~(VPRG_PIN); P2OUT &= ~(BLANK_PIN + XLAT_PIN); P2OUT &= ~DCPRG_PIN; // setup timer TA0CCR0 = 0xFFF; TA0CTL = TASSEL_2 + MC_1 + ID_0; // SMCLK, up mode, 1:1 TA0CCTL0 = CCIE; // CCR0 interrupt enabled // // setup FrameBuffer Timer // TA1CCR0 = 0xFFF; // TA1CTL = TASSEL_2 + MC_1 + ID_0; // SMCLK, up mode, 1:1 // TA1CCTL0 = CCIE; // CCR0 interrupt enabled } void SPI(void) { // SPI setup UCB0 P1SEL |= SCLK_PIN + MOSI_PIN; // pins 5 + 7 P1SEL2 |= SCLK_PIN + MOSI_PIN; // UCB0CLK + UCB0SIMO UCB0CTL0 = UCCKPH + UCMSB + UCMST + UCSYNC; // data captured on 1st UCLK edge/changed on follwing edge, MSB first, master, 3-pin SPI,synchronous UCB0CTL1 |= UCSSEL_2; // SMCLK UCB0BR0 |= 0x01; // 1:1 UCB0BR1 = 0; UCB0CTL1 &= ~UCSWRST; // clear SW } void UART(void) { // UART Setup UCA0 P1SEL |= RX_PIN + TX_PIN; //Set P1.1 and P1.2 to RX and TX P1SEL2 |= RX_PIN + TX_PIN; UCA0CTL1 |= UCSSEL_2; //SMCLK UCA0BR0 = 138; //115200 @[member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""][member=""] 16MHz UCA0BR1 = 0; //115200 UCA0MCTL = UCBRS_1; //Modulation UCA0CTL1 &= ~UCSWRST; //Start USCI IE2 |= UCA0RXIE; //Enable RX interrupt } void main(void) { u_char z; init(); SPI(); UART(); updateTLC(); P2OUT |= (XLAT_PIN); P2OUT &= ~(XLAT_PIN); _bis_SR_register(GIE); for(; { // extractRGB(); while (!(IFG2 & UCA0RXIFG)); for(z = 0; z < 16; z++) { leds[z] = colour[0] * 16; //r leds[z+32] = colour[1] * 16; // g leds[z+16] = colour[2] * 16; // b shiftOut(columnArray[rxCol]); } _bis_SR_register(LPM0_bits); } } void updateTLC(void) // RobG's code { u_char ledCounter = NUMBER_OF_OUTS >> 1; while (ledCounter-- > 0) { u_char i = ledCounter << 1; UCB0TXBUF = leds[i + 1] >> 4; while (!(IFG2 & UCB0TXIFG)); // TX buffer ready? u_char unib = leds[i + 1] << 4; u_char lnib = (leds[i] >> 8) & 0x0F; UCB0TXBUF = unib | lnib; while (!(IFG2 & UCB0TXIFG)); // TX buffer ready? UCB0TXBUF = leds[i]; while (!(IFG2 & UCB0TXIFG)); // TX buffer ready? } } //void extractRGB(void) //{ // u_char i; // for(i=0;i<16;i++) // { // leds[i] = image[3*i][rxCol]; // leds[i+16] = image[(3*i)+1][rxCol]; // leds[i+32] = image[(3*i)+2][rxCol]; // shiftOut(columnArray[rxCol]); // } //} void shiftOut(u_long val) { P2OUT &= ~LATCH; int i; for (i = 0; i < 32; i++) // iterate over each bit 16 { if(val & (1 << i)) { P1OUT |= DATA; } else { P1OUT &= ~DATA; } P2OUT |= CLOCK; // PULSE CLOCK P2OUT ^= CLOCK; } P2OUT |= LATCH; // PULSE LATCH P2OUT &= ~LATCH; } #pragma vector=USCIAB0RX_VECTOR __interrupt void USCI0RX_ISR(void) { while(UCA0RXBUF) { if(Count < 3) { colour[Count] = UCA0RXBUF; Count++; } else { Count = 0; } if( rCount == 48 ) { rxRow++; rCount = 0; } else { rCount++; } if( cCount == 16 ) { cCount = 0; } else { rxCol++; cCount = 0; } } } #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer_A0(void) { _bic_SR_register_on_exit(LPM0_bits); // wake up main loop so that it can prepare data for the next frame } #pragma vector = TIMER0_A1_VECTOR __interrupt void Timer_A1(void) {} I've taken out a bunch of functions which won't be used for this part of the project, so there are some variables etc. which arent used. Below is the modified version of the TX code I am using with the GIMP image array included: // serial.c / serial.cpp // A simple serial port writing example // Written by Ted Burke - last updated 13-2-2013 // // To compile with MinGW: // // gcc -o serial.exe serial.c // // To compile with cl, the Microsoft compiler: // // cl serial.cpp // // To run: // // serial.exe // #include <windows.h> #include <stdio.h> /* GIMP RGB C-Source image dump (TEST.c) */ // export opacity 68 #define GIMP_IMAGE_WIDTH (16) #define GIMP_IMAGE_HEIGHT (16) #define GIMP_IMAGE_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */ #define GIMP_IMAGE_PIXEL_DATA ((unsigned char*) GIMP_IMAGE_pixel_data) static const unsigned char bytes_to_send[16 * 16 * 3 + 1] = ("\255\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\0\255\255" "\255\0\0\255\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\0\255\255\255\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\0\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\0\255\255" "\0\255\255\255\255\255\255\0\255\0\0\255\0\255\255\255\255\255\255\255\255" "\0\255\255\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\0\255\255\0\255\255\255\255\255\255\0\255\0\0\255\0\255\255" "\255\255\255\255\255\255\0\255\255\0\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\0\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\0\255\255" "\255\0\0\255\255\255\255\255\255\0\255\0\0\255\0\255\255\255\255\255\255\0" "\0\255\0\0\255\255\255\255\255\255\255\0\255\0\0\255\0\255\255\255\255\255" "\255\255\0\0\255\0\0\255\255\255\255\255\255\0\255\0\0\255\0\255\255\255\255" "\255\255\0\0\255\0\0\255\255\255\255\255\255\255\0\255\0\0\255\0\255\255\255" "\255\255\255\255\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\0\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\0\255" "\255\0\255\255\255\255\255\255\0\255\0\0\255\0\255\255\255\255\255\255\255" "\255\0\255\255\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\0\255\255\0\255\255\255\255\255\255\0\255\0\0\255\0\255" "\255\255\255\255\255\255\255\0\255\255\0\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\0\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\255\0\255" "\255\255\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255\255\0\255" "\255\255\0\0\255\0\0\0\255\255\255\255\255\255\255\255\255\255\255\255\255" "\255\0\255\255\255\0\0"); int main() { // Define the five bytes to send ("hello") // char bytes_to_send[5]; // bytes_to_send[0] = 104; // bytes_to_send[1] = 101; // bytes_to_send[2] = 108; // bytes_to_send[3] = 108; // bytes_to_send[4] = 111; // Declare variables and structures HANDLE hSerial; DCB dcbSerialParams = {0}; COMMTIMEOUTS timeouts = {0}; // Open the highest available serial port number fprintf(stderr, "Opening serial port..."); hSerial = CreateFile( "\\\\.\\COM5", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL ); if (hSerial == INVALID_HANDLE_VALUE) { fprintf(stderr, "Error\n"); return 1; } else fprintf(stderr, "OK\n"); // Set device parameters (115200 baud, 1 start bit, // 1 stop bit, no parity) dcbSerialParams.DCBlength = sizeof(dcbSerialParams); if (GetCommState(hSerial, &dcbSerialParams) == 0) { fprintf(stderr, "Error getting device state\n"); CloseHandle(hSerial); return 1; } dcbSerialParams.BaudRate = CBR_115200; dcbSerialParams.ByteSize = 8; dcbSerialParams.StopBits = ONESTOPBIT; dcbSerialParams.Parity = NOPARITY; if(SetCommState(hSerial, &dcbSerialParams) == 0) { fprintf(stderr, "Error setting device parameters\n"); CloseHandle(hSerial); return 1; } // Set COM port timeout settings timeouts.ReadIntervalTimeout = 50; timeouts.ReadTotalTimeoutConstant = 50; timeouts.ReadTotalTimeoutMultiplier = 10; timeouts.WriteTotalTimeoutConstant = 50; timeouts.WriteTotalTimeoutMultiplier = 10; if(SetCommTimeouts(hSerial, &timeouts) == 0) { fprintf(stderr, "Error setting timeouts\n"); CloseHandle(hSerial); return 1; } // Send specified text (remaining command line arguments) DWORD bytes_written, total_bytes_written = 0; fprintf(stderr, "Sending bytes..."); if(!WriteFile(hSerial, bytes_to_send, 769, &bytes_written, NULL)) { fprintf(stderr, "Error\n"); CloseHandle(hSerial); return 1; } fprintf(stderr, "%d bytes written\n", bytes_written); // Close serial port fprintf(stderr, "Closing serial port..."); if (CloseHandle(hSerial) == 0) { fprintf(stderr, "Error\n"); return 1; } fprintf(stderr, "OK\n"); // exit normally return 0; } If anyone could help that would be much appreciated since this is the last part of my project! Cheers
  12. izdane

    Hi from Canada

    My name is Ivan and I am a 12 year old kid from Canada. I just ordered a Launchpad and a Terminal booster pack. I downloaded the code and imported it into CCS. When ever I try to debug on the Launchpad, it says "Error Connecting to target". I tried connecting to 2 different computers both running different versions of Windows. Could any one help out please? Thanks, Ivan
×