C Interrupt Service; The State Service Routines; Adapting State Services To An Application; Software Example - Philips LPC2101 User Manual

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
The I
call. If the general call or the own slave address is detected, an interrupt is requested and
I2STAT is loaded with the appropriate state information.
2
11.8.16 I
When the I
the 26 state services to be executed.

11.8.17 The state service routines

Each state routine is part of the I

11.8.18 Adapting state services to an application

The state service examples show the typical actions that must be performed in response
to the 26 I
associated state services can be omitted, as long as care is taken that the those states
can never occur.
In an application, it may be desirable to implement some kind of timeout during I
operations, in order to trap an inoperative bus or a lost service routine.

11.9 Software example

11.9.1 Initialization routine

Example to initialize I

11.9.2 Start Master Transmit function

Begin a Master Transmit operation by setting up the buffer, pointer, and data count, then
initiating a Start.

11.9.3 Start Master Receive function

Begin a Master Receive operation by setting up the buffer, pointer, and data count, then
initiating a Start.

User manual

2
C hardware now begins checking the I

C interrupt service

2
C interrupt is entered, I2STAT contains a status code which identifies one of
2
C state codes. If one or more of the four I
2
C Interface as a Slave and/or Master.
1. Load I2ADR with own Slave Address, enable general call recognition if needed.
2
2. Enable I
C interrupt.
3. Write 0x44 to I2CONSET to set the I2EN and AA bits, enabling Slave functions. For
Master only functions, write 0x40 to I2CONSET.
1. Initialize Master data counter.
2. Set up the Slave Address to which data will be transmitted, and add the Write bit.
3. Write 0x20 to I2CONSET to set the STA bit.
4. Set up data to be transmitted in Master Transmit buffer.
5. Initialize the Master data counter to match the length of the message being sent.
6. Exit
Rev. 01 — 12 January 2006
2
C-bus for its own slave address and general
2
C interrupt routine and handles one of the 26 states.
2
C operating modes are not used, the
UM10161
2
Chapter 11: I
C interfaces
2
C
© Koninklijke Philips Electronics N.V. 2006. All rights reserved.
149

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2103Lpc2102

Table of Contents