Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TWIM Master Example
 
\par Purpose

This application gives an example of how to use TWIM driver of SAM to
access an TWI-compatible EEPROM.

\par Requirements

The program needs a TWI-compatible EEPROM connected with the TWIM module.
See the connection below:
  • Board – EEPROM
  • TWIMS1 TWD(PB00) – SDA
  • TWIMS1 TWCK(PB01) – SCL
  • VCC – VCC
  • GND – GND

    \par Description
    
    At first, the specified TWIM write some data pattern to the EEPROM, then
    read it back and check if the written and the read match.
    
    Usage
    1. Build the program and download it into the evaluation board.
    2. Connect a serial cable to the UART port for each evaluation kit.
    3. On the computer, open and configure a terminal application (e.g., HyperTerminal on Microsoft Windows) with these settings:
      • 115200 bauds
      • 8 data bits
      • No parity
      • 1 stop bit
      • No flow control
    4. Start the application. The following traces shall appear on the terminal:
      -- TWIM Master Example --
      -- xxxxxx-xx
      -- Compiled: xxx xx xxxx xx:xx:xx --