Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: orchid on January 19, 2008, 09:57:31 AM

Title: interface LV maxsonar with tms320f2812 dsp chip
Post by: orchid on January 19, 2008, 09:57:31 AM
hi there,

I have bought 10 LV maxsonar, but i don't know how to implement it into my processor. Actually, i am using tms320f2812 dsp chip. Please help me how to connect the AN pin or TX pin to the processor. It is just connect the 3 pin only or there is another circuit have to be built? What kind of output will appear and how to see it? And if possible, I need a help with the programming in c.

Thanks
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: hazzer123 on January 21, 2008, 01:46:09 AM
From the sonar datasheet -
· All interfaces are active
simultaneously
· Serial, 0 to Vcc
· 9600Baud, 81N
· Analog, (Vcc/512) / inch
· Pulse width, (147uS/inch)

None of them require any external circuitry i don't think, maybe a small noise reducing capacitor on the analogue output/ I would use the RS232 serial personally, since it isn't subject to noise. Connect Tx of MCU to RX of sensor and vice versa.

There will almost definately be a library in you software which gives easy to use functions for use with the usart.
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: orchid on January 25, 2008, 01:13:34 AM
I am using AN pin because I would like to use more than 5 sensor. Now, I just use the evaluation software for the tms320f2812 provided by the company to test the sensor. I am using ADC module application. When I connect the AN pin to the ADCINB0, the output is fine but not changing while I change range of the distance of the obstacle(here I using box). If I off the evaluation, then change the distance, turn on the evaluation, the output will change according to the distance. Why it is like that? I think supposedly the output will change with the distance without turn off the evaluation. Then, when I connect it to the other pin of the MCU (ADCINB1-5), the output will static at 0.825V even I change the distance and turn off and on the evaluation. Do you have any idea about it?



"There will almost definately be a library in you software which gives easy to use functions for use with the usart."
What do you mean by usart?
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: Admin on January 25, 2008, 09:34:01 PM
orchid, I don't quite understand what you are trying to say . . . could you rephrase it?

I would just hook the output up to the ADC on my microcontroller, as that is the simplest method.

Quote
What do you mean by usart?
http://www.societyofrobots.com/microcontroller_uart.shtml
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: orchid on January 27, 2008, 07:08:45 PM
I have connect the AN to my micro controller as you do, and I got the output but I am not sure about it. When I put the box 10 inches from the sensor, the output is 0.35V. I think supposedly the output is 0.1V if we used the formula (Vcc/512)/inch right? Then,  I wonder why is the output still remains at 0.35V even I put the box 39.37 inches (1 meter) far from the sensor? How to trigger the sensor?
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: hazzer123 on January 27, 2008, 07:14:17 PM
Use a multimeter connected to the AN pin on the sensor to be sure that the voltage is varying.
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: Admin on January 27, 2008, 07:23:05 PM
Quote
When I put the box 10 inches from the sensor, the output is 0.35V. I think supposedly the output is 0.1V if we used the formula (Vcc/512)/inch right? Then,  I wonder why is the output still remains at 0.35V even I put the box 39.37 inches (1 meter) far from the sensor? How to trigger the sensor?
this might sound kinda dumb but uhhh . . . are you sure its not bouncing off the ground and returning before it reaches the box? i mean, sonar isn't a beam, its more like a wide cone.

aim at the ceiling and see what happens.
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: orchid on January 27, 2008, 08:58:55 PM
I've already use the multimeter as told and the output is vary according to range. but when i attach the sensor to dsp board and use the ADC module, the output is not as expected. Is there anyone familiar with this software. i used it as an emulation but if you all can see, the output is so small even i move the object or change the pin on my dsp board. this output is for 10 inch object. hope that someone can help me. thanks. best regard. (http://i7.photobucket.com/albums/y273/mujahid1012/adc1.jpg)
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: Admin on January 31, 2008, 09:14:33 PM
Quote
I've already use the multimeter as told and the output is vary according to range. but when i attach the sensor to dsp board and use the ADC module, the output is not as expected.
hmmm I've never used that software . . .  but just a stupid check . . .

are you sure you are reading the same pin you plug it in to? grounds are common, right?

can you plug something else into the ADC module, like a 1.5V battery and see what it reads?
Title: Re: interface LV maxsonar with tms320f2812 dsp chip
Post by: orchid on February 03, 2008, 07:22:05 PM
i've already use 1.5V dc supply and the graph show the exactly the value that is 1.5V. But when i tried with MaxSonar sensor, the output not as expected. the connection is correct and i've tried with other MaxSonar sensor, the result is the same. i have 10 MaxSonar sensor and tried it all. Do i really have to do this test? and how i am gonna get the output variable to insert it into my source code.