![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| hello, I am workng on an ultrasonic distance meter.it is based on this project: http://www.eb.uah.edu/~wells/cpe437_sp_00/hrf/index.htm the minimum distance that my circuit shows is 279mm,I changed the delay of minimum distance in software but I still have 279mm min distance instead of a smaller output . now my question is: Is this limitation due to hardware(my ultra sonic sensors) or I should change my software in order to measure shorter distances? | |
| |
| | (permalink) | |
| Quote:
But both of these conditions will cause false triggering if the delay is too short, I suspect your minimum distance may well be set elsewhere in the software. | ||
| |
| | (permalink) |
| Hello Thanks for your reply. This is part of my codes whitch defines the value of delay in receiving signal,I changed the value of 240 to a lower one but I didn't see any difference. Code: RECEIVE movf MASK,W
btfsc STATUS,Z
goto DEFMASK ;if mask 0 do default delay
movf MASK,W
movwf LOOPB
goto MASK1 ;perform mask delay
DEFMASK movlw D'240'
movwf ANSA1
movlw D'2'
movwf ANSA2
DEFMLP decfsz ANSA1,F
goto DEFMLP
decfsz ANSA2,F
goto DEFMLP
goto MASK0
MASK1 movlw D'2' ;masking delays
movwf ANSA2
movlw D'48'
movwf ANSA1
MASK2 movlw D'4'
movwf ANSA3
MASK3 decfsz ANSA3,F
goto MASK3
decfsz ANSA1,F
goto MASK2
decfsz ANSA2,F
goto MASK2
decfsz LOOPB,F
goto MASK1
MASK0 bcf INTCON,RBIF ;clear RB4-RB7 interrupt change flag
bcf ZERO,0 | |
| |