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

Alternative I2C library for CCS?

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



Joined: 17 Jun 2019
Posts: 563
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

Alternative I2C library for CCS?
PostPosted: Mon Sep 09, 2019 10:18 am     Reply with quote

Does anyone know of an alternative I2C library that could be used with the CCS IDE/compiler? I've found implementations for PIC in general, and MPLAB, but I am trying to find something I could integrate into existing code to see if behavior of an issue we have been having might change.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 09, 2019 10:30 am     Reply with quote

allenhuffman wrote:

Does anyone know of an alternative I2C library that could be used with
the CCS IDE/compiler?

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=57119
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Sep 09, 2019 10:35 am     Reply with quote

I've not had any issues but it'd be easy enough to dump the listing, see how CCS codes, then cut you own 'drivers' and 'tweak' them for whatever device you're using. Once you've got the machine code, you simply check for correct timing and sequences of operations.
I've seen in the past so called 'I2C' compatible devices that need specific timing requirements. Course that was 2 decades ago, preCCS, when I used assembler.

Is there a specific device ? as every RTC, EEPROM have always worked with CCS drivers. Remember.. the CCS drivers tend to be 'generic'.
Jay
allenhuffman



Joined: 17 Jun 2019
Posts: 563
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Mon Sep 09, 2019 10:42 am     Reply with quote

temtronic wrote:

Is there a specific device ? as every RTC, EEPROM have always worked with CCS drivers. Remember.. the CCS drivers tend to be 'generic'.
Jay


The issue is on a bus with three PIC-based devices connected to a PC via FTDI I2C driver. At some point, we get a bus hang. It appears one of the PIC devices misses a clock pulse and creates the issue.

We have seen some oddness with the spacing of the clock pulses the FTDI part generates and have a dialog with FTDI on this, also. (The FTDI drivers do not support the bus clear (I2C spec 3.1.16).

Since we can't generate the clock pulses from the PC, we are now trying to do so from the PIC side. I started researching how to do this today.

Meanwhile, I've been asked to find an alternate I2C implementation that we can use to try to recreate this.

It's been a fun last few weeks.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 09, 2019 11:42 am     Reply with quote

allenhuffman wrote:

Does anyone know of an alternative I2C library that could be used with
the CCS IDE/compiler?

In addition to the software driver that I posted above, here are some
hardware i2c alternate libraries:
http://www.ccsinfo.com/forum/viewtopic.php?t=22105
http://www.ccsinfo.com/forum/viewtopic.php?t=21456
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