12:22 am
May 27, 2015
12:52 am
March 12, 2015
Some issues I see with your VI off hand.
1) I think you want Master mode don't you?
2) What is the Slave's address? You have set 0x3C as the Slave address but you said you wanted to write to register 0x3C. The slave address should be the same for all I2C transactions (you have it set to 0x3C and 0x3D in different places). Looks like the address should be 0x1E according to this. I think you are confusing it with the R/W bit, which is technically not part of the address:
https://www.sparkfun.com/tutorials/301
3) Im not sure what the constraints of the hardware are that you are interfacing to, but you should probably have some delay in your while loop otherwise its going to be sending data pretty frequently.
Also check out the DS1307 Real Time Clock example. That does something very similar. It writes to 7 registers to set the real time clock and reads from the same registers in a loop using "I2C Request From.vi" and "I2C Read All Bytes.vi".
30
1 Guest(s)