Jump to content


  • Content Count

  • Joined

  • Last visited

  1. Fabinhou

    Debug and Release mode

    I'll check here for some breakpoints, and yes, there is a external peripheral that requires some time after power on. I'm gonna check it and post here later. Thanks! Edit.: Well, I removed all breakpoints and didn't work. So I decided to add the delay as you said, after holding watchdog and after initializating the clock frequency and it worked. Probably was my OLED display that needed some power up time before inializating. Thank you! This forum is being so useful.
  2. Fabinhou

    Debug and Release mode

    Hello, everyone. I have some problems. I need to finish my final project until this week, and I realized that my program only start when I press the reset button on my LaunchPad MSP430G2553. The Launchpad is going to be on a closed box and the reset button wouldn't be reachable. I did some researchs, and I find out that my program was in debug mode. So I changed to release mode on CCS and the program start running as soon as power on my LaunchPad, but everything that was working perfectly on debug mode, isn't on release mode. It seems that my program only works on debug mode. My code has something like 3000 lines, and it's hard to search for some tiny mistakes. The question is: Is there a way to run my code on Debug Mode but make it start as soon as I power on my Launchpad instead of needing to press the reset button ? Thank you, advance.
  3. Fabinhou

    USB-Tunneled Serial Connection

    Oh yeah, of course! What a stupid question. I must be getting dumber due to my final project. Thank you, that should be enough On my Launchapad, this chip is used TUSB3410 ( http://www.ti.com/lit/ds/symlink/tusb3410.pdf )
  4. Thank you for responding. After a lot of searching, I discovered that there is a plugin (a .dll file that we can add to chrome directory) that allows the communication from a website from the client side to a microcontroller using javascript language. This is the plugin I used (jUART https://github.com/billhsu/jUART ). If I didn't have used this plugin I could build and Chrome Extension and a Chrome App. Like Lgbeno said, there is a Serial API for chrome app and extensions developers. In Chrome you can develop Packaged APP ( that aren't tighted to websites, are offline ) and extensions (that are strongly tighted to websites). But for what I searched, it's not possible to use the serial API straight from a chrome extension that is connected to a website for security reasons. So you can build a Chrome Extension that communicate to your web site, and send the messages from message passing api to the Chrome App. Chrome App will receive the Extension messages and pass it to serial port via Serial API. The other way around is possible too. "Website javascript block <-> Chrome Extension <-> Chrome App <-> Serial Port"
  5. Fabinhou

    USB-Tunneled Serial Connection

    Hello! I'm writing down my last project report for college and I need to explain how the USB-Tunneled Serial Connection on Launchpad works. I already know that it works, because I used in my project and I can see the emulated COM Port that launchpad is connected with. The communication from PC to Msp430g2553 (and vice versa) works fine. What I want to know, is how this works, from the MSP430 side and from the PC side. Does anyone have any article or document that explain this process more detailed? Something like a diagram: " Microcontroller <-> TX/RX <-> UART <-> USB Connection <-> LaunchPad HW <->TX/RX <-> PC HW <-> USB Controller (PC Side) <-> USB stack (PC side) <-> Serial Driver(PC side) <-> App that gets COM ports" Thank you in advance.
  6. Hello. I don't know if this topic fits on this forum session, but I'd like to know if some of you have any suggestion to me. Let me explain: I'm programing on a MSP430g2553 a device that can count the numbers of minutes that a driver is parked on a public parking spot. Each minute is a charge. This charge the user can buy from a website and then, connecting the device via USB to computer, I need somehow to pass the information from the website( how many charges the user bought ) to MSP430G2553. I already programmed on the microcontroller the USART communication needed. All I need now are some ideias: How can I pass the information from the website to the microcontroler via USB? I already did some researchs and I cant find a way to communicate direct from a website to the USB ports due to the security (some consider that it's not a good idea that website can access USB ports). So I was thinking about developing an application that can communicate with USB and also can access the website and get the information needed to that user. This application could be in C#, C++, C, java, VBA or anything else. But since I never used any of these languages on a PC application, I don't know if it's possbile to access the website from the application and then finally send this info via USB to msp430g2553. Does anyone already developed something similar? Sorry if I wasn't very clear. Thank you in advance.
  7. Yes, I know I won't read from the Oled display. I was just curious hehe. That's tricky. I tried to use the slave adress 11110000 as a write adress one time, because I read on the Family User guide it was 7bit adress. But it was on the other way around. That anwser my question. Thank you so much. The oled display is working fine so far.
  8. And if I let the SA0 pin on HIGH logic. What would be the Read and Write addresses?
  9. Hello. 1)Yes, I noticed it yesterday. The first time I read the US2066 datasheet I thought that BS[2:0] automatically was set when I grounded the D[7:3] pins.But I saw yesterday that BS was little pins on the device's backside soldered with 0Ohms resistor smd. So I needed to solder in a way that BS[2:0] become '010'. After it, I tried the I2C communication and I Still didn't get the ACK signal. 2)Its 3.3V logic 3)All pulled low 4)D2 and D1 are tied toghether 5)Yeah, I pulled with 4.7kOhms resistors 6)SA0 is tied low. 7)There where you saved me. I was writing with 0x78. Today, before I come to work, I tried with the 0x3C adress and I think it worked!!!. Thank you so much, not getting an ACK signal for 2 weeks was driving me crazy. But I still don't understand one thing: If it is a 7 bit slave adress, where do I set the Read or Write command, if someday I need to read? In this case, for example, if I need to read, my adress will be 0x3C again , or somehow it's gonna be 0x3D? Thank you again.
  10. Yes. Any other jumpers that I need to change?
  11. Hello, I'm new here, and I'm trying to establish an I2C communication to my OLED Display , with the US2066 IC (http://www.buy-display.com/download/ic/US2066.pdf). I've searched in this forum for some help on the I2C USCIB0 Communication and I used as a base the code from this topic: http://forum.43oh.com/topic/3216-need-help-with-i2c-using-msp430g2553/?hl=g2553#entry31766 This is my code right now: #include "msp430g2553.h" static int Num_bytes_tx = 0; static int Byte_count; static char BuffOutput[70]; static char Slv_add; static int RPT_flag = 0; static unsigned char TxByteCtr; void I2CEndTx(unsigned char prescale){ TxByteCtr = Num_bytes_tx; _DINT(); while (UCB0CTL1 & UCTXSTP); UCB0CTL1 |= UCSWRST; // 1- USCI Enable, 0- Release state. P1SEL |= BIT6 + BIT7; // Assign I2C pins to USCI_B0 P1SEL2|= BIT6 + BIT7; // Assign I2C pins to USCI_B0 UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // Setting Master mode, synchronous mode UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset UCB0BR0 = prescale; // fSCL = SMCLK/12 = ~100kHz UCB0BR1 = 0; UCB0I2CSA = Slv_add; // Set slave address (write OLED) UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation IE2 |= UCB0TXIE; // Enable TX interrupt while(UCB0CTL1 & UCTXSTP); UCB0CTL1 |= UCTR + UCTXSTT; } void I2CWrite(char info){ BuffOutput[Num_bytes_tx]=info; Num_bytes_tx++; } void I2CBeginTx(char add){ Slv_add = add; Num_bytes_tx =0; Byte_count=0; } void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer BCSCTL1 = CALBC1_8MHZ; DCOCTL = CALDCO_8MHZ; P1DIR |= BIT4; //Reset PIN P1SEL &= ~BIT4; P1SEL2 &= ~BIT4; P1OUT |= BIT4; __delay_cycles(200); P1OUT &= ~BIT4; __delay_cycles(200); P1OUT |= BIT4; __delay_cycles(200); I2CBeginTx(0x78);//Slave adress+Write I2CWrite(0x80); I2CWrite(0x2A); I2CWrite(0x80); I2CWrite(0x71); I2CWrite(0xC0); I2CWrite(0x00); I2CWrite(0x80); I2CWrite(0x28); I2CWrite(0x80); I2CWrite(0x08); I2CWrite(0x80); I2CWrite(0x2A); I2CWrite(0x80); I2CWrite(0x79); I2CWrite(0x80); I2CWrite(0xD5); I2CWrite(0x80); I2CWrite(0x70); I2CWrite(0x80); I2CWrite(0x78); I2CWrite(0x80); I2CWrite(0x08); I2CWrite(0x80); I2CWrite(0x06); I2CWrite(0x80); I2CWrite(0x72); I2CWrite(0xC0); I2CWrite(0x01); I2CWrite(0x80); I2CWrite(0x2A); I2CWrite(0x80); I2CWrite(0x79); I2CWrite(0x80); I2CWrite(0xDA); I2CWrite(0x80); I2CWrite(0x10); I2CWrite(0x80); I2CWrite(0xDC); I2CWrite(0x80); I2CWrite(0x00); I2CWrite(0x80); I2CWrite(0x81); I2CWrite(0x80); I2CWrite(0x8F); I2CWrite(0x80); I2CWrite(0xD9); I2CWrite(0x80); I2CWrite(0xF1); I2CWrite(0x80); I2CWrite(0xDB); I2CWrite(0x80); I2CWrite(0x30); I2CWrite(0x80); I2CWrite(0x78); I2CWrite(0x80); I2CWrite(0x28); I2CWrite(0x80); I2CWrite(0x01); I2CWrite(0x80); I2CWrite(0x80); //__delay_cycles(1000); I2CWrite(0x80); I2CWrite(0x0C); I2CEndTx(0x28); //manda o prescale e slv_add __bis_SR_register(CPUOFF + GIE); while(1){} } #pragma vector = USCIAB0TX_VECTOR __interrupt void USCIAB0TX_ISR(void) { if (UCB0STAT & UCNACKIFG) { // send STOP if slave sends NACK UCB0CTL1 |= UCTXSTP; UCB0STAT &= ~UCNACKIFG; } else{ if(TxByteCtr){ UCB0TXBUF = BuffOutput[Byte_count]; Byte_count++; TxByteCtr--; // __bic_SR_register_on_exit(CPUOFF); } else { if(RPT_flag == 1) { RPT_flag = 0; TxByteCtr = Num_bytes_tx; __bic_SR_register_on_exit(CPUOFF); } UCB0CTL1 |= UCTXSTP; // I2C stop condition IFG2 &= ~UCB0TXIFG; // Clear USCI_B0 TX intterupt flag __bic_SR_register_on_exit(CPUOFF); // Exit LPM0 } } } I don't have an osciloscope or any type of Logic Analyzer. But I can see on the register that the NACK Flag is being setting, and only one byte is shifted to UCB0TXBUF. After it, the program just stops on my while(1) and never interrupts again. On this code I'm just trying to initialize the Oled Display. I've cheked the hardware thousands times, and it seems ok. Can anybody give me an opinion on what to do? What could be wrong? Thanks for the attention.