>> I am trying to use the hardware I2C in the LPC1751 on the Pro Plus. This code compiles but will not execute.
>>
>> #include <LPC17xx.bas>
>> print I2C2STAT
>>
>> whereas this code will execute.
>>
>> #include <LPC17xx.bas>
>> print FIO2DIR
>>
>> I am using BASICTools. Any ideas about what I am doing wrong?
I had replied there are only 2 active I2Cs, but that does include I2C1 and I2C2.
Back to the user manual, Chapter 19 Basic Configuration for I2C
1. Power: In the PCONP register (Table 46), set bit PCI2C0/1/2.
Remark: On reset, all I2C interfaces are enabled (PCI2C0/1/2 = 1).
While this is true our initialization code does turn off many unused interfaces to save power. I suspect this is the case for the i2c 's. So a quick check of that --
Code: Select all
#include <LPC17xx.bas>
print hex(SCB_PCONP)
Executing...
3c0825e