Hi List I have a I/O expander that is I2C based that controls some chip select pins for a SPI network I also have a function that sends out I2C commands void SendI2C(unsigned char AdresStr, CmdStr); in calling that function is it more efficient etc to define the CmdStr or should I create them on the fly. ie _Method 1_ #define CS_SR14_on 0x01; // | 0000 0001 #define CS_SR14_of 0xFE; // & 1111 1110 or _Method 2_ unsigned char SetCmdStr (unsigned char CmdType); { Switch (CmdType) { case 1: CmdStr = 0x01; Break; case 2 : CmdStr = 0xFE; Break; etc etc Method 1 takes up lots of program room however Method 2 takes up clock cycles I can see Method 1 being much better for debugging etc and if I was writing a Win32 app then it would be the easy choice but in the MCU world I am unsure so 1) Which is the better way to go 2) Why its it the best way to go or should I use some other method ? -- Kind Regards Grant Brown -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist