CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC18 I2C maximum SCL clock freqency

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Wei Deng
Guest







PIC18 I2C maximum SCL clock freqency
PostPosted: Wed Dec 18, 2002 10:05 am     Reply with quote

<font face="Courier New" size=-1>Hi, I want to use PIC18F452 (as master) with a MAX1238 (AD Converter as slave). The data sheet of MAX1238 says that it supports 400KHz Fast Mode and 1.7MHz High-Speed Mode. I checked the data sheet of PIC18F452, on page 151, it mentions that with the proper BRG value setting, PIC18F452 can generate 100kHz, 400kHz and 1MHz signal for the SCL clock. On Table 15-3 of page 151, from my understanding, it can even generate some non-standard SCL clock freqs, such as 312.5kHz, 308kHz, 333kHz. Have anyone tried successfully using MSSP module of PIC18F452 at a SCL frequency higher than 400kHz (i.e. 1MHz). I know that with CCS compiler, #use i2c (master, fast, ...) should work perfectly at 400kHz, but I really want to do more than that, even 1.7MHz (the max freq my slave supports).</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10119
Tomi
Guest







Re: PIC18 I2C maximum SCL clock freqency
PostPosted: Wed Dec 18, 2002 12:41 pm     Reply with quote

<font face="Courier New" size=-1>You can try to overwrite SSPADDR in early main() or just before you call i2c_start():

#byte SSPADD = 0xFC8

void main()
{
......... some initializations
SSPADD = 3; // or other value
......... rest of your code

OR:
void Access_My_i2c()
{
SSPADD = 3;
i2c_start();
i2c_write(0xA0);
..........
i2c_start(); // restart
i2c_read();
.........etc.
i2c_stop();
}

Check the bus speed by an O-scope.


:=<font face="Courier New" size=-1>Hi, I want to use PIC18F452 (as master) with a MAX1238 (AD Converter as slave). The data sheet of MAX1238 says that it supports 400KHz Fast Mode and 1.7MHz High-Speed Mode. I checked the data sheet of PIC18F452, on page 151, it mentions that with the proper BRG value setting, PIC18F452 can generate 100kHz, 400kHz and 1MHz signal for the SCL clock. On Table 15-3 of page 151, from my understanding, it can even generate some non-standard SCL clock freqs, such as 312.5kHz, 308kHz, 333kHz. Have anyone tried successfully using MSSP module of PIC18F452 at a SCL frequency higher than 400kHz (i.e. 1MHz). I know that with CCS compiler, #use i2c (master, fast, ...) should work perfectly at 400kHz, but I really want to do more than that, even 1.7MHz (the max freq my slave supports).</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10124
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group