Running or at least it says that there's something on the I2C lines.
If you really want to know if it's working, you could still write to the EEPROM, then read back the data, if both are the same... it confirm it's working.. just fine.
Running or at least it says that there's something on the I2C lines.
If you really want to know if it's working, you could still write to the EEPROM, then read back the data, if both are the same... it confirm it's working.. just fine.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steve:
Well that is my big question in my previous response. If this was doing what it is supposed to be doing, would I not see the result in my i2c_Data variable?
ADDR var word
ADDR = $07
PAUSE 10
I2CWRITE PORTC.4,PORTC.3,$A0,ADDR,[1]
PAUSE 10
I2CREAD PORTC.4,PORTC.3,$A0,ADDR,[i2c_Data],Fail
PAUSE 10
GOTO MAIN
Fail:
PORTC.5 = 1
GOTO MAIN
I would expect i2c_Data to contain "1"
It does not.
Am I giving everything enough time?
Thanks
Tim
Try this one, it's working here
Code:define LOADER_USED 1 disable debug Data_READ var byte Data_Write var byte Bad var bit ADDR var word SDA var PORTC.4 SCL var PORTC.3 Control con $A0 Bad = 0 Start: For addr=0 to $FFFF data_write=addr.lowbyte bad = 0 I2CWRITE sda,scl,control,ADDR,[data_write] PAUSE 10 I2CREAD sda,scl,control,ADDR,[Data_read] enable debug data_read=data_read ' refresh ICD display disable debug if data_read != data_write then bad=bad +1 next GOTO Start
Last edited by mister_e; - 2nd February 2007 at 04:09.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Hi Steve:
Thanks for posting the code. How long should this take to complete? I can see that it is cycling through addresses 0 to $FFFF. I put in a line between the next and GOTO Start to light up one of the status LEDs I have on the board.
It is not lighting up. In the watch window, Data_READ is blank. When I pause the program, I am in the library PBPPIC14.LIB stuck in the PAUSE routine waiting for the carry bit to be cleared. This bit does not get cleared.
I just thought of something. I have no includes in my program as I normally did with assembler. I am just starting out with PBP.
Am I perhaps not adding some includes that I need?
I didn't see a list in the manual anywhere of any special requirements that have to be in the code. I don't have a device include either.
Please advise
Thanks
Tim
Bookmarks