Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 5, 3 & 1 Forum Discussions

tazhc_4089936
Level 1
Level 1

After line 205 i was trying to trigger ultrasonic transmitter and resetting the timer by setting the trigger high , afterwards i would stop the transmission and set the reset to low to star counting time it takes to receive the signal.Once signal was receive my timer which was set to one shot halt on interrupt should stop since my capture generated an interrupt. But when i printed out read_counter the second time, my counter changes even before i reset the timer. Can anyone tell me why is it so. Thanks in advance

0 Likes
1 Solution
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Hi,

You can  try using the "Trigger Mode" as Rising edge or falling edge to trigger a shot.

  

After the trigger, the component will require a reset.

You can use the Capture_out output of the Timer and AND it with Triggen output to trigger a reset after every trigger ends.

To trigger, you can make a control register drive high and low (for rising or falling edge trigger).

Please check these links for some help:

Re: Reset a timer in one shot mode

Ultrasonic Distance Sensor HC-SRO4

https://www.element14.com/community/thread/25181/l/psoc-4-pioneer-kit-community-project038-ultrasoni...

Measuring Distance With US-100 Ultrasonic Sensor - Hackster.io

PSoC 4: Measuring Distance with HCSR-04 and CY8CKIT-049 4200 - Hackster.io

Thanks,

View solution in original post

0 Likes
1 Reply
AnkitaS_51
Employee
Employee
100 likes received 50 likes received 25 likes received

Hi,

You can  try using the "Trigger Mode" as Rising edge or falling edge to trigger a shot.

  

After the trigger, the component will require a reset.

You can use the Capture_out output of the Timer and AND it with Triggen output to trigger a reset after every trigger ends.

To trigger, you can make a control register drive high and low (for rising or falling edge trigger).

Please check these links for some help:

Re: Reset a timer in one shot mode

Ultrasonic Distance Sensor HC-SRO4

https://www.element14.com/community/thread/25181/l/psoc-4-pioneer-kit-community-project038-ultrasoni...

Measuring Distance With US-100 Ultrasonic Sensor - Hackster.io

PSoC 4: Measuring Distance with HCSR-04 and CY8CKIT-049 4200 - Hackster.io

Thanks,

0 Likes