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 support@ccsinfo.com

I2C on schmidt trigger inputs?

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



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

I2C on schmidt trigger inputs?
PostPosted: Wed Oct 12, 2016 6:44 am     Reply with quote

Will software i2C master work on the RE1 and RE2 lines of a 18F4682? I never tried to use them before but the new board I am working on has them set up that way. Apparently able to address the temp chip (DS1631) but always returns FF values. Maybe it is a bad temp chip but thought I'd ask before changing chip.

Thanks, Russ
Ttelmah



Joined: 11 Mar 2010
Posts: 19358

View user's profile Send private message

PostPosted: Wed Oct 12, 2016 7:13 am     Reply with quote

Technically I2C, actually wants Schmitt inputs!...

You can get away with CMOS, and in some cases, people 'cheat' using 3.3v I2C devices to talk to a 5v chip, by using CMOS inputs (the Schmitt won't work without a buffer).

Now, 'FF', says the line is being permanently seen as high, so the device is not responding. Are you sure you are addressing the device correctly?. Try PCM_Programmer's I2C scanner program (in the code library), and see if you get a response at any address.

The 1631, is at address 0b1001 A2A1A0x Where 'x' is 1 for read, and 0 for write.
0x90/0x91 if you have all three address lines held low. Beware of the 7bit versus 8bit address confusion (they tell you it's 7bit address, but the PIC uses 8bit address format, so you have to multiply by 2).

Make sure you have disabled the comparators, analog, and the PSP on these pins.
russk2txb



Joined: 30 Mar 2008
Posts: 109
Location: New Jersey

View user's profile Send private message

PostPosted: Wed Oct 12, 2016 7:40 am     Reply with quote

Thanks for the quick reply. Yes the address lines are all low and am using 0x90/91 to address the chip. Think I have everything disabled:
Code:
   setup_ccp1 (CCP_OFF);
   setup_ccp2 (CCP_OFF);
   setup_adc_ports (AN0_TO_AN5);

The E1 / E2 lines are AN6 and 7, so the adc should be disabled. I am using software i2c with the DS1631 on many other projects with no problems. The only difference here seems to be the use of port E. Also using a new version of the CCS compiler (version 5.064). Previously was using 5.062 and I doubt there is any change to I2C code between them.

Thanks again, Russ
Ttelmah



Joined: 11 Mar 2010
Posts: 19358

View user's profile Send private message

PostPosted: Wed Oct 12, 2016 8:01 am     Reply with quote

add

setup_psp(PSP_DISABLED);

If you are using the same chip elsewhere, then you know the likely problems of needing to wake it up etc.. What are you using as pullups?. On the ST inputs, or on hardware I2C, you will need to ensure that the pullups are more aggressive than may be needed for standard inputs.
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