Thread: Discussion Diy esc brushed for car
View Single Post
Old Nov 29, 2012, 06:36 PM
future88 is offline
Find More Posts by future88
Registered User
Joined Oct 2012
115 Posts
Quote:
Originally Posted by rc my life View Post
version 12F617, tone * beep * from the motor was missing.

insert the one tone * Do Re Mi * or 3 tone * beep beep beep * (Frequency on 50hz to 500hz ) when determining the neutral position.

like the type esc that I have met

 add ASM code of the command? position? If program changes are not too difficult, please help me

thank so much
Bruce abbot has writing tone program verison 12f617

;================================================= ==================================
; 'Beep' the motor
;================================================= ==================================
Beep: return


you just need to insert the code version 12f675 in code propram 12f617

; Play a 2KHz 'beep' sound for 1/8 second, to indicate successful arming.
; (uses the motor as a speaker!)
;
PlayBeep:
clrf PwmCount
beep1: movlw ON_FORWARD
movwf GPIO ; motor on
movlw 5
movwf PwmPeriod
beep2: clrwdt ; for 22uS
decfsz PwmPeriod,F
goto beep2
movlw OFF_FORWARD
movwf GPIO ; motor off
movlw 128
movwf PwmPeriod
beep3: clrwdt
decfsz PwmPeriod,F
goto beep3 ; for 0.5mS
decfsz PwmCount,F
goto beep1 ; 256 cycles

; wait for end of next servo pulse

servo_hi: btfss GPIO,ServoBit
goto servo_hi
servo_lo: btfsc GPIO,ServoBit
goto servo_lo

; ready to go!
movlw ON_STOP
movwf MotorON ; Motor FETs OFF
movlw OFF_STOP
movwf MotorOFF ; Direction FETs OFF

clrf PwmWidth ; PWM=0

movlw PRECHARGE
movwf ServoCount ; precharge ServoCount

goto MainPwmEntry
future88 is offline Find More Posts by future88
Reply With Quote