how to repeat ramp function in vissim embedded

i am new one with vissim embedded. i am trying to generate ramp function which repeat at particular time. how i generate this ramp function . thanks..

The msp430G2553 is a 16MHz

The msp430G2553 is a 16MHz device so each instruction takes .0625 usec. If we make a simple for loop that takes 3 ticks per iteration, we'll need 53 iterations. See how to do it in the attached diagram. (You must be signed in to download)

hii sir . its working but the

hii sir . its working but the result is not so proper.sometime it is not showing, may be this is because of off time . for proper working off time for this sensor should be 60 msec.so i calculate the for 60 msec 0.0625Usec * X = 60000 usec X= 960000 iteration i am right if yes how it implement in vissim emebdded. thanking you....

VNIT

Yogesh, You don't want to do

Yogesh, You don't want to do a "spin" loop for 60 millisecs, that's way too long. Instead use a hardware timer, or counter based off the control timer interrupt that runs the diagram. Post the diagram you are currently using and I'll modify it for you. It will be a bit tricky since you only have one timer on the part you are using.

hi sir , now i moved to

hi sir , now i moved to hardware timer ,and i am reading the value of TAR register when the Echo received . and reset this timer when Echo not received .timer i used in up mode but still it is not detecting the object. sir please have a look uploaded program and and correct me where i wrong. thanks yogesh

VNIT

sir i am new ith vissim

sir i am new ith vissim embedded,i do not know about how to use timer interrupt in vissim embedded.pleasr give some intro about how to use the interrupt after you solved the problem. thanking you..

VNIT

Hi Yogesh, As sound travels

Hi Yogesh, As sound travels .344 meters /millisec, we can just count the millisecs until we get the return pulse, and distance is millisec count * .344/2.
See attached file below. Note that I don't know which GPIO you are listening on, nor do I know what you want to do with the distance, so you'll have to handle that yourself. I am sending it to an external variable right now.
You may have to add some blanking logic to ignore a sensor pulse that you get when you initially send the pulse out.
Here is an image of the diagram:
distance sensor diagram Pete

hi sir , i download the above

hi sir , i download the above program it is detected the object its fine,but i am using for distance comparison like in an blind robot. but it is not detected the compare value .i have attached the diagram.the same thing i have done in other way. iam calculating the pulse multiply with 62.5 nanosec and then by 34000/2 so the final distance is in cm. please find the attachment.

VNIT

hii sir i want to compare "

hii sir i want to compare " distanceMeasure" with my reference value. and output gives to the motor,but when i connected to my launchpad , it is not showing any high value , may be this is because of variable i used wrong syntax. if any changes tell me . thanking you

VNIT

ok thanks sir. here

ok thanks sir. here "distanceMeasure" is a variable if i want to use this variable, how can i used it.

VNIT

You use it however you want.

You use it however you want. You can display it on an LCD, you could send it out over a serial port, you could use it as input to your robot control.
What do you want to do?

it's working but the result

it's working but the result in not proper.. i want to detect the distance upto 10 cm.so i think the off time should be 60 milisec. so what should i do foe making off time 60 milisec. thanks in advance..

VNIT

thanks for your answer , i

thanks for your answer , i will check it.

Hi Yogesh,There are a couple

Hi Yogesh, There are a couple ways to do this depending on what you're looking for.

  • For a floating point fixed frequency repeating ramp, use
    Blocks > Signal Producer > sawtooth

  • For a fixed-point fixed frequency repeating ramp, use
    Diagrams > Toolbox > Fixed-point > Ramp16
    Diagrams > Toolbox > Fixed-point > Ramp32

  • For a fixed-point variable frequency repeating ramp, use
    Diagrams > Toolbox > Fixed-point > VariableFrequencyRamp32

how to generate 10 microsec pulse signal

thanks for ur answer.. i want generate 10 microsec pulse for ultrasonic sensor interfaced with msp430G2553. for triggering purpose, how will i generate this . thanks..

VNIT