GithubHelp home page GithubHelp logo

gp22's Introduction

GP22

This is an Arduino C++ library for the Acam GP22 Time-to-Digital Converter (TDC), an integrated sub-nanosecond resolution timer chip. It will also work with the GP21.

This library includes

  • Methods to initialize the SPI connection to the TDC and test communication
  • Methods to read and write the GP22's registers
  • Methods to calibrate the TDC (which cache register values to pause operation, calibrate, and resume arbitrarily).
  • Enum definitions for each config register bit and opcode, for clearer code
  • Debug methods to print register values to a serial port

The code meant to be used in conjunction with the datasheet as a starting point for your application, though it has not been tested extensively enough to act as a "black box" for the TDC. For example, the correct sequence of register reads and writes to initialize and calibrate the TDC can be tricky to work out from the translated datasheet, and it has already been done here.

TDCtalk example

examples/TDCtalk includes application-specific code for using the GP22 for time-correlated single photon counting (TCSPC), and sending the data back to a PC application using a custom serial protocol. This is not a made-up instructional example, but somewhat ugly "real" application code. However, some parts of the code will hopefully be useful even for another application.

This example initializes the TDC and sets it up to work in "fast mode" (with EN_FAST_INIT enabled). It then attaches an interrupt to the pin connected to the GP22's INT pin. On each reading, the TDC triggers an interrupt, and the Arduino reads and saves the uncalibrated measurement to a buffer. Upon a request from the PC application, the Arduino sends the buffer contents to the PC. It can also calibrate the TDC at any time (momentarily ignoring new readings, then resuming). On an Arduino Uno, this can support a maximum event rate of about 5 kHz. The corresponding LabVIEW client application is included, but requires LabVIEW to run.

Installation

To use with the Arduino IDE, place the GP22 library folder into the libraries subfolder of your Arduino sketches folder, and restart the IDE.

gp22's People

Contributors

leokoppel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gp22's Issues

GP22 and arduino uno

Hi, my question is if I buy the gp22 demo board , can I download your code directly to Arduino uno to get Time of flight data printed to serial monitor? I am also planning to use the Arduino pro mini, will it work on that too? Which ultrasonic sensor do you recommend me to use for the demo board? Thank you

issue with CJMCU-22 board

Hello Leo

I am trying to use your library with the CJMCI-22 board (GP 22) for a smart flow meter
I receive always this message from TDCtalk :

attached pinChangeISR_debug
/Temp sensor: no addresses.
Starting up
///Test took 312 us
Read/write test failed!

I use a UNO R3

  •  10 -> SS with a level shift
    
  • 11 -> MOSI a level shift
    
  • 12 -> MISO a level shift
    
  • 13 -> SCK a level shift
    
  • 2  -> INT a level shift
    
  • 3.3V -> VCC (NOT 5 VDC)
    
  • GND -> GND
    

2 piezo cells in SP1 / GND and SP2 / GND

I guess I have miss something ?
Could you give me some advices ?

Best regards
Franck

GP30

Any idea if this library might be compatible with the GP30?

How to control pulse laser with single TDC

Hello,

First, thank you for your code! I am trying to implement lidar system using arduino UNO and TDC-GP22. The thing is, I want to calculate ToF with start pulse from laser fire signal, and stop pulse from photodiode; that is, I do not need 2 channel start and stop signal.

I studied your code, and realized that laser emitting code is not included. On top of that, compiling your code, memory alert is shown to the status. Is there any other way to solve these issues? Thank you.

Best,
Ted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.