Distance measurement

Tedmong:
Hello johnwasser,

I tried to compile your given code using Arduino.ino, but memory issue popped up. I also carefully saw your found Github code, but laser and photodiode pin are not defined. Have you solved this problem?

As I noted, the code that the OP found did not translate well from Russian and had a problem with using way too much memory. You should probably start by finding a copy of Application Note AN034 (apparently now called Application Note AN000249) for the GP22 and working from there.

https://ams.com/documents/20143/36005/TDC-GP22_AN000249_1-00.pdf

Hello johnwasser,

Thank you for your fast reply. I have already saw the datasheet of AN034 you posted with its application notes by several universities. Some universities had same purpose with mine, but they did not post any source code; I am contacting with them.

I may try to refer code in the .pdf file you posted, but not sure whether I can translate this code to Arduino.ino software, and actual pinouts are not shown.

Since I am a newbie at hardware, I hope that there are some open codes with wirings, but could not find so far.

Read about the SPI library:

Thank you for your advice! I have studied SPI for this project with this stage:

  1. Aruidno UNO - UNO : SPI worked & SCK, MOSI, MISO, SSN waveform checked as well
  2. UNO - GP22 : not worked
  3. UNO - GP22 physical connection & using UNO-UNO SPI code : not worked
  4. UNO - UNO physical connection & using UNO-GP22 SPI code : worked

The problem is that even the inner function, SPI.transfer does not work for UNO-GP22. The connection is right, and I used the same code as you uploaded(GitHub - leokoppel/GP22: An Arduino library for the Acam GP22 Time-to-Digital Converter).

And I just found that for the case of the 3 above, SSN, SCK, MOSI waveform works well, but there is no signal from MISO pin. I have already checked the soldered status. Do you guys have any idea?