LPC812 max systick rate and MRT

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC812 max systick rate and MRT

1,217 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tuturuu on Mon Sep 07 03:55:18 MST 2015
Hi guys,

The thing is I need to measure the time between the moment the ultra-sonic ping is sent and the moment it comes back to measure the distance. I am planning on using a systick timer for that. Of course then smaller the time interval between ticks better the result. But I am not sure about how small should I set the time interval between ticks. Is 1us too small?

Or should I use the MRT and read the TIMER register directly?
I am not sure since normally I only see the example using the interrupts generated by the MRT, never seen anyone read the TIMER register directly.

Regards,
Labels (1)
0 Kudos
Reply
8 Replies

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tuturuu on Thu Sep 10 09:17:16 MST 2015
I am using an Elmos IC. The LPC812 send command to the sensor IC by SPI interface.
I am trying the MRT. Could you please explain about the advantage and disadvantage SCT/PWM in compare to MRT and what should I use in such kind of application?
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc on Thu Sep 10 08:24:00 MST 2015
As mentioned by R2D2 you can use SCTimer/PWM block to capture time difference.
What interface are you using to send command? let us know the connection between LPC and sensor IC
Which sensor are you using?
To learn more about SCTimer/PWM block please look into below app note
https://www.lpcware.com/content/nxpfile/an11538-sctimerpwm-cookbook
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tuturuu on Mon Sep 07 19:24:28 MST 2015
I have to send a command to the IC, then it send back the amplitude of the envelop signal at that moment only. No time info included.
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Sep 07 12:07:26 MST 2015

Quote: Tuturuu
I heard that some ultrasonic sensor can automatically send timed data or trigger an interrupt when new data come. Unfortunately mine doesn't have anything like that.



How is that device communicating  :quest: Smoke signals  :quest:
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tuturuu on Mon Sep 07 11:02:06 MST 2015
I heard that some ultrasonic sensor can automatically send timed data or trigger an interrupt when new data come. Unfortunately mine doesn't have anything like that.
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Sep 07 07:36:59 MST 2015

Quote: Tuturuu
By capture timer do you mean the MRT?



No. Usually the hardware edge of the ultrasonic sensor is triggering a capture input of a timer (in your case SCT)...
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Tuturuu on Mon Sep 07 06:37:42 MST 2015
Hi R2D2. By capture timer do you mean the MRT?
0 Kudos
Reply

1,066 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Mon Sep 07 04:08:12 MST 2015
Use a capture timer...

With:

  Speed of sound (20°C): 340m/s = 34 cm/ ms

and measured time from start pulse to low:

  distance = 34cm/ms / 2 * time[ms] = 17 cm/ms * time[ms]

a 1us timer should do the job...
0 Kudos
Reply