Page 2 of 2

Re: Recent update of HCSR04

Posted: Fri Mar 15, 2024 9:25 pm
by ELECTRONICA67
Hello Jorge,

I made the selection of the component, but it keeps sending 0 zero. :(

Enrique

Re: Recent update of HCSR04

Posted: Fri Mar 15, 2024 9:27 pm
by ELECTRONICA67
config

Re: Recent update of HCSR04

Posted: Sat Mar 16, 2024 6:58 am
by jgu1
Hi Enrique!


Have you tryed to change the timer and the prescaler and postscaler?

Re: Recent update of HCSR04

Posted: Sat Mar 16, 2024 5:52 pm
by ELECTRONICA67
Hi Jorgen, I will do tests and keep you informed.

Enrique
Thanks

Re: Recent update of HCSR04

Posted: Sat Mar 16, 2024 7:40 pm
by ELECTRONICA67
Thanks Jorgen and Martin

work with timer1, 1:1, 1:1 with 16 bit timer; The reading is a little unstable, but it sends a reading very close to the real one. I think it is for INT readings 0-65535 and the sensor has a reading of 20-290 that exceeds the 8 bit timer 0-255. I had thought the setting was timer0 1:1 1:1 as the base selection. :D

Enrique
Thanks

Re: Recent update of HCSR04

Posted: Sat Mar 16, 2024 8:05 pm
by jgu1
Ok, at least it begin to work. Play with the Prescaler too.
Martin managed to make it wery flexible.
The att. examble with 8bit Pic work very fine for me, change to your kind of sensor. And for Arduino. Have a look

Good luck :D

Jorgen

Re: Recent update of HCSR04

Posted: Sat Mar 16, 2024 8:15 pm
by ELECTRONICA67
Thanks Jorgen, I'm going to test these two examples on Arduino and PIC, I appreciate the help.

Enrique
Best Regards

Re: Recent update of HCSR04

Posted: Sun Mar 17, 2024 1:03 pm
by medelec35
Thanks Jorgen

Hi Enrique,
If you are still having issues, then can you post your .fcfx file and I will see if I can spot what's going on

Re: Recent update of HCSR04

Posted: Mon Mar 18, 2024 5:27 pm
by ELECTRONICA67
Thanks Martin, I'll let you know, I appreciate the help.

Enrique
Best Regards