View previous topic :: View next topic |
Author |
Message |
jamd
Joined: 22 Jan 2013 Posts: 4
|
I2c with 18F13K22 |
Posted: Tue Jan 22, 2013 3:17 am |
|
|
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.
![](http://nsa30.casimages.com/img/2013/01/22/mini_130122101706694301.jpg) |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19359
|
|
Posted: Tue Jan 22, 2013 3:36 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
|