Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/04/08 15:08
Read: times


 
#155497 - Actually that was a good place to start but...
Responding to: ???'s previous message
They are 3 hours behind me and won't be open til much later. I did find their master and slave examples and found out that the header file for the LPC924 does not have the needed data in it to set the bits for the I2CON control register.

So the code generator is using the correct generation, but the default header file for Keil is incomplete. I fixed it by following the model and reapplying it to my 924 and blamo.....back in business.

So I guess a thank is in order......thanks!

For everyone else, add this to your header file for I2C protocol and it will fix the problem in C with Keil



/*  I2CON  */
sbit NC1     = I2CON^7;	 //RESERVED
sbit I2EN    = I2CON^6;	 //I2C enable
sbit STA     = I2CON^5;	 //Start Bit
sbit STO     = I2CON^4;	 //Stop Bit
sbit SI      = I2CON^3;	 //Interrupt flag
sbit AA      = I2CON^2;	 //Assert Acknowledge Flag
sbit NC2     = I2CON^1;	 //RESERVED
sbit CRSEL   = I2CON^0;	 //SCL clock select


List of 6 messages in thread
TopicAuthorDate
Interesting new LPC924 code problem            01/01/70 00:00      
   Additional note            01/01/70 00:00      
      check reg924.h file            01/01/70 00:00      
   Go to the horse's mouth?            01/01/70 00:00      
      Actually that was a good place to start but...            01/01/70 00:00      
   the fact is ....            01/01/70 00:00      

Back to Subject List