pic 16F684

Thread Starter

rp216

Joined Apr 5, 2013
20
Tmr2Setting EQU B'00000111' ;Timer2:no postscale,Timer2 on,/16 prescale
CCP1Setting EQU B'00001111' ;CCP1:pWM mode only 8 significant bits
PWMPeriod EQU 0xFF

Setup MOVLW PWMPeriod
MOVWF PR2 ;Set PWM period
BCF STATUS,RP0 ;Set bank 0.
MOVLW Tmr2Setting
MOVWF T2CON ;Set up Timer2 for PWM
MOVLW CCP1Setting
MOVWF CCP1CON ;Set up CCP1 for PWM
MOVLW 0xFF
MOVWF CCPR1L ;Setinitial PWM Duty cycle


PWM_Out ;PROCEDUREPWM_Out
MOVF Output,W
MOVWF CCPR1L
RETURN ;END PROCEDURE


came up something with this..with my values..is it oki?
 

tshuck

Joined Oct 18, 2012
3,534
i havent tested it out yet...i am still stuck with this values..my supervisor it doesnt matter if my PWm frequency is low..he just needs to see first my program and calculations.

i didnt get what you meant by " (100<< 2)".

electronics is really hard !
It is a left shift operation.... denoting shifting left twice.

For the third time, do you have an output waveform? If so, what is your program and ouput characteristics...
 

Thread Starter

rp216

Joined Apr 5, 2013
20
according according to the program i will have an output waveform.

from my earlier calculations :

my PWM period will be 2.048ms
my PWM frequency will be 488HZ
 

Thread Starter

rp216

Joined Apr 5, 2013
20
i will get a waveform of 9.78% dutycycle.

*on the hardware part....i have yet not tested it*

i am sincerely not understanding this concept
 
Servo is one energetic motor, it has a powerful concept of maintaining using your application. Some following idea may be useful for you.

To controlling servo motor from your c# application you must have a knowledge of required components.
Following components are needed to attach servo motor to your computer
1)servo motor
2)drive
3)axis card
4).NET library

for widely knowledge please click here!!

http://everysolutionshere.blogspot.in/2013/05/c-code-for-servo-motor-with-pci-8134.html
 
Top