View previous topic :: View next topic |
Author |
Message |
Stefan Guest
|
setup_spi(FALSE) + i2c FORCE_HW on 18F2620 doesent work |
Posted: Sun Apr 10, 2005 7:38 pm |
|
|
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: 1907
|
|
|
Stefan Guest
|
|
Posted: Mon Apr 11, 2005 4:16 am |
|
|
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 |
|
|
|