Jump to content

Search the Community

Showing results for tags 'hdc2010'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 2 results

  1. There is code available to implement I2C communication between the MSP430 and the HDC2010 temperature-humidity sensor, but it's a bit like an onion -- you have to peel away layer after layer in various libraries to drill down into what is happening at the register level. I decided to write some transparent demo code for this sensor that is self-contained: everything related to the I2C interface is in a single C program. It has been successfully tested with the F5529 Launchpad. This is a simple MCU polling operation that periodically makes a T-H measurement using the on-demand mode of the sensor. The data is sent to the serial port for display on a terminal program. The on-board heater is activated for a few seconds upon reset. I have not implemented the temperature-humidity high/low interrupts. One could also configure the sensor to output data periodically and toggle its DRDY pin to wake-up the MCU from LPM4. Polling code is here: https://github.com/microphonon/HDC2010 The HDC2010 is a tiny sensor with a 6-bump BGA footprint. TI makes an evaluation module that uses an MSP430F5528 to interface the sensor with a configuration/graphing GUI program. Their program only runs on 64-bit Windows. The portion of the PCB hardware containing the sensor can be broken off (permanently) to reduce thermal mass and allow placement in a project. I decided to make my own breakout boards (see photo), but just learned that MikroElektronika started selling essentially the same thing for $13 (MIKROE-2937).
  2. I'm trying to connect the HDC2010 temperature sensor to the MSP430FR5969 Launchpad. I'm using the HDC2010 EVM, which consists of a MSP430F5528 (which handles USB communications to the GUI tool) and a HDC2010 (connected over I2C). The portion with the HDC2010 can be broken off from the main board in order to use it with another MCU. I'm attempting to connect it to a MSP430FR5969 Launchpad which has the SHARP Memory LCD (uses SPI) connected to it. I couldn't find a ready made library for the HDC2010 & MSP430, so I copied over some code from the Arduino library. To check whether I was using the HDC2010 correctly, I first used the following code (mostly taken from the HDC2010 lib) and used an Arduino Uno. I used MOSFET level translators (since the Arduino is 5V, HDC2010 is 3.3). I did not break off the HDC2010 section from the main board of the EVM, so the main MSP430F5528 was still connected to the HDC2010, but I guess it was idle. #define ADDR 0x40 #include <Wire.h> //Define Register Map #define TEMP_LOW 0x00 #define TEMP_HIGH 0x01 #define HUMID_LOW 0x02 #define HUMID_HIGH 0x03 #define INTERRUPT_DRDY 0x04 #define TEMP_MAX 0x05 #define HUMID_MAX 0x06 #define INTERRUPT_CONFIG 0x07 #define TEMP_OFFSET_ADJUST 0x08 #define HUM_OFFSET_ADJUST 0x09 #define TEMP_THR_L 0x0A #define TEMP_THR_H 0x0B #define HUMID_THR_L 0x0C #define HUMID_THR_H 0x0D #define CONFIG 0x0E #define MEASUREMENT_CONFIG 0x0F #define MID_L 0xFC #define MID_H 0xFD #define DEVICE_ID_L 0xFE #define DEVICE_ID_H 0xFF float temperature = 0, humidity = 0; void openReg(uint8_t reg) { Wire.beginTransmission(ADDR); // Connect to HDC2010 Wire.write(reg); // point to specified register Wire.endTransmission(); // Relinquish bus control } uint8_t readReg(uint8_t reg) { openReg(reg); uint8_t reading; // holds byte of read data Wire.requestFrom(ADDR, 1); // Request 1 byte from open register Wire.endTransmission(); // Relinquish bus control if (1 <= Wire.available()) { reading = (Wire.read()); // Read byte } return reading; } float readTemp(void) { uint8_t byte[2]; uint16_t temp; byte[0] = readReg(TEMP_LOW); byte[1] = readReg(TEMP_HIGH); temp = (unsigned int)byte[1] << 8 | byte[0]; return (float)(temp) * 165 / 65536 - 40; } void writeReg(uint8_t reg, uint8_t data) { Wire.beginTransmission(ADDR); // Open Device Wire.write(reg); // Point to register Wire.write(data); // Write data to register Wire.endTransmission(); // Relinquish bus control } void setup() { // put your setup code here, to run once: Serial.begin(9600); Wire.begin(); } void loop() { // put your main code here, to run repeatedly: Serial.println(temperature = readTemp()); //Serial.println(humidity = readHumidity()); delay(1000); } This code worked and I got temperature readings. Next, I tried it out on the MSP430FR5969, again, without breaking off the sensor from the mainboard. It didn't work at first, so I checked with a logic analyzer and if I recall correctly, either the SCK or SDA lines wasn't sending any data. However, after sometime it started working properly, and then stopped again. After trying for a couple of hours, I decided to disconnect the HDC2010 from the mainboard, in case the MSP430F5528 was causing some issues. I connected the HDC2010 to the Arduino Uno via the logic level shifter, and the code worked correctly. However, it doesn't work with the MSP430FR5969. I tried out the inbuilt Wire examples, and the logic analyzer reveals that the I2C lines don't seem to be sending data at all (they work fine as GPIO). I'm using pins 9 & 10 on a Rev2.0 launchpad. What's odd is that it worked for a little while & I cannot figure out what I'm doing wrong. This is with a 1.2k ohm pull up on the clock line (2nd row). Without the pull up, the line remains low. The first row shows SDA, but the logic is inverted for some reason, and if I use a 10k pull up, it remains high continuously. I managed to capture this when it worked correctly with the MSP430FR5969: I've read conflicting reports about the actual I2C pins on the MSP430FR5969 launchpad: are they at 9 & 10 (as the board pdf & silkscreen says), or have they been shifted to the same pins as SPI? What's the best way to debug this? Simple I2C sketches don't seem to work for some reason, but it worked correctly for a little while.
×
×
  • Create New...