Jump to content


  • Content Count

  • Joined

  • Last visited

Reputation Activity

  1. Like
    aymeric reacted to bluehash in Using MSP430G2553 on ccs   
    Did you update your CCS? What is the version you have?
  2. Like
    aymeric reacted to fj604 in I2C on msp430G   
    2252 and 2452 have a USI peripheral, 2553 has a USCI which is different. Also, transmit and receive functions will be different depending on whether the device is a master or a slave.
    In addition to transmit and receive, you nay also need functions for start, repeated start and stop.
    I wrote some code to control the MAX6956 I2C chip via USI with these functions:
  3. Like
    aymeric reacted to xpg in MSP430g2231 two interrupts   
    The I/O port on the MSP430g2231 has only a single interrupt, meaning that you only can have one handler to deal with interrupts triggered by I/O pins. However, you can use the interrupt flag register, P1IFG, to determine which pin has triggered the interrupt. Note, also, that you have to reset the corresponding bit in P1IFG in your interrupt handler.
    A quick example:

    #pragma vector=PORT1_VECTOR __interrupt void port1_Interrupt (void) { if( P1IFG & BIT0 ) { // PIN 0 triggered the interrupt // Do stuff // Reset the interrupt flag P1IFG &= ~BIT0; } if (P1IFG & BIT5) { // PIN 5 triggered the interrupt // Do stuff // Reset the interrupt flag P1IFG &= ~BIT5; } }
    There are two time interrupts on the mgsp430g2231: TIMERA0 and TIMERA1. In compare mode TIMERA0 is triggered when CCR0 is reached, while TIMERA1 is triggered when CCR1 is reached, and TAR overflows. So, in a TIMERA1 interrupt handler you will have to check TAIV to see if the interrupt was triggered by CCR1 or TAR overflow.
  • Create New...