<< Chapter < Page Chapter >> Page >
Using the MSP-EXP430FG4618 Development Tool establish a connection between two MSP430's via the I2C bus. The master receives one byte from the slave. This is the master code. It receives a single byte as soon as a button connected on P1.0 was pressed.

Laboratory communications: lab3 - echo test using i2c

Introduction

The MSP430 contains built-in features for both parallel and serial data communication. This chapter describes the operation of these peripherals, and discusses the protocols, data formats and specific techniques for each type of data communication.

The communication modules available for the MSP430 family of microcontrollers are USART (Universal Synchronous/Asynchronous Receiver/Transmitter), USCI (Universal Serial Communication Interface) and USI (Universal Serial Interface). These provide asynchronous data transmission between the MSP430 and other peripheral devices when configured in UART mode. They also support data transmission synchronized to a clock signal through a serial I/O port in Serial Peripheral Interface (SPI) and Inter Integrated Circuit (I2C) modes.

Overview

This laboratory explores the USCI and USI communication interfaces in I 2 C mode. It uses the two MSP430 devices included on the Experimenter’s board: MSP430FG4618 as the master and the MSP430F2013 as the slave. The master receives a single byte from the slave as soon as a button connected to P1.0 is pressed.

Resources

This laboratory uses the USCI module of the MSP430FG4618 device and the USI module included in the MSP430F2013. Both units operate in I2C mode.

The interrupts on the slave unit are generated exclusively by the USI module. They are:

- START condition in the I2C bus;

- Data reception and transmission.

The interrupts on the master unit are provided by the USCI module. They are:

- Data reception;

- Interrupt on Port1.

The resources used are:

- USCI module;

- USI module;

- Interrupts;

- I/O ports.

Software application organization

The software architecture for this laboratory is shown in Figure 1.

The master task is composed of two interrupt service routines ( Lab3_Comm_1.c ):

- S1 switch service routine used to receive a new frame from the slave;

- USCI module interrupt service routine that reads the data sent by the slave.

Software architecture

For the operational capability of the slave unit based on the USI module, it is necessary to implement a state machine as shown in Figure 2. It is important to note that the states “RX Address” and “RX (N)ACK" are transient states that ensure the USI module is prepared for the next activity.

Slave state machine.

System configuration

Usci_b (master) control registers configuration

The connection via I 2 C bus will operate in the following mode:

- Address slave with 7-bit address;

- Master mode;

- Single master;

- USCI clock source is SMCLK;

The following control registers are configured based on these characteristics:

UCB0CTL0 = 0x0F; //UCB0CTL0 = UCA10 | UCSLA10 | UCMM | Unused | UCMST | UCMODEx | UCSYNC//UCA10 (Own address) = 0b ->Own address (7-bit) //UCSLA10 (Slave address) = 0b ->7-bit slave address //UCMM (Multi-master) = 0b ->Single master //Unused//UCMST (Master mode) = 1b ->Master mode //UCMODEx (USCI mode) = 11b ->I2C Mode //UCSYNC (Synchronous mode enable) = 1b ->SynchronousUCB0CTL1 = 0x81;//UCB0CTL1 = UCSSELx | Unused | UCTR | UCTXNACK | UCTXSTP | UCTXSTT | UCSWRST//UCSSELx (USCI clock source select) = 10b ->SMCLK //Unused//UCTR (Transmitter/Receiver) = 0b ->Receiver //UCTXNACK (Transmit a NACK) = 0b ->ACK normally //UCTXSTP (Transmit STOP condition) = 0b ->No STOP //UCTXSTT (Transmit START condition) = 0b ->No START //UCSWRST (Software reset) = 1b ->Enabled

Questions & Answers

how does Neisseria cause meningitis
Nyibol Reply
what is microbiologist
Muhammad Reply
what is errata
Muhammad
is the branch of biology that deals with the study of microorganisms.
Ntefuni Reply
What is microbiology
Mercy Reply
studies of microbes
Louisiaste
when we takee the specimen which lumbar,spin,
Ziyad Reply
How bacteria create energy to survive?
Muhamad Reply
Bacteria doesn't produce energy they are dependent upon their substrate in case of lack of nutrients they are able to make spores which helps them to sustain in harsh environments
_Adnan
But not all bacteria make spores, l mean Eukaryotic cells have Mitochondria which acts as powerhouse for them, since bacteria don't have it, what is the substitution for it?
Muhamad
they make spores
Louisiaste
what is sporadic nd endemic, epidemic
Aminu Reply
the significance of food webs for disease transmission
Abreham
food webs brings about an infection as an individual depends on number of diseased foods or carriers dully.
Mark
explain assimilatory nitrate reduction
Esinniobiwa Reply
Assimilatory nitrate reduction is a process that occurs in some microorganisms, such as bacteria and archaea, in which nitrate (NO3-) is reduced to nitrite (NO2-), and then further reduced to ammonia (NH3).
Elkana
This process is called assimilatory nitrate reduction because the nitrogen that is produced is incorporated in the cells of microorganisms where it can be used in the synthesis of amino acids and other nitrogen products
Elkana
Examples of thermophilic organisms
Shu Reply
Give Examples of thermophilic organisms
Shu
advantages of normal Flora to the host
Micheal Reply
Prevent foreign microbes to the host
Abubakar
they provide healthier benefits to their hosts
ayesha
They are friends to host only when Host immune system is strong and become enemies when the host immune system is weakened . very bad relationship!
Mark
what is cell
faisal Reply
cell is the smallest unit of life
Fauziya
cell is the smallest unit of life
Akanni
ok
Innocent
cell is the structural and functional unit of life
Hasan
is the fundamental units of Life
Musa
what are emergency diseases
Micheal Reply
There are nothing like emergency disease but there are some common medical emergency which can occur simultaneously like Bleeding,heart attack,Breathing difficulties,severe pain heart stock.Hope you will get my point .Have a nice day ❣️
_Adnan
define infection ,prevention and control
Innocent
I think infection prevention and control is the avoidance of all things we do that gives out break of infections and promotion of health practices that promote life
Lubega
Heyy Lubega hussein where are u from?
_Adnan
en français
Adama
which site have a normal flora
ESTHER Reply
Many sites of the body have it Skin Nasal cavity Oral cavity Gastro intestinal tract
Safaa
skin
Asiina
skin,Oral,Nasal,GIt
Sadik
How can Commensal can Bacteria change into pathogen?
Sadik
How can Commensal Bacteria change into pathogen?
Sadik
all
Tesfaye
by fussion
Asiina
what are the advantages of normal Flora to the host
Micheal
what are the ways of control and prevention of nosocomial infection in the hospital
Micheal
what is inflammation
Shelly Reply
part of a tissue or an organ being wounded or bruised.
Wilfred
what term is used to name and classify microorganisms?
Micheal Reply
Binomial nomenclature
adeolu
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials. OpenStax CNX. May 19, 2009 Download for free at http://cnx.org/content/col10706/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials' conversation and receive update notifications?

Ask