i2cObjectv2

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Request group membership
By: James Burrows, created: 2013-03-28 | updated: 2013-04-09

This is the i2cObject version 2.1. MUCH better - based on Mike Green's excellent basic_i2c_driver. This code demo's i2c EEPROM's, DS1621, DS1307 and www.robot-electronics.com 's - SRF08, MD22, MD23, SD21, SRF08 devices! Have fun!

 

Original File Upload
AttachmentSize
Package icon i2cObject_v2_1.zip24.89 KB

Comments

[originally posted by Anonymous on 2011-03-06 05:35:42] In regards to using the SRF08 Demo If your ranging results are gibberish and or 65536 all the time then replace waitcnt(5_200_000 + cnt) with waitcnt(6_000_000 + cnt) in the SRF08_Demo private function in the file i2cDemoApp.spin Thats the amount of time the program waits for the sensor to get a range value before trying to read it. By default it is too short and it tries to read the range before it has received the echo back thus giving a value of FFFFFFFF or 65536, and occasionally slighty smaller but still really high numbers like 10,000cm when the sensor has only partially written the sensor reading to the register. the comment in the program states that 5200000 clocks is 65 ms, this is correct but thats only the sensors timeout, not the settling time and timeout and processing/writing time, which adds to 6000000