I2C Improvements

25 Jun 2009 . Edited: 16 Jul 2009

Hi there, i would like to propse a change to the I2C libraies which seem to be working fine in their original form.

The changes are relatively simple.

The first is the data payload for i2C transmissions is currently defined as char. I propose that these be changed to unsigned char to more accurately refelct the data type.

this will make a big difference to software that already exists that uses I2C as almost all users will have these higher level functions defined as unsigned char.

The second is the I2C should return from the function with a value that determines weather the transfer has been sucessful or not. A suceesfull return should return with Ack and a failure should return with Nack. Currently, failed packets result in the message...
i2C Start W returned incorrect status (0x20) in I2C write::Abnormal termination.

Can we have these changed for the actual release?

At hitex i have spend the past 3 days converting some RS-EDP software to run with the MBED module and the process has been very easy. consequently we have a lot of software now available to run on this platfom. This includes serial latches, digital I/O expanders, serial EEPROM, serial ADC conveters, motor drive modules, UARTs SPI etc. The RS-EDP is a processor independant platform we developed for the RS catalogue, which will now have an mbed adapter module for it.  Consequently we will have a ready to go board support platform for the mbed to plug into. The RS-EDP unit can be viewed on the RS web site, for those of you interested.

Best Regards

David Giles

 

25 Jun 2009

Hi David,

These I2C changes seem very reasonable. Just to let you know, I'm away for a couple of weeks, and when I'm back we'll be looking again at the libraries, so i'll aim to roll in this as part of that work and let you test it.

i have spend the past 3 days converting some RS-EDP software to run with the MBED module and the process has been very easy. consequently we have a lot of software now available to run on this platfom

That is great news! It would be great if you could make a cookbook page for it, and perhaps upload some photos. Quite a few people have been asking about baseboards so this may be of interest to them.

Great work on getting this all running so quickly. Please fire any more thoughts/feedback at us, especially barriers you found, and we can aim to improve the process further.

Thanks again,

Simon