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.

Pic 16f88

Status
Not open for further replies.

no1010

New Member
Pic 16f88 Paralell operations

Hi,

I'm studying Mechatronics and they gave us a rather complicated microcontroller task in our first semester. We have to program it in Assembly!

I'm having some problems with my program, I know how to do each part seperately, but I do not know how to combine them and make them run simultaneously.

What I am trying to do is to have a stepper motor run, it's speed can be chaged with a pot, and a photointerrupter counting the amount of turns/second and then displaying the output in binary up to 10.

I'm still busy with getting the steper motor to run, I'm having some trouble with noise, but I have no idea how to do the counting, then the math and displaying it while the motor is still running. As far as I understand it, microcontrollers run linear and cannot do parralell operations. How would I solve this problem?

Thanks in advance!
 
Last edited:
Firslty you need to look at the tutorials at Nigel's pages

As far as parallel functions (I assume you mean multitasking) most processors run fast enough to appear multitasking!! counting, driving steppers and running a display will be easy for the smallest of devices.

As YOU control a stepper motor you will know the count before hand.

Ian
 
Use a timer interrupt to run the stepper motor and vary the time to speed up/slow down.

I don't understand why you need a photo interrupter as the speed is simply how fast you step it. However, connect it to RB0 and use an interrupt to count.

Read the ADC and write the display in your main code and all should work well.

I posted some stepper code in C in this thread which might be usefull.

Mike.
 
Hi thanks for the replies,
the reason I'm using a photo interrupter and not reading the speed directly is because my lector wants me to do some calculations before showing an output.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top