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.

Encoder 1024PPR/PWM

Status
Not open for further replies.

saleem4289

New Member
Dear Expert,
Kindly Help my friend make code for me with Bascom-AVR, encoder 1024PPR and motor RPM is 1400, I need pwm out put.

Awaiting your help,
Asif.
$regfile = "m8def.dat"
$crystal = 1000000

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Dim Yard As Word
Dim Cb As Byte
Dim B As Bit
Dim Y As Word
Config Timer0 = Counter , Edge = Rising

Stop Timer0


Tccr1a = &B10100011
Tccr1b = &B00000001

Config Portb = Output
Config Portd.0 = Input
Config Portd.1 = Input
Config Debounce = 10

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Do
For Cb = 1 To 10 Step 1
Debounce Pind.0 , 1 , Int0_isr , Sub
Debounce Pind.1 , 1 , Int1_isr , Sub

Start Timer0
Waitms 100
Stop Timer0
Yard = Yard + Counter0 : Counter0 = 0
Next

Pwm1a = Yard
Yard = 0 : Cb = 0
Loop
End
 
Status
Not open for further replies.

Latest threads

Back
Top