MSP PMBus Library Users Guide
v1.00.00.00
|
This section describes the examples included with the PMBus library.
The PMBus library examples were developed and tested in the following MSP430™ families of devices:
Device | I2C Interface |
---|---|
MSP430FR59xx | Enhanced Universal Serial Communication Interface (eUSCI) |
MSP430G2xx3 | Universal Serial Communication Interface (USCI) |
MSP430 devices supported by PMBus library examples
The code examples and PMBus library can be implemented in different derivatives of the same family with little effort, and they can be migrated to other MSP430™ devices with the same I2C interface with some considerations such as pin usage, memory and timeout-timer availability.
Each example in this software package is provided with full source code and includes the necessary project files to build the project in IAR and CCS.
Each of the examples are written as PMBus master application communicating to a TPS544C20.
Name | Description |
---|---|
PMBus_Master01_TPS544C20 | Basic PMBus communication |
PMBus_Master02_TPS544C20_SMBAlert | PMBus with SMBALERT |
PMBus_Master03_TPS544C20_Control | PMBus with device on/off through CONTROL line |
PMBus library examples
The hardware setup and their funtionality are described in more detail in the following sections.
The PMBus library and examples build and run on both the IAR and CodeComposer Studio(CCS) environments for MSP430™ microcontrollers. See the Release Notes in the PMBus library package for specific IAR and CCS version information.
IAR and CCS are both available in free, code-size-limited versions (8K and 16k, respectively, of object code). Applications that require less than 8K of memory can be run on both free versions. Applications that require more than 8K of memory cannot be build using the free IAR Ickstart tool. Instead, the free version of CCS can be used, or a licensed version of either environment.
Most of the examples can run on any hardware TI sells in the eStore, supporting the devices mentioned in the Supported DevicesSupported Devices"". This includes:
Every example has a HAL layer which can be used to initialize ports, clocks and any other hardware used by the application and PMBus/SMBus layers.
The following tables list the resources used by the examples:
Description | Resource |
---|---|
I2C | eUSCI_B0 |
I2C_SDA | P1.6/USCB0SDA |
I2C_SCL | P1.7/USCB0SCL |
SMBAlert | P1.5 |
Control1 | P1.4 |
Control2 | P1.3 |
LED0 | P1.0 |
LED1 | P4.6 |
MSP430FR59xx examples
Description | Resource |
---|---|
I2C | USCI_B0 |
I2C_SDA | P1.7/USCB0SDA |
I2C_SCL | P1.6/USCB0SCL |
SMBAlert | P2.5 |
Control1 | P2.4 |
Control1 | P2.3 |
LED0 | P1.0 |
LED1 | P2.0 |
MSP430G2xx3 examples
The PMBus Library examples have the following structure:
<install> |--smbuslib <- SMBus Library source code | |--driverlib <- MSP430 driverlib used to access the microcontroller peripherals |--src <- Contains the PMBus Library source code |--examples |--MSP430* <- MSP430 device supported by examples |--CCS | |--PMB*.projectspec <-- Individual project files for CCS | |--IAR | |--PMB* | |--*.{ewd,ewp} <-- Individual project files for IAR | |--*.eww <-- Project workspace file for IAR |--Src |--PMB* |-- main.c <-- The example main code |-- Master_HAL.{h,c} <-- Hardware abstraction layer for example |-- *.{h,c} <-- Other source files used by example
Each IAR project has a workspace. To use the examples in IAR, open the corresponding workspace file (*.eww) by selecting File->Open->Workspace.
The project can be build using the F& key, Menu->Project->rebuild All, or clicking on the Make icon. Projects can be downloaded to the MSP430™ microcontroller using Ctrl+D, Menu->Project->Download, or by clicking the Download and Debug icon.
CCS project must be imported into a CCS workspace. The projects are defined by *.projectspec files, which contain the information CCS needs to import the project.
Open CCS, and choose Project->Import CCS Projects. Browse to the examples/MSP430*/CCS directory (containing the *.projectspec) files). CCS will show a list of all the projects that were discovered in this directory.
Select any projects and click "Finish". The project(s) should appear in the Project Explorer view.
The active project can be selected by simply left-clicking on the project and it will be highlighted with bold letters as shown in the following figure:
The project can be built using Ctrl+B, Menu->Project->Build All, or by clicking the Build icon. Projects can be downloaded to the MSP430™ microcontroller using F11, Menu->Run->Debug, or by by clicking the Debug icon.
This section contains information that is common to all PMBus examples. Specific information for each example is provided after this section.
The required basic connection between Master and Slave PMBus devices is shown below.
The pins used for SDA and SCL for the supported devies are described in the _Hardware Support_ section.
The value of the pull-up resistors (Rp) will depend on the system VDD and the bus capacitance. Typical values are in the range of 1K-10K ohms.
/|\ /|\ Rp Rp Master | | Slave MSP430 | | TPS544C20 ----------------- | | ------------- | SDA*|<-|----+----> |DATA | | | | | |--> VOUT | SCL*|<-+---------> |CLK | | /|\ | | | LED0 <--|Px.y* |---Pb.c*|<-------------|SMBAlert | LED1 <--|Pz.a* | | | | | | | | Control*|------------->|CNTL |
Check the comments in the source code for each example for detailed information of the example functions.
This example configures some parameters of the TPS544C20 to illustrate some basic calls of the PMBus Library.
After initializing the MSP430™ device and GPIO the example will:
This example configures the TPS544C20 and enables SMBAlert functionality. When an alert is detected by the slave device, the MSP430 reads the fault and clears the flag. If enabled, MSP430 will send an ARA packet to double-check if the TPS544C20 is the device asserting the SMBAlert line.
The example can be tested by lowering the TPS544C20's VIN.
After initializing the MSP430™ device and GPIO the example will:
This example configures the TPS544C20 using the CONTROL line. The CONTROL line turns the output ON/OFF together or independently of the OPERATION command. The signal is optional per PMBus spec but it is implemented in many PMBus devices.
After initializing the MSP430™ device and GPIO the example will: