Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

hello

Status
Not open for further replies.
You mean the clock speed? It depends on the PIC and whether you want to use an external crystal or the internal oscillator. What PIC are you using?
 
i juz want to make a reference speed for my dc motor controller..
then the reference speed will be compare wif the current speed it running at..
actually i want to maintain my dc motor'speed
can u xplain hot to make it...
is't correct if i declare reference = 8x5/256
i'm using pic16f873....
n i'm using resonator(external)....
 
2 things

1. Single Post (erase other one) (click edit then delete)
2. Type slow and check spelling. I can barely read what you wrote.

i juz want to make a reference speed for my dc motor controller..
then the reference speed will be compare wif the current speed it running at..
actually i want to maintain my dc motor'speed
can u xplain hot to make it...
is't correct if i declare reference = 8x5/256
i'm using pic16f873....
n i'm using resonator(external)....
I just want to make a reference speed for my DC motor controller.
Then the reference speed will be compared with the current speed it is running at.
Actually i want to maintain my DC motor's speed

Can you explain how to make it?
Is it correct if i declare reference = 8x5/256
Also i am using a PIC16F873 and a external resonator.

Now can't you read that better?

To be honest i can't help you here but i am sure you will get help if you just ask the right way.
 
Last edited:
sorry for the mistake...
ok actually i'm trying to make a source code to control dc motor's speed(to maintain speed)...but the prob is i do not know how to set the reference speed in my microcontroller....i'm using PIC16f873...
is it correct if i declare reference = 8x5/256 to get reference speed = 0.156V
or what should i do to set the reference speed??
 
What are you using to measure the speed with? optical encoder? ADC and another dc motor? motor back EMF? etc....
Post a schematic. That'll make coding advice more relevant.
 
this is the schematic...

i'm using dc motor also for the speed detection...
i already try simulate using isis's software...but i dont know how to connect both dc motor...n all my led on once i run the simulation with both of the motor separate...can anyone xplain????plzzz
 

Attachments

  • BLINK.asm
    2.6 KB · Views: 120
Hmmmm... This circuit and code looks familiar:
code:
**broken link removed**
Main page:
**broken link removed**
Why don't you follow the instructions on the site?
 
i have....but the explanation is not clear..
i do not know how to setting the frequency...
in the pic tutorial also not xplain more detail...
do u know any tutorial site about how to setting frequency,period of pwm etc for pic
 
The frequency is set by the code and the crystal connected to pins 9&10 of the pic16f873. See the highlighted code below:

Code:
;*** PWM initialization
        clrf    tmr2            ;Clear TMR2 register
        movlw   b'11111111'     ;Max duty (low speed)
        movwf   ccpr1l          ;Set CCPR1L register
        bsf     status,rp0      ;Change to Bank1
        [COLOR="Red"]movlw   d'255'          ;Period=1638.4usec(610Hz)
        movwf   pr2             ;Set PR2 register[/COLOR]
        bcf     status,rp0      ;Change to Bank0
        movlw   b'000001[COLOR="Red"]10[/COLOR]'     ;Pst=1:1 TMR2=ON [COLOR="Red"]Pre=1:16[/COLOR]
        movwf   t2con           ;Set T2CON register
        movlw   b'00001100'     ;CCP1XY=0 CCP1M=1100(PWM)
        movwf   ccp1con         ;Set CCP1CON register
Isn't the code with the original author's comments much easier to read? :rolleyes:
 
Status
Not open for further replies.

Latest threads

Back
Top