Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TWI slave Example for evk1101 Documentation

Introduction

This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the TWI driver slave mode example.

The given example uses one evaluation kit for TWI master (EVK1100, EVK1101 or STK1000 to program with MASTER_EXAMPLE) and another one for TWI slave (EVK1100 or EVK1101).
The TWI slave initializes the TWI as slave and registers its receive and transmit callbacks. It displays on USART1 a status message upon initialization.

Validation Procedure

  • Connect a UART monitor on the UART_1 of the board with TWI master
  • Connect the TWI master with TWI slave (VCC=VCC,SDA=SDA,SCL=SCL,GND=GND)
  • Compile a master and a slave firmware with same configuration (addr mode,speed)
  • Program the master and slave boards
  • RESET Slave board (=reset TWI memory)
  • Release RESET on MASTER board
  • on UART, you see all tests PASS
  • Release RESET on MASTER board
  • on UART, you see always all tests PASS.

Main Files

Compilation Info

This software is written for GNU GCC for AVR32 and for IAR Embedded Workbench for Atmel AVR32. Other compilers may or may not work.

You can change the following defines but you should make sure that there are the same on the TWI master side for the tests to pass:

Device Info

All AVR32 devices with a TWI module can be used.

Configuration Information

This example has been tested with the following configuration:

  • EVK1100 or EVK1101 evaluation kit;
  • CPU clock: 12 MHz;
  • USART1 connected to a PC serial port via a standard RS232 DB9 cable;
  • PC terminal settings:
    • 57600 bps,
    • 8 data bits,
    • no parity bit,
    • 1 stop bit,
    • no flow control.

Contact Information

For further information, visit Atmel AVR32.