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 with 18F13K22

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



Joined: 22 Jan 2013
Posts: 4

View user's profile Send private message

I2c with 18F13K22
PostPosted: Tue Jan 22, 2013 3:17 am     Reply with quote

Hello,
I try to program a 18F13K22 using i2c.
Of course my program does not work, I tested with Proteus.
As I master well enough asm, I looked at the file. Lst. See attached file.
- Line 644: clear FB4: proteus sends an error, normal since FC4 is a reserved register!
633-4-line: 29 in the register FC6 (SSPCON1) is an impossible value for i2c in master is 28! And ... program crashed.

What to do?
Thank you for your answers.

Ttelmah



Joined: 11 Mar 2010
Posts: 19359

View user's profile Send private message

PostPosted: Tue Jan 22, 2013 3:36 am     Reply with quote

Seriously, read the forum header about Proteus.
FB4, is not 'reserved', it is unimplemented. Clearing it does no harm.

Read the I2C errata for the chip. Some make I2C on this almost unusable. It depends whether you want master or slave operation, but for the master, you need to do a _lot_ of bodging to make I2C work. Not CCS's fault. This is a chip that basically you should not select if you want reliable I2C.
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