Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I2C DAC in PIC 18F series

Status
Not open for further replies.

natraj20

Member level 3
Joined
Oct 28, 2010
Messages
65
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Location
Florida
Activity points
1,769
I am trying to interface the MCP 4725 D/A through I2C interface and its maximum speed according to the datasheet is 3.4 MHz. Is it possible to make this interface communicate at 1 MHz with the PIC 18F47J53 controller which is the controller's maximum frequency in I2C module??

Also, How to enable the high speed (1 MHz) mode in the I2C module ?
In the SSPSTAT register, the configuration setting for both the 100 kHz and 1 MHz seems to be the same and what changes should i make in the registers or the code to operate the I2C module at the high speed mode ?? I tried varying the value at SSPADD which is the register that controls the divider for I2C speed but could not see the any difference.

I am trying to generate a sine wave in the frequency range of 1 - 10 kHz using this I2C DAC. This is possible only when i am able to configure I2C in the high speed mode.
 

Better use a new generation PIC24F or PIC33F with buildin 16 bit DAC or use an external SPI DAC which can run at a much higher freq.
 

I wish i could do that but most of the modules in this project are almost done and looking to generate sound using sine waves from this DAC module for alarm indications.
 

But for alarm sound you do not have to make a since wave, simple square wave will also do fine.
 

ya, but not any sound. there is a specific sound requirement which needs the sine wave in the 1 - 5 kHz range.

---------- Post added at 09:38 ---------- Previous post was at 09:20 ----------

And the main intention being trying to make the i2c work in high speed mode and learn more about it rather finding an alternative at the start.
 

Did you configure the Baudrate generator for 1 MHz ?. This together with the 1 MHz fast I2C mode options is all you need to do. Keep in mind that the clock rate is 1 MHz so transmisson of 16 bits takes 18 us to complete !!..
 
Thanks Paul! The configuration in the SSPSTAT register is basically the same for 100 kHz and 1 MHz mode. And the baud rate in this mode is set in the SSPADD register but has no effect. I could not figure out what i'm missing. I agree with the transmission speed and it should be very well possible to transmit 24 16-bit values in one-fifth of a sec.
 

Tell me the values you configured in the I2C registers, all !!!
 
Hello. I have exactly the same problem as natraj20. I have to used PIC18F4680 and the MPC4728 DAC. I would like to configure the microcontroller I2C module in High-Speed mode to have a 1MHz clock but I don't know how. According to the data sheet the DAC only accepts transmissions faster than 400 KHz when the I2C module is configured in High-Speed mode. Did you two solved the problem?

Thanks in advance.
 

@swappen

What is the pull up resistor that u are using for the i2c communication lines ??
 

I'm going to use 1K resistors. I have not made the circuit yet, i will have to do it next week, but i was reading the data sheet and wanted to know if PIC18F4680 supports I2C High Speed mode. Reading about the DAC you realize that it can transmit faster than 400MHz when is configured in HS Mode. I have not found out if that PIC can be configured in I2C HS mode reading its data sheet. Did you achieve it? How did you configure the PIC?

Thanks for your time.
 

As per your PIC18F4680 datasheet, you can configure the I2C module upto 1 MHz. Configuring the HS mode is the same as that of the standard and fast modes -- parameters being the slew rate control bit (SSPSTAT register) to configure the corresponding frequency mode and the Baud rate control (SSPADD register) to set the frequency. The pull up resistor is also an important factor in determining the mode. You can see the difference in SCL frequency for the same configuration settings by varying the resistors. For 1 MHz mode, the pull up resistor value should be less than 1K. Else you can use 1 - 10 K ..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top