Other Parts Discussed in Thread: HALCOGEN
Tool/software: Code Composer Studio
Hello everybody,
I really like to program and learn to program and I'm very new at this.
I'm trying to make a ultrasonic sensor HC-SR04 work with my launchpadxl2 rm46.
The sensor work with 5v but that is not a problem, I use a Bi-Directional LLC to not fry my input pins on the controller.
The ultrasonic sensor have two control pins, one trigger and one echo pin.
In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo pin. The Echo pin will output the time in microseconds the sound wave traveled.
howtomechatronics.com/.../Ultrasonic-Sensor-Diagram.png
So i'm trying to use a PWM signal from the controller and use edge capture to see for how long the ultrasound burst travel, to calculate the distance.
I will put some photos with my code and my halcogen config. So far I haveno results and if anyone can help me understand how the n2het works will be great. I dont know if I read the right register or if I made the right config.