Philips AN10369 Application Note page 12

Uart/spi/i2c code examples
Table of Contents

Advertisement

Philips Semiconductors
/* I
__irq void I
/* Master Transmitter states */
void ISR_8(void);
void ISR_18(void);
void ISR_28(void);
/*************************** MAIN ************************/
int main()
/* Send start bit */
/***************
void Initialize()
{
I2CONCLR=0x6c;
VICCNTL0= 0x29;
/* ISR address written to the respective address register*/
Application note
2
C ISR */
2
C _ISR(void);
{
/* Initialize system */
Initialize ();
2
I
C ONSET=0x60;
/* Do forever */
while(1)
{
IOCLR=0x40;
IOSET=0x40;
}
}
System Initialization ***************/
/* Remap interrupt vectors to SRAM */
MEMMAP=0x2;
/* Initialize GPIO ports to be used as indicators */
IODIR=0xF0;
IOSET=0xF0;
/* Initialize Pin Connect Block */
PINSEL0=0x50;
2
/* Initialize I
C */
/* clearing all flags */
I2CONSET=0x40;
I2SCLH=0xC;
I2SCLL=0xD;
/* Initialize VIC for I
VICINTSEL=0x0;
VICINTEN= 0x200;
VICVADDR0=(unsigned long) I2C_ISR;
Rev. 01 — 06 April 2005
Philips ARM LPC microcontroller family
2
/* enabling I
C */
/* 100 KHz */
2
C use */
/* selecting IRQ */
2
/* enabling I
C */
/* highest priority and enabled */
AN10369
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
12 of 17

Advertisement

Table of Contents
loading

Table of Contents