![]() | ![]() | ![]() |
| | |||||||
| 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) |
| I needed your help to check my program. I want to control a basic mobility robot using Ultrasonic sensor and PIC 16F84A. I have using PING))) Ultrasonic Sensor by parallax company. This type about feature of these sensor : Voltage supply : 5 V Range : 2cm to 3meter Burst frequency : 40 Hz Input Triger : Positive TTL pulse, min 2us, 5us typ. Encho pulse : Positive TTl pulse min 115us to 18.5ms Encho hold-off : 750us Delay before Next measurement 200us. Burst travels through the air: 1130 feet per second. I have tried these program, but it's not available. I want these sensor recomand high if it detact some object <80cm. So, can u help me to check this program : ------------------------------------------------------------------------------------------------------- ;Ping ultrasonic sensor list p=16f84 radix hex ;---------------------------------------------------------------------- status equ 0x03 porta equ 0x05 portb equ 0x06 PWM equ 0x0c count equ 0x0d temp equ 0x0e loop equ 0x0f as equ 0dh ;--------------------------------------------------------------------- c equ 0 ;--------------------------------------------------------------------- org 0x000 start movlw 0x00 tris portb movlw 0xFF tris porta movlw 0x00 movwf portb main clrf count clrf PWM bsf portb,3 ;start command to sensor 6us movlw d'2' ;delay 2*3 clock delay movwf count call delay bcf portb,3 ; movlw 50 ; wait 500us movwf as X2 nop nop nop nop nop nop nop nop nop nop decfsz ,X2 goto X2 movlw d'5' movwf count A0LOW btfss porta,0 goto A0LOW A0HIGH incf PWM ; recived signal measurement by sensor call delay nop btfsc porta,0 goto A0HIGH movf PWM,w sublw d'200' btfsc status,c goto skip1 movlw d'200' movwf PWM skip1 movf PWM,w sublw d'20' btfss status,c goto skip2 movlw d'20' movwf PWM skip2 movlw d'1' movwf count bsf portb,0 LoopPWM call delay nop nop nop decfsz PWM goto LoopPWM bcf portb,0 movlw d'15' movwf loop del15 movlw d'255' movwf count call delay decfsz loop goto del15 goto main ;---------------------------------------------------------------------- delay movf count,w ; delay loop movwf temp del decfsz temp ; 3 clock cycles per delay loop goto del return ;---------------------------------------------------------------------- end ;---------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------- It's program is compatable or not. Please tell me what its problem. Thanks for ur help. | |
| |
| | (permalink) |
| Please do not post the same message in different forums. It does not help you to get more responses and just makes it harder for everyone to keep track of what you have been told. | |
| |
| | (permalink) |
| I agree but I can't find any other threads, perhaps a moderator has done the decent thing and deleted them. Notice how the emphasis of this thread has changed from your question to the fact that you've made duplicate threads? You know how to prevent this from happening don't you? Do not make duplicate threads!
__________________ I also post at the following sites: http://www.stop-microsoft.org http://www.heated-debates.com Screen name: Aloone_Jonez And http://www.silicontronics.com, same screen name as here. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Using Oscilloscopes | mechie | Electronic Theory | 9 | 29th November 2007 10:49 PM |
| request ultrasonic sensor information | Alex Ng | Robotics Chat | 20 | 11th March 2007 06:59 PM |
| Need PIC16F84A Cool Project | Agent 009 | Micro Controllers | 158 | 11th March 2007 07:15 AM |
| Radio control with PIC16F84 | jox3000 | Electronic Projects Design/Ideas/Reviews | 1 | 27th September 2006 05:13 PM |
| pic16f84 to control ac appliances | vortech1 | Micro Controllers | 2 | 27th April 2004 03:07 PM |