Good afternoon Ken, Yup, thank for reminding me that. I saw my mistake already. Fosc = 40MHz Baud rate = 400KHz Therefore, SSPADD = (Fosc/4*Baud rate)-1 In the case I will get, SSPADD = 24; //400KHZ Baud clock @ 40MHz Am I correct to say that? I have rewrite the I2C_inital as shown below. I added in the SSPCON1 which I miss out at first. But I do not know whether the C18 complier command OPENI2C(MASTER, SLEW_ON) is the same as using SSPCON1. Just for you to verify. //I2C_init condition TRISC = 0X18; //Set SDA (PIN 4) & SCL (PIN3) as input. Activate I2C port OpenI2C(MASTER, SLEW_ON); //Initialize I2C module SSPADD = 24; //400KHz Baud clock @ 40MHz SSPCON1 = 0x28; //set up SCL & SDA as the source for the serial port and set the I2C module to master mode Thank you, Nicholas ----- Original Message ----- From: "Ken Pergola" To: Sent: Saturday, March 20, 2004 4:30 PM Subject: Re: [PIC]:I2C DAC test > Nicholas, > > Now that I know you are using a 40 MHz clock for the PIC18F452 you must > change the value you are loading into SSPADD: > > You are loading a value of 0x09, but if your Fosc to the PIC is 40 MHz, then > your SCL clock frequency is actually 1 MHz! > Clearly this is in violation of the MAX417 (which is rated at 400 KHz > maximum). I'm not saying this will fix your problem, but you don't want to > operate above the manufacturer's specifications. > > In other words Nicholas this line of code would be wrong for an external > clock of 40 MHz: > > SSPADD = 9; //400KHz Baud clock (9) @16MHz > > > Your homework assignment: > > Calculate a new SSPADD value, report back and I will verify the value you > calculated. > > > Best regards, > > Ken Pergola > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu