Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
I tested the delay with the LED and the delay works. I than added the sonar() function and after 1 second the LED doesnt go back on. So the error has to be in the sonar function.
thanks to mgate and again after re-reading the data sheet I have added a 50 ms delay after it captures the distance data. But it's still not looping.
Again i think it might be that I'm using timer0mode1 gate controlled (for the time counter for the sonar) and now timer1mode1 for the 50 ms...
Ok so I got it working as it should. Only thing is now it's not always reading. I have it in the while(1) loop but every time i want to recapture new distance data I have to hit the reset button on the 8051. In other words it's not always reading data, only when the program starts. attached...
Hi I'm having trouble interfacing a sonar sensor and the 8051. I've searched around online and read the datasheet and have some code. I understand what needs to be done to implement the sensor but having a hard time getting it to work. It's a 3 pin sonar sensor. I have the signal pin connected...
I want to implement a sequential circuit using verilog that functions as a 4-bit universal shift register. The shift register will have two inputs that specifies which function the register will perform: 0 0- No change, 0 1-Shift Right, 1 0- Rotate Left, 1 1- Parallel Load
If the shift...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.