basic-twi-eeprom-project
Default mainpagebasic-twi-eeprom-project
Description Graph
basic-twi-eeprom-project
 
Purpose
This example program demonstrates how to use the TWI peripheral of an AT91 microcontroller to access an external serial EEPROM chip.

See

Requirements
An external serial EEPROM must be connected to the TWI bus of the microcontroller. For further information on this topic, please refer to the following application note: Using the Two-wire interface (TWI) in Master Mode on AT91 Microcontrollers.

Pay particular attention to the fact that on some boards, such as the AT91SAM7S-EK, there is no pull-up on the TWI bus: they must be added externally.

Description
This software performs simple tests on the first and second page of the EEPROM:
Usage
  1. Compile the application.
  2. Connect the DBGU port of the evaluation board to the computer and open it in a terminal.
    • Settings: 115200 bauds, 8 bits, 1 stop bit, no parity, no flow control.
  3. Download the program inside the evaluation board and run it. Please refer to the SAM-BA User Guide, the GNU-Based Software Development application note or to the IAR EWARM User Guide, depending on your chosen solution.
  4. Upon startup, the application will output the following line on the DBGU:
    -- Basic TWI EEPROM Project xxx --
    -- AT91xxxxxx-xx
    -- Compiled: xxx xx xxxx xx:xx:xx --
    
  5. The following traces detail operations on the EEPROM, displaying success or error messages depending on the results of the commands.
 
Source
The documentation for this Directory was generated from the following files:
  • main.c