Jump to content
43oh

on3pk

Members
  • Content Count

    35
  • Joined

  • Last visited

Reputation Activity

  1. Like
    on3pk reacted to chicken in I2C issues   
    Finally home and checked the impact of removing begin/endTransmission from requestFrom/read. Unfortunately I observe the same behavior.
     
    Wire.requestFrom(BMP085_I2C_ADDR, 2); uint8_t id = Wire.read(); uint8_t ver = Wire.read(); works, but
    Wire.requestFrom(BMP085_I2C_ADDR, 1); uint8_t id = Wire.read(); hangs at next time I2C is accessed.
     
    Looking at the pins with an oscilloscope shows that
    - reading 2 bytes properly completes with SDA and SCL high
    - reading 1 byte keeps SDA low and continues driving SCL, until power is cycled
     
    The full non-working example code:
    void setup() {   Wire.begin();   Serial.begin(9600);   Serial.println("start"); }   void loop() {   Serial.println("beginTransmission");   Wire.beginTransmission(BMP085_I2C_ADDR);   Serial.println("write");   Wire.write(byte(0xd0));   Serial.println("endTransmission");   Wire.endTransmission();     Serial.println("requestFrom");     Wire.requestFrom(BMP085_I2C_ADDR, 1);   Serial.println("read");     uint8_t id = Wire.read(); //  uint8_t ver = Wire.read();   Serial.print("chip id: ");   Serial.println(id);     delay(1000); } Un-commenting the second read and changing requestFrom to read 2 bytes makes the problem go away.
     
    Inserting the following code at line 269 of twi.c solves the 1-byte problem for me:
        if(length == 1) {                   // Special treatment when receiving one by         while(UCB0CTL1 & UCTXSTT);      // Wait for start bit to clear         UCB0CTL1 |= UCTXSTP;            // I2C stop condition to be sent after recv     } As mentioned up-thread, this is based on the USCI documentation, MSP430x2xxx family guide, page 473.
     
    What's the preferred method to submit/contribute this fix to the Energia project? - edit: submitted pull request to Energia on github
  2. Like
    on3pk got a reaction from GeekDoc in Useful chips   
    When I did my first big 'buy' of components.  I got all the basic stuff: gates (or, and, nand, nor, etc), capacitors, resistors, shift registers, etc...  The accessories (servos and whatnot) I've just gotten as needed.  They're not incredibly hard to get cheaply, though, you might end up waiting for them.
     
    One component I've come to enjoy, though, is the CD4050BE.  Its a logic level translator that.  They're only like 50cents a pop from TaydaElectronics and they just work (which is always nice.)
     
    A few of the accesories I've purchased:
    S3003 Servo, Motors, LCD Display (Nokia 5110), TCRT5000, Accelerometer...
     
    All fun things to have...
  3. Like
    on3pk got a reaction from dubnet in Anyone had any experience with Haoyu Electronics?   
    It looks like your standard "Made in China" store front.  I always tend to believe you may not get the 'actual' MCU you ordered when dealing with suppliers like this.  Probably not a big deal if you're a hobbyist...
  4. Like
    on3pk got a reaction from GG430 in New (soon to be) valueline chip. MSP430G2955 56kb Flash 4kb Ram!   
    I think you need a Texas sized breadboard for this Texas sized unit. ;-)
  5. Like
    on3pk got a reaction from RobG in New (soon to be) valueline chip. MSP430G2955 56kb Flash 4kb Ram!   
    I think you need a Texas sized breadboard for this Texas sized unit. ;-)
×
×
  • Create New...