Content originally posted in LPCWare by Kaare on Thu Aug 30 15:24:30 MST 2012
Hi
I am trying to hook up two LPCXpresso boards for a simple I2C test.
Step 1 is to make a Master and a Slave, and let Master write/read some data from the slave.
There are complete examples for this on the LPCXpresso site.
They compile fine, but it does not work.
When debugging, I see that I never get a single interrupt.
Interrupt seems to be OK enabled.
What seems strange though, is when I enable the I2C:
[SIZE=2][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f][SIZE=2]
LPC_I2C->CONSET = I2CONSET_I2EN;
[SIZE=3][COLOR=black]Then the bit for enable is set in both I2C0CONSET and -CLR registers.[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]The same thing happens when i will make a START:[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][/COLOR][/SIZE]
LPC_I2C->CONSET = I2CONSET_STA;
[SIZE=3][COLOR=black]Then both the enable and clear bit in both registers are set.[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]Why is this happening?[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]Then it is both set and cleared at the same time... not good I think.[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]Who wins the: the CLR or the SET?[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]Does anyone have a clue if this is good or bad?[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]I am using the examples as-is, in LPCXpresso IDE.[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]LPC1343 as Master board.[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]Thanks in advance[/COLOR][/SIZE]
[SIZE=3][COLOR=#000000]Kåre[/COLOR][/SIZE][/SIZE][SIZE=2][/SIZE]
[SIZE=2][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f][/COLOR][/SIZE][/COLOR][/SIZE]