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

external eeprom

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



Joined: 13 Aug 2004
Posts: 84
Location: Turkey

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

external eeprom
PostPosted: Thu Dec 25, 2025 1:30 am     Reply with quote

Hi,
I have application which uses a pic18f6410 and eeprom 2416.
2 eeprom is connected to pic but comunicate on different bus.
On the same hardware,
when I compile the code with ccs ver 4.135 everything works fine
I read write in eeprom . But when I compile the code with ccs ver 5.118
cant read and write in the eeprom. what could be the issue. The code was written 10 years ago with ccs 4.114. I want to compile on ccs ver 5118.

I did some modification on the 2416 driver
#define EEPROM_SDA1 PIN_C4
#define EEPROM_SCL1 PIN_C3
#define EEPROM_SDA2 PIN_C1
#define EEPROM_SCL2 PIN_C0

#use i2c(master, sda=EEPROM_SDA1, scl=EEPROM_SCL1,stream=b1,FORCE_HW)
#use i2c(master, sda=EEPROM_SDA2, scl=EEPROM_SCL2,stream=b2,FORCE_SW)

works in Software i2c mode but note on Harware mode

cheers
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
temtronic



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

View user's profile Send private message

PostPosted: Thu Dec 25, 2025 12:23 pm     Reply with quote

FWIW...
My 'gut' is telling me to stay with 4.135 as it WORKS and the project is 10 years old.
Unless you change the PIC, I don't see the need to use a newer version of the compiler.
dyeatman



Joined: 06 Sep 2003
Posts: 1975
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Dec 25, 2025 3:05 pm     Reply with quote

You said there are two eeproms.
Is one working and one not (if so, which is which) or are
neither of them working in HW mode?
_________________
Google and Forum Search are some of your best tools
scanan



Joined: 13 Aug 2004
Posts: 84
Location: Turkey

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

PostPosted: Fri Dec 26, 2025 4:54 am     Reply with quote

dyeatman wrote:
You said there are two eeproms.
Is one working and one not (if so, which is which) or are
neither of them working in HW mode?


neither working in HW but both works in SW
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
temtronic



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

View user's profile Send private message

PostPosted: Fri Dec 26, 2025 7:22 am     Reply with quote

Well ,since they work with SW version, it's not a PCB/hardware problem.

I'd look at the listings of both the working 4.135 and the nonworking 5.118. Since the source code is the same, the listing should be identical.

My hunch is the newer compiler has set some bits wrong in a register, perhaps a peripheral on the i/o ports hasn't been disabled ?
Ttelmah



Joined: 11 Mar 2010
Posts: 20009

View user's profile Send private message

PostPosted: Sat Dec 27, 2025 5:37 am     Reply with quote

The problem here is you are specifying impossible things. The old compiler
was just ignoring these. The newer one is trying to do what you say,
and failing. Your chip only has one hardware MSSP, on C3 and C4, so only
these pins can accept the force_hw. Then you are not specifying the I2C
clock rate. The default for the newer compiler is to always clock as fast
as possible. You need to be specifying your clock rate for the hardware
I2C. Be aware that the hardware I2C will be defaulting to I2C voltage
levels on the input pins. How good are your pullups?. At the high rate
the new compiler will generate these will need to be very low resistance
if the bus has any significant capacitance.
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