Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TWIM PDCA Example
Purpose

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

Requirements

The program needs a TWI-compatible EEPROM connected with the TWIM module. See the connection below:

  • Board – EEPROM
  • TWIMS1 TWD(J4 PIN1) – SDA
  • TWIMS1 TWCK(J4 PIN2) – SCL
  • VCC – VCC
  • GND – GND

    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 in the end.

    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 PDCA Example --
      -- xxxxxx-xx
      -- Compiled: xxx xx xxxx xx:xx:xx --