Jump to content
43oh

mph

Members
  • Content Count

    20
  • Joined

  • Last visited

  • Days Won

    7

Reputation Activity

  1. Like
    mph got a reaction from BlackAngel in Multiple timers   
    Implementing multiple timers simultaneously can be tricky and I was unable to find any good examples in TI's Resource Explorer. Using the MSP430FR5969 Launchpad, this code generates a sequence of multi-tone square waves to drive an external piezo-buzzer. The audio frequency is set by TA1 and waveform duration controlled by TA0. Written in C to illustrate the bit-wise register operations:
    https://github.com/microphonon/Piezo_Buzzer
  2. Like
    mph reacted to NurseBob in MSP430FR2433 SleepSeconds 18ua   
    Have you looked at what's happening "under the hood" with CCS or similar? All things considered, I find it amazing that the current is as low as it is.  Energia is a great place to start and experiment, but it's not intended to replace coding that is far closer to the metal, er, silicon. Given it's heritage as a msp430 version of the Arduino, it's a very impressive piece of work.  But, to manage the supporting classes, and the ever-present loop, it is constrained if your're looking for ultra-low power apps.  You have already demonstrated that differential with your driverlib version.
  3. Thanks
    mph reacted to Clavier in Implementing an I2C slave device.   
    Clavier's Short Guide to I²C Slaves on the MSP430x2xx Family
    Read section 17.3.4.1 of the User's Guide, and the example code.
    Slave mode is somewhat easier than master mode because you do not have to care about getting the transaction sequence correct; you just react to the master's requests.
    The slave address is an arbitrary but unique 7-bit number. Just put it into the I2COA ("own address") register; the USCI module will automatically handle transactions to this address.
    You do not need to configure a clock source; the clock signal is supplied by the master.
    When the master has written a byte, you get an RXIFG interrupt. Your interrupt handler must read that byte from RXBUF. (You can set the TXNACK bit after reading RXBUF, this will tell the master to stop after the following byte.)
    When the master wants to read a byte, you get a TXIFG interrupt. Your interrupt handler must write a byte to TXBUF.
    If your code is slow, the USCI module will automatically stop the bus via clock stretching until you have reacted.
    You can get notifications when start and stop conditions happen (STTIFG and STPIFG), but that is not always necessary.
    The I²C protocol itself defines only byte reads and writes. If you have registers, you have to handle the register address yourself. Typically, the first write after a start condition is the register address, and all following writes (and all reads) are from/to the specified register (and often the register address automatically increments).
    As a slave, you have no control over what the master does; you must react to any write and read requests at any time. (If you really have nothing to read, just send the last byte again, or some garbage byte.)
  4. Like
    mph reacted to terjeio in RFC: CNC BoosterPack   
    Driver code for a few boards is available from my github account. A PCB design with reduced size allows two boards to be mounted to the EK-TM4C1294XL LaunchPad providing up to 6 axes of control (needs to be verified). I have also added TCP streaming to the EK-TM4C1294XL LaunchPad but usure if I can publish the code due to the "viral" clause in many of TIs files - even the startup code 🙁. Grbl is released under GPL and I have a hard time understanding the legalese related to that...
    I am currently working on a DRO/MPG for my lathe with Grbl running on a MSP432, and the DRO/MPG code on a Tiva C/MSP430 combo. Threading support is a part of that work and hopefully I'll be able to get it working reliably - looks promising this far.

     
  5. Like
    mph got a reaction from dubnet in Bosch Sensortech BME280   
    The Bosch BME280 pressure-temperature-humidity sensor is very popular for projects because there are breakout boards available from Adafruit and Sparkfun as well as a large library of code to interface it to Arduino MCUs. Not so much for the MSP430, especially transparent code to understand what is happening at the register level. I have written and tested some demo C-code that hopefully fills that gap. It sacrifices generality and efficiency for compactness and transparency.
    I use the F5529 Launchpad and communication with the sensor is via SPI using the UCB0 module.  I2C is also available for the BME280 but not implemented here. Temperature and relative humidity (no pressure) data is obtained using the forced mode with periodic polling by the MSP430.  Sensor and MCU are in low-power sleep modes when not active. Data is streamed to a terminal program that is interfaced to the Launchpad via serial UART. Each BME280 has unique trimming parameters that must be retrieved and properly parsed to convert the raw data. This process is quite complicated, so separate functions were developed to handle them and placed in an include library.  
     
    My IDE is CCS 6.1.3 with nofloat printf support. This code should work directly in the MSP430x5xx and MSP430x6xx families. Other MSP430 series such as FR and value-line will need to make appropriate module/register modifications.  Link to github is here:
    https://github.com/microphonon/BME280
  6. Like
    mph got a reaction from zeke in Bosch Sensortech BME280   
    The Bosch BME280 pressure-temperature-humidity sensor is very popular for projects because there are breakout boards available from Adafruit and Sparkfun as well as a large library of code to interface it to Arduino MCUs. Not so much for the MSP430, especially transparent code to understand what is happening at the register level. I have written and tested some demo C-code that hopefully fills that gap. It sacrifices generality and efficiency for compactness and transparency.
    I use the F5529 Launchpad and communication with the sensor is via SPI using the UCB0 module.  I2C is also available for the BME280 but not implemented here. Temperature and relative humidity (no pressure) data is obtained using the forced mode with periodic polling by the MSP430.  Sensor and MCU are in low-power sleep modes when not active. Data is streamed to a terminal program that is interfaced to the Launchpad via serial UART. Each BME280 has unique trimming parameters that must be retrieved and properly parsed to convert the raw data. This process is quite complicated, so separate functions were developed to handle them and placed in an include library.  
     
    My IDE is CCS 6.1.3 with nofloat printf support. This code should work directly in the MSP430x5xx and MSP430x6xx families. Other MSP430 series such as FR and value-line will need to make appropriate module/register modifications.  Link to github is here:
    https://github.com/microphonon/BME280
  7. Thanks
    mph got a reaction from Fmilburn in Bosch Sensortech BME280   
    The Bosch BME280 pressure-temperature-humidity sensor is very popular for projects because there are breakout boards available from Adafruit and Sparkfun as well as a large library of code to interface it to Arduino MCUs. Not so much for the MSP430, especially transparent code to understand what is happening at the register level. I have written and tested some demo C-code that hopefully fills that gap. It sacrifices generality and efficiency for compactness and transparency.
    I use the F5529 Launchpad and communication with the sensor is via SPI using the UCB0 module.  I2C is also available for the BME280 but not implemented here. Temperature and relative humidity (no pressure) data is obtained using the forced mode with periodic polling by the MSP430.  Sensor and MCU are in low-power sleep modes when not active. Data is streamed to a terminal program that is interfaced to the Launchpad via serial UART. Each BME280 has unique trimming parameters that must be retrieved and properly parsed to convert the raw data. This process is quite complicated, so separate functions were developed to handle them and placed in an include library.  
     
    My IDE is CCS 6.1.3 with nofloat printf support. This code should work directly in the MSP430x5xx and MSP430x6xx families. Other MSP430 series such as FR and value-line will need to make appropriate module/register modifications.  Link to github is here:
    https://github.com/microphonon/BME280
  8. Thanks
    mph reacted to Fmilburn in TI HDC2010 temp-humidity sensor   
    Hi @mph
    It is good to see someone new contributing code.  Nicely written and commented.
  9. Like
    mph got a reaction from dubnet in TI HDC2010 temp-humidity sensor   
    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).
     

  10. Thanks
    mph got a reaction from Fmilburn in TI HDC2010 temp-humidity sensor   
    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).
     

  11. Like
    mph got a reaction from Rei Vilo in TI HDC2010 temp-humidity sensor   
    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).
     

  12. Like
    mph got a reaction from zeke in Sensirion SHTC3 temperature-humidity sensor   
    Sensirion has recently introduced an inexpensive, low-power temperature humidity sensor SHTC3 designed for operation in the range 1.62--3.6V .  It should be a useful peripheral for MSP430 battery-powered applications.  I have tested 3 sensors with the F5529 Launchpad and they exhibit reliable, consistent behavior.  For reference, I have written some demo code for I2C communication that is available on github:
    https://github.com/microphonon/SHTC3
    The SHTC3 comes in a small DFN package, so to do breadboard testing I had to build my own breakout boards and use reflow soldering (see photo).

  13. Thanks
    mph got a reaction from Fmilburn in Sensirion SHTC3 temperature-humidity sensor   
    Sensirion has recently introduced an inexpensive, low-power temperature humidity sensor SHTC3 designed for operation in the range 1.62--3.6V .  It should be a useful peripheral for MSP430 battery-powered applications.  I have tested 3 sensors with the F5529 Launchpad and they exhibit reliable, consistent behavior.  For reference, I have written some demo code for I2C communication that is available on github:
    https://github.com/microphonon/SHTC3
    The SHTC3 comes in a small DFN package, so to do breadboard testing I had to build my own breakout boards and use reflow soldering (see photo).

  14. Like
    mph got a reaction from dubnet in Sensirion SHTC3 temperature-humidity sensor   
    Sensirion has recently introduced an inexpensive, low-power temperature humidity sensor SHTC3 designed for operation in the range 1.62--3.6V .  It should be a useful peripheral for MSP430 battery-powered applications.  I have tested 3 sensors with the F5529 Launchpad and they exhibit reliable, consistent behavior.  For reference, I have written some demo code for I2C communication that is available on github:
    https://github.com/microphonon/SHTC3
    The SHTC3 comes in a small DFN package, so to do breadboard testing I had to build my own breakout boards and use reflow soldering (see photo).

  15. Like
    mph got a reaction from bluehash in Sensirion SHTC3 temperature-humidity sensor   
    Sensirion has recently introduced an inexpensive, low-power temperature humidity sensor SHTC3 designed for operation in the range 1.62--3.6V .  It should be a useful peripheral for MSP430 battery-powered applications.  I have tested 3 sensors with the F5529 Launchpad and they exhibit reliable, consistent behavior.  For reference, I have written some demo code for I2C communication that is available on github:
    https://github.com/microphonon/SHTC3
    The SHTC3 comes in a small DFN package, so to do breadboard testing I had to build my own breakout boards and use reflow soldering (see photo).

×
×
  • Create New...