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

setup_spi(FALSE) + i2c FORCE_HW on 18F2620 doesent work

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







setup_spi(FALSE) + i2c FORCE_HW on 18F2620 doesent work
PostPosted: Sun Apr 10, 2005 7:38 pm     Reply with quote

Hi,

have problems with i2c sometimes my PIC 18F2620 is hanging on i2c_start () function. I´m using i2c with FORCE_HW, SLOW but without setup_spi(FALSE). If I use setup_spi(FALSE) then it doesent work.
I´m using 10K pullups on C3 and C4 with 24C256 and PCF8583.

In a thread I found setup_spi(FALSE) in the docu I can't find "FALSE"

The problem (stop on i2c_start()) I can reproduce when I connect to different USB serial adapter (with PL2303) for a while then sometime it does stoping on i2c_start() and waiting.

If I use the software I2C then it it work´s . The init_i2c function I use from the CCS sample, Compiler Version 3.222

I use a software RS232 on B5 and B6.

Is there something to delete, if an error on RS232 to work with I2C.
If I call set_tris_c, is there switched off the spi save ?
I´m not sure if I switch to software I2C to have solved my problem.

Is software I2C better than hardware I2c to use ?

mybe somebody have a answer

great thanks
Stefan
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Sun Apr 10, 2005 7:51 pm     Reply with quote

Look for PCM Programmer's reply in this thread:

http://www.ccsinfo.com/forum/viewtopic.php?t=19225&highlight=setupspi+false
Stefan
Guest







PostPosted: Mon Apr 11, 2005 4:16 am     Reply with quote

Thanks, I was missanderstandig that thread,
I doent have to use setup_spi thanks. Therefore it work´s.

But what about that, is it better to use software I2c or hardware I2C.
On hardware i2c I became sometimes that problems the PIC stops on i2c_start and on software mybe later or never hope !

To produce my problem I switch from PL2303 to PL2303HX and bag. What has an USB serial Adapter to do with a I2C problem ?

Or is there somtimes the Initialisation going wrong and the port C is spi instead of I2C although I was tristate setting

Stefan
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