microcontrollers:common_communication_types
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| microcontrollers:common_communication_types [2024/10/30 19:07] – ibchadmin | microcontrollers:common_communication_types [2024/10/30 19:21] (current) – ibchadmin | ||
|---|---|---|---|
| Line 74: | Line 74: | ||
| ===== I2C (Inter-Integrated Circuit) ===== | ===== I2C (Inter-Integrated Circuit) ===== | ||
| + | |||
| + | The I2C lives on **UCBO** on a MSP430 board. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | * SDA: Data (default pin 1.6) | ||
| + | * SCL: Clock (default pin 1.7) | ||
| + | |||
| + | Pull Low to send information. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ==== I2C Specifications ==== | ||
| + | |||
| + | * Speed: 100 kbits/ | ||
| + | * Power: Bus draws power when SDA/SCL pulled low | ||
| + | * Vcc = 3.3V, Pullups = 4.7kΩ ∴ 0.7mA*2 = 1.4mA | ||
| + | * Larger resistors → Lower current draw | ||
| + | * Distance: I2C is limited by distance and the capacitance between SDA & SCL | ||
| + | * Designed for simple communication over a short distance | ||
| + | |||
| + | ==== Arbitration ==== | ||
| + | |||
| + | Using clock stretching, the bus can be easily arbitrated: this stalls the bus by holding SCL low. This can be used to allow multiple nodes to be aware of when the bus is in use, or allow a device to stall the bus if more time is needed to handle data. | ||
| + | |||
| + | ==== Setup ==== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | * UCSWRST: Put USCI_B in reset state | ||
| + | * UCMODE_3: I2C Mode | ||
| + | * UCMST: Master Mode | ||
| + | * UCSYNC: Syncronous mode | ||
| + | * UCB0BRW: Baud rate SMCLK / 0x< | ||
| + | |||
| + | ==== Sending data ==== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ==== Reading data ==== | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | ===== References and Further Reading ===== | ||
| + | |||
| + | * http:// | ||
| + | * http:// | ||
| + | * Msp430FR5994 User’s guide http:// | ||
| + | * Evaluation of Power Efficiency for Digital Serial Interfaces of Microcontrollers | ||
microcontrollers/common_communication_types.1730315277.txt.gz · Last modified: 2024/10/30 19:07 by ibchadmin
