Philips Documentation
2005-07-06 by burtswp
I've just finished implementing i2c interrupt driven communications between two LPC2100s. (LPC2129 for Master, LPC2131 for Slave). The code was done in ImageCraft C. (IMHO the ImageCraft C is easier to work with than Gnu for the ARM. Keil, IAR, etc... are just priced too high for a very small shop.) Philips needs to spend a little more time on their documentation. I got started by using the old 80C51 Family Derivatives manual. Kind of painful since I had to translate from 8051 assembly to the LPC2100 C code. Last week I found the new LPC2138 User Manual (24 June 2005). That hurt as much as it helped. The I2C Software Example (pseudo-code) section can get you in trouble. You can use it as a guideline, but to find the actual bits to set and clear use the tables that start on page 130 of that new manual. (FYI. Those tables are identical, except for the format, to the "old" 80C51 tables.) In many ways that new LPC2138 User Manual is a big improvement over previous manuals. However, sometimes the wording isn't clear, at least to me, and the data itself hasn't been completely checked out. Maybe the wording is due to translation difficulties. I wouldn't be surprised to find that tranlating to English is difficult. Too many ways to say, almost, the same thing. Anyway. Once you get the i2c to work, it's rock solid. Right now I'm pushing it to a 1.6MHz data rate with no problems even though the docs say 400KHz. Bottom line: Be prepared to do some experimentation to verify what you see in the docs. Burt Mitchell