No interrupt from AS6501... - Page 1
Forum section: electronics / projects

author: Denge
author_rank: Newbie
timestamp: April 25, 2024, 09:59:58 pm
content: Hello All,I'm struggling with a new design using the AS6501 chip. The nasty thing is I don't get an interrupt signal back from the chip after having started the measurement. I guess there is something wrong with the initial setup of the chip but the longer the more I'm getting lost.My goal is to count the time distance between a start pulse on stopA and a stop pulse stopB.The setup I use is as follows:0b10010101 ; 0x95 CFG0: stop A&B active, LVDS disabled, REFCLK active, REFCLK index reset enabled0b00010101 ; 0x15 CFG1: stop A&B processed, pulse distance, no high resolution0xC0 ; CFG2: common & blockwise read0xA0,0x86,0x01 ; CFG3,CFG4,CFG5 REFCLK_DIVISIONS (100000) for 10MHz refclk0x00,0x00 ; CFG6,CFG7 LVDS pattern OFF0xA1,0x13,0x00,0x0A,0xCC,0xCC,0xF1,0x7D ; CFG8 to CFG15 Fixed values0x04 ; CFG16 CMOS level inputAt my humble opinion this should be correct for an SPI only communication with this chip. The results I obtain for both channels (if I skip the interrupt) are for refIndxA and stopA 0x00FFFFFF and for refIndxB and stopB 0x00747474 regardless the pulse distance coming from an AFG. Anyone an idea what I did wrong here?

author: mino-fm
author_rank: Regular Contributor
timestamp: April 26, 2024, 10:32:06 am
content: 0xC0 ; CFG2: common & blockwise readThis is for LVDS output you don't use.Let me show you an init sequence for both channels without PIN_ENA_RSTIDX.const uint8_t AS6501_init_tab[] = {0x15, // stop-A, stop-B und ext. REFCLK einschalten0x85, // stop-A und stop-B auswerten, 1x Auswertung0x00, // LVDS nicht aktiv(uint8_t)(REFCLK_AUFLOESUNG), // LSB(uint8_t)(REFCLK_AUFLOESUNG >> 8 ), // MSB-1(uint8_t)(REFCLK_AUFLOESUNG >> 16), // MSB0x00, // LVDS nicht aktiv0x00, // dto.0xa1, // interne Konstanten0x13,0x00,0x0a,0xcc,0xcc,0xf1,0x7d, // bis hierhin0x04 // CMOS-Pegel Eingänge};You always have to read out each FIFO to enable INTERRUPT again. They should be cleared after init.

author: Denge
author_rank: Newbie
timestamp: April 26, 2024, 03:21:53 pm
content: Hello,Thanks for the reply!For CF2 the datasheet says that bits 6&7 are useful or SPI.I copied your setup but without any succes for the interrupt pulse: the interrupt simply doesn't go low and I have still no idea why this is not happening!The sequence I us is:- write the config registers- verify the setup- initialise and start the measurement- readout of measurement dataHowever, I never reach the read out as my program stalls on waiting for the interrupt.The stopA and stopB pulses are generated with an AFG, so well defined.Any idea why this interrupt is not going low?Groeten.

author: dietert1
author_rank: Super Contributor
timestamp: April 26, 2024, 03:47:48 pm
content: How did you check that your SPI communication works? Can you read back a known chip id or configuration register?Today i spent two hours to find a design error concerning the enable signal of a TI DAC8554. That one doesn't support any read operation..Regards, Dieter

author: mino-fm
author_rank: Regular Contributor
timestamp: April 26, 2024, 04:50:45 pm
content: Can you show your schematic?

author: Denge
author_rank: Newbie
timestamp: April 27, 2024, 03:24:31 pm
content: Hi Both,@ Dieter: the SPI is working correctly here as the config data I sent to the chip is read back and correspond to what I sent so I'm pretty sure the SPI communication is OK.@ Mino: unfortunately the schematic is still a work in progress but it is very similar to yours (Pico-Fmeter-AS6501) around the AS6501 except for the 10Ω in the power lines and the 3K3 resistor in the interrupt line to the MCU. Plus I've only one 3V3 supply. I'm using a dsPIC33 processor but this shouldn't make any difference.For the moment I'm testing (read: trying to get it running correctly) on a breadboard but this isn't the origin of the absence of the interrupt signal from the AS6501!So I'm eager to receive a tip pointing me in the good direction to solve this.

author: dietert1
author_rank: Super Contributor
timestamp: April 28, 2024, 06:47:21 am
content: I downloaded their laser range finder app note fromhttps://downloads.sciosense.com/Files/ScioSense_AS6500_DMA_V1-package-1-3.zip. I successfully compiled the project for STM32L476 using CubeMX and EWARM - with all references resolved. So that's a good starting point. They capture the interrupt signal into a variable My_INTN_State and use that one to control the main application loop. A bit unusual is the use of both rising and falling edge for interrupt.Regards, Dieter

author: Denge
author_rank: Newbie
timestamp: April 29, 2024, 06:56:47 am
content: Hi Dieter,I did download it too. But I'm programming in assembler...I'll try to compile it too in the hope I succeed :-)Greetings

author: dietert1
author_rank: Super Contributor
timestamp: April 29, 2024, 07:41:08 am
content: The app note source codes are in C and C is portable. As a proof of concept you could port the app note to your MCU. Probably you have support for the peripherals needed (GPIO, Interrupt, SPI..)Coding in assembler can be a second step once it works.Regards, Dieter

author: Denge
author_rank: Newbie
timestamp: April 29, 2024, 02:26:06 pm
content: Hi All,Porting this code to the dsPIC33CK64MC105 MCU would take me ages I guess. On top of that I'm a novice in programming C.... So trying to port all this code would bring me further away than I'm now!By now I checked and rechecked the hardware and found it should be ok, played with some different setups and added a 100 µs delay right after the power on reset and a 200 µs delay after the configuration write but still no interrupt going low! :-(The config I use now is:cfg0: 0x95, cfg1: #0x15, cfg2: #0x00, cfg3:4:5, 100000, cfg16, #0x04The refclk is 10 MHz.Conclusion: I'm lostGreetings,

author: dietert1
author_rank: Super Contributor
timestamp: April 29, 2024, 04:22:16 pm
content: Someone who wants to develop firmware with difficulties using C. Hm.Today i found a laser range meter in our supermarket at € 17.90. They claim accuracy of 1.5 mm. At 15 cm/nsec time of flight this means a timing resolution of 10 psec. Having seen a unit price of € 27 for the AS6501 at digikey i thought: Is it possible there is a TDC inside and bought one. But nope. They implemented it with an ARM Cortex (GD32E230F6) and a Si5351A synthesizer. So it isn't single pulse detection but a phase measurement.Regards, Dieter

author: grx
author_rank: Newbie
timestamp: October 15, 2025, 10:07:45 am
content: Hello,Was this interrupt problem solved, and then how?I'm in a similar project right now and I would know if these chips work at all.Also does anyone know if the refindex value is 20 or 16 bits wide when reading the FIFOS? The datasheet is not very clear about this.Also can someone confirm that we need to read all FIFOs at once to know what channel had events? There are no individual FIFO status bits, right?Thanks