Jump to content
43oh

unknowsman

Members
  • Content Count

    3
  • Joined

  • Last visited

Reputation Activity

  1. Thanks
    unknowsman reacted to NurseBob in i2C Slave not working on MSP430FR5969   
    What i2c device are you connecting? What does is do? What's the device address? (per device specs) Is it really 2?
    Are you using pullups? I2c requires some type of pullup, and in general, the internal resistors on the '430 devices are not an appropriate value, so external are usually used.
    Note: by default, i2c comms are on LP pins 9 (SCL) and 10 (SDA)  not 15 &&16 - P1.6 and P1.7, Energia defaults to spi on those pins.
  2. Thanks
    unknowsman reacted to energia in i2C Slave not working on MSP430FR5969   
    There is a bug for slave mode which has already been fixed in the git repo. You can work-around it with the following.
    If you have the latest Energia release installed (1.8.7E21), then edit the file:
    Linux: <Energia directory>hardware/energia/msp430/libraries/Wire/utility/twi.c
    Windows: <Energia directory>hardware\energia\msp430\libraries\Wire\utility\twi.c
    macOS: <Energia.app directory>/Contents/Java/hardware/energia/msp430/libraries/Wire/utility/twi.c
    Got to line 1183 and replace:
    1183                 } else if (twi_state == TWI_MRX) {      // Master receive mode 1184                         // copy data to output register 1185                         UCBzTXBUF = twi_txBuffer[twi_txBufferIndex++]; by this: 1183                 } else if (twi_state == TWI_STX) {      // Slave transmit mode 1184                         // copy data to output register 1185                         UCBzTXBUF = twi_txBuffer[twi_txBufferIndex++];  
  3. Thanks
    unknowsman reacted to energia in i2C Slave not working on MSP430FR5969   
    p.s. you should use the first Sketch you posted. Also make sure that the master is setup to talk to the right address you specify in the Wire.begin(addr) call.
×
×
  • Create New...