Description: 4. I2C program design and circuit simulation LPC2138 microcontroller with a standard hardware I2C interface, you can configure master or slave, the bus clock frequency is adjustable, can support 400KHZ bus frequency. Using the I2C bus, to P0.2, P0.3 connection settings Select SCL, SDA, and the bus to pick two pull-up resistor, the resistance of 1 to 5 kilohms. Define the address of the device and the LED output port settings include the slave address, subnet address, data buffer pointer, the number of operational data, the operation marks the end of the sub-address enable control, including variables. Use PINSEL0, PINSEL1 register set I/O port mode, set the LED control port as output, other I/O as an input. The I2C initialization, set the crystal frequency, all channels for the IRQ interrupt, I2C interrupt is enabled, the write byte data write byte data, waiting period ends. Using hardware I2C read the data byte read in the initial address data, if the test data read out is not correct
To Search:
File list (Check if you may need any files):
I2C\CONFIG.H
...\HEAP.S
...\I2C.axf
...\I2C.DSN
...\I2C.hex
...\I2C.htm
...\I2C.lnp
...\I2C.map
...\I2C.Opt
...\I2C.plg
...\I2C.PWI
...\I2C.sct
...\I2C.tra
...\I2C.Uv2
...\I2C_Opt.Bak
...\I2C_Target 1.dep
...\I2C_Uv2.Bak
...\IRQ.S
...\Last Loaded I2C.DBK
...\LPC2138.H
...\main.c
...\main.crf
...\main.d
...\main.o
...\STACK.S
...\Startup.lst
...\Startup.o
...\Startup.s
...\TARGET.C
...\TARGET.H
I2C