Right, but you don't even know if your current code will work on any PIC.
You are testing two things:
1. Your code.
2. The ability of your code to 'fix' a PIC with erratas.
You need to test it, at least temporarily, on a good PIC of a different
type. This will prove that your basic code works at all.
I can't make you do this. All I can do is recommend it. I can't really
help you any further.
PICuser123 Guest
28F2455
Posted: Fri Mar 30, 2007 2:17 pm
I have experienced the same problem as you. I've also noticed that when the slave is removed from the bus and then when the I2c is reconnected things are fine.
I've also connectd 5v to the clk bus when it is stuck and seems to get the device out of the hang state. I've been able to see the PIC hang usually after a reset of power to the slave.
I'm not sure what can be done but is very frustrating. The exact same code works in a 16F690, but not in the 18F2455. Any one find a solution to the problem?
PICuser123 Guest
18F2455
Posted: Fri Mar 30, 2007 3:27 pm
I think I've found a work around. Problem appears to lie within the I2c interrupt.
1) Make sure that the fuse NOXINST is used. If fuse is enabled the PIC does some strange things.
2) Dont use the i2c_read(); in the interrupt. For what ever reason code hangs if used. I just used "incomming = *0xFC9" and read value directly. (I will try to enable it. Since I added the other states)
3) Needed to add in a way to take care of the 2 other I2c conditions. If state = 0 and if state >80 (ie 81). In both these I do an i2cWrite.
I will have to test further, but at least the PIC now can run without getting hung in the I2C ISR. Right now I'm just doing an I2c READ. It may not work with a write. I havent got that far yet.
All times are GMT - 6 Hours Goto page Previous1, 2
Page 2 of 2
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