I used the SRF02 with the TINI microcontroller through the I2C interface. It didn't work with me until I found that the MSB of the address of the slave (E0) should be set when reading and clear when writing. Ex:
when writing to the SRF02 the address E0 (1110 0000) should be 70 (0111 0000) its like shifting the address to the right
and when reading it should be F0 (1111 0000) like shifting to the right and setting the MSB (though I didn't try to read)
Hello to everyone. I am expierencing a problem using the SRF08 ultra-range sensor with the PIC18F452. I have written the code using the micro-chip C18 compilier which has macros for the I2C bus. However I am not getting any values when I am reading the registers. I have just read a question by Mohit and it seems as though he has had the same problem. One of the replies was that the macros dont reduce the clock speed to 100 khz. I wanted to know did that solve the problem and if so how do you define it. I have shown my code below. Thank you in advance for any help that you can provide.
Users browsing this forum: Google [Bot] and 1 guest