Jump to content

hawwwran

Members
  • Content Count

    29
  • Joined

  • Last visited

About hawwwran

  • Rank
    Member

Profile Information

  • Gender
    Male
  1. I'm not able to run the demo code as parasitic. What should I do to make it working? Thank you
  2. hawwwran

    Sleep mode during a fixed duration ?

    Hello. I have a problem with timers. I would like to use the longdelay function above, but I use 2452 chip, not the 2553 and if I try to compile it, energia says "TIMER1_A0_VECTOR was not declared in ths scope"... Could someone rewrite the code to work with MSP430G2452? Thank you
  3. hawwwran

    TTL UART and FTDI - what is what and for what?

    Now it makes complete sense. Which means that for me (with MSP430G2553) both devices we are talking about are the same for me, only pins TXD and RXD are useful for me for serial communication, but for the programming stuff I have to use the Launchpad's top part as I use it now. OK, that's not problem. I just like to know stuff. Thank you
  4. hawwwran

    TTL UART and FTDI - what is what and for what?

    I know that, I use it that way, I even splitted the board for that purpose, but it's not effective. I can buy those devices above for about $2 each, that would be much better solution. And as a note, you don't actually need to connect the TXD and RXD to programm it. - Ok, so I cannot use those devices above, because they are not programmers with JTAG/SBW capability. I can use them for fine PC to MSP serial communication. - Now question about the first red one from sparkfun... What are those CTS and DTR pins good for when they do not provide JTAG?
  5. hawwwran

    TTL UART and FTDI - what is what and for what?

    I'm noob in this area so forgive me my silly and repetitive questions. - I get now the difference between the devices RST and DTR, thank you mbeals - I still don't really understand how the programming works. I know that launchpad (the top part) is using RST and TEST pins to programm the MSP. Is the launchpad's programmer somehow transforming the TXD RXD communication to those TEST and RST pins to programm the MSP or is it possible to find those pins (TEST RST) as output on the CP2102 to point them to TEST and RST on MSP to programm it? My point is, that I want to free myself from having to use launchpad for programming my devices which uses standalone MSP430G2553 chip. I would like to embedd the small device above into my devices or make programming cable for that purpose.
  6. hawwwran

    TTL UART and FTDI - what is what and for what?

    Hello again. Now I have this question: I'm awaiting this device to come soon and I don't get one thing... the RST line. What is it for? But my question is little bit more complicated. This device uses chip CP2102 so I searched little bit and found few articles how to take out DTR instead of the RST. But, as I found out.. for MSP430 it seems the DTR is usualy connected to RST pin, so what the RST on the device stands for? Here is the article how to bring the DTR out instead of the RST: http://jimlaurwilliams.org/wordpress/?p=999 And what I would be glad to do: to programm the MSP430 using this device. Is it possible? Apparantely not without some HW hack, but it looks arduino guys are able to programm arduino. I know I need the RST and TEST pins from launchpad to programm the chip... so after I figure out the mess with the DTR and RST, only TEST would remain to find and it could work... Have some of you guys any experience with this?
  7. hawwwran

    TTL UART and FTDI - what is what and for what?

    Oh, I think I get it now! So the RXD and TXD jumpers are not bridges, but switches. So I drawed little diagram how I think it's connected to work like that. I just had to, to be calm :-) Thanks for help
  8. hawwwran

    TTL UART and FTDI - what is what and for what?

    So you say, that connecting TXD and RXD pins from MSP to the device will allow me to communicate propperly the same as launchpad do? So my question is, why do I use launchpad with disabled TXD and RXD pins on top? I mean I have the jumpers horizontaly for SW UART, but I don't know what the SW UART actualy means... if I connect MSP's TXD and RXD pins, then it uses RST and TEST to communicate? I don't understand the mechanism how it works.
  9. hawwwran

    TTL UART and FTDI - what is what and for what?

    Another question about those devices. If I'm right, connecting the first (FTDI, red, sparkfun) one means connect it like this: device msp ------------------ dtr -> rst (reset) rxi -> rxd txo -> txd cts -> tst (test) The second one (TTL, blue) ------------------------------------ device msp ------------------ r -> rxd t -> txd Now my questions are: - am I right about the connection? - Will the first one work just like the launchpad's serial communication using "Serial.print();" in Energia? - Will the second one work just like the launchpad's serial communication using "Serial.print();" in Energia? I guess not (there are not the test and reset pins) so how to use it? How to simple communicate using the second one? Hello world example appreciated. Hawwwran
  10. hawwwran

    TTL UART and FTDI - what is what and for what?

    I ordered both types from china for $5 ftdi and $2 the ttl one. And both of them capable of 3.3V and 5V. The TTL one even simultaneously. So, there is literally no difference (do not count the drivers)? And yes, sparkfun has terrible prices :-(
  11. Hello, I found some devices which should allow me to connect naked MSP430G2553 chip to PC over USB. But here is one problem I don't really understand. I found devices with FTDI chip (I know it's a brand name) and devices which I found under "TTL UART" or "USB to TTL". Here is link to the FTDI one: https://www.sparkfun.com/products/9873 Here is link to the TTL one: http://dx.com/p/usb-2-0-to-ttl-uart-5-pin-cp2102-module-serial-converter-blue-152317 So, my question is: is there any difference between those two? Because there is huge difference in price. Thanks for replies
  12. I'm afraid I don't understand. Could you post working usci isr handler file? Or should I read your fix again to understand it better?
  13. With this one it does not work (restart of energia needed): #include "Energia.h" #if defined(__MSP430_HAS_USCI__) || defined(__MSP430_HAS_EUSCI_A0__) #include "usci_isr_handler.h" /* This dummy function ensures that, when called from any module that * is interested in having the USCIAB0TX_VECTOR and USCIAB0TX_VECTOR * installed, the linker won't strip the vectors.*/ void usci_isr_install(){} #if defined(__MSP430_HAS_EUSCI_A0__) __attribute__((interrupt(USCI_A0_VECTOR))) void USCIA0_ISR(void) { switch ( UCA0IV ) { case USCI_UART_UCRXIFG: uart_rx_isr(); break; case USCI_UART_UCTXIFG: uart_tx_isr(); break; } } #else // #if defined(__MSP430_HAS_EUSCI_A0__) /* USCI_Ax and USCI_Bx share the same TX interrupt vector. * UART: * USCIAB0TX_VECTOR services the UCA0TXIFG set in UC0IFG. * USCIAB0RX_VECTOR services the UCA0RXIFG set in UC0IFG. * I2C: * USCIAB0TX_VECTOR services both UCB0TXIFG and UCB0RXIFG * set in UC0IFG. * USCIAB0RX_VECTOR services the state change interrupts * UCSTTIFG, UCSTPIFG, UCIFG, UCALIFG set in UCB0STAT.*/ __attribute__((interrupt(USCIAB0TX_VECTOR))) void USCIAB0TX_ISR(void) { /* USCI_A0 UART interrupt? */ if (UC0IFG & UCA0TXIFG) uart_tx_isr(); /* USCI_B0 I2C TX RX interrupt. */ if ((UCB0CTL0 & UCMODE_3) == UCMODE_3 && (UC0IFG & (UCB0TXIFG | UCB0RXIFG)) != 0) i2c_txrx_isr(); } #endif // #if defined(__MSP430_HAS_EUSCI_A0__) #endif // if defined(__MSP430_HAS_USCI__) || defined(__MSP430_HAS_EUSCI_A0__) This one works (fot the serial read): #include "Energia.h" #if defined(__MSP430_HAS_USCI__) || defined(__MSP430_HAS_EUSCI_A0__) #include "usci_isr_handler.h" /* This dummy function ensures that, when called from any module that * is interested in having the USCIAB0TX_VECTOR and USCIAB0TX_VECTOR * installed, the linker won't strip the vectors.*/ void usci_isr_install(){} #if defined(__MSP430_HAS_EUSCI_A0__) __attribute__((interrupt(USCI_A0_VECTOR))) void USCIA0_ISR(void) { switch ( UCA0IV ) { case USCI_UART_UCRXIFG: uart_rx_isr(); break; case USCI_UART_UCTXIFG: uart_tx_isr(); break; } } #else // #if defined(__MSP430_HAS_EUSCI_A0__) /* USCI_Ax and USCI_Bx share the same TX interrupt vector. * UART: * USCIAB0TX_VECTOR services the UCA0TXIFG set in UC0IFG. * USCIAB0RX_VECTOR services the UCA0RXIFG set in UC0IFG. * I2C: * USCIAB0TX_VECTOR services both UCB0TXIFG and UCB0RXIFG * set in UC0IFG. * USCIAB0RX_VECTOR services the state change interrupts * UCSTTIFG, UCSTPIFG, UCIFG, UCALIFG set in UCB0STAT.*/ __attribute__((interrupt(USCIAB0TX_VECTOR))) void USCIAB0TX_ISR(void) { /* USCI_A0 UART interrupt? */ if (UC0IFG & UCA0TXIFG) uart_tx_isr(); /* USCI_B0 I2C TX RX interrupt. */ if ((UCB0CTL0 & UCMODE_3) == UCMODE_3 && (UC0IFG & (UCB0TXIFG | UCB0RXIFG)) != 0) i2c_txrx_isr(); } __attribute__((interrupt(USCIAB0RX_VECTOR))) void USCIAB0RX_ISR(void) { /* USCI_A0 UART interrupt? */ if (UC0IFG & UCA0RXIFG) uart_rx_isr(); /* USCI_B0 I2C state change interrupt. */ if ((UCB0STAT & (UCALIFG | UCNACKIFG | UCSTTIFG | UCSTPIFG)) != 0) i2c_state_isr(); } #endif // #if defined(__MSP430_HAS_EUSCI_A0__) #endif // if defined(__MSP430_HAS_USCI__) || defined(__MSP430_HAS_EUSCI_A0__)
  14. And really simple one: char chr; void setup() { Serial.begin(9600); } void loop() { while (Serial.available() > 0) { // while there are data on serial input chr = Serial.read(); // fill the byte on input into char variable Serial.print(chr); // print to serial } }
  15. here is the code. With the usci_isr_handler fix it prints nothing, without it it prints everithing sent to the Serial from PC ending with "." int incomingByte = 0; // for incoming serial data char chr='.'; // var to store char from serial port char string2[16]; // command string (maximum length of the command is set to 16 bytes) int string2idx = 0; char commandDivider='.'; // char which devides commands int moveDelay = 30; // delay between moves. Usable for slowing down the motor movements int command_int=0; void setup() // run once, when the sketch starts { Serial.begin(9600); // set up Serial library at 9600 bps } void loop() // run over and over again { while (Serial.available() > 0) { // while there are data on serial input int inChar = Serial.read(); // fill the byte on input into char variable chr=(char)inChar; if (chr!=commandDivider) { // if input is not command divider string2[string2idx++] = inChar; // add the char in the string array string2[string2idx] = 0; // add 0 byte on the end of the array } if (chr == commandDivider) { // if it's the same char as the divider of commands command_int=atoi(string2); // if you want to transform the input string into an integer, use this function Serial.print("Command: "); Serial.println(string2); if(strcmp(string2,"red")==0) { analogWrite(2,255); // turn the red LED on Serial.println("Red LED is on"); } if(strcmp(string2,"green")==0) { analogWrite(14,255); // turn the green LED on Serial.println("Green LED is on"); } if(strcmp(string2,"off")==0) { // turn the LEDs off analogWrite(14,0); analogWrite(2,0); Serial.println("LEDs are off"); } string2[0] = 0;string2idx = 0; // empty the command } } }
×