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.

Question.... Two programs running in the same time

Status
Not open for further replies.

kikefasa

New Member
Hi,
I need to know, if is posible in the pic16f84a, to start a program, keep this program running, an start another, and Who?

Regards.
 
YES-----Almost!
A 16F84 and most computers can only do one program at a time. Your PC may look like it is working on many programs but it is only working on one at a time.

I have a PIC16Fxxx running a program most of the time. Every 0.01 seconds the computer jumps to an interrupt program. It runs for about 0.001 seconds then goes back to the main program. To the human eye it appears that both programs are running at the same time.
 
kikefasa said:
Hi,
I need to know, if is posible in the pic16f84a, to start a program, keep this program running, an start another, and Who?

The main question is why?.

Generally you can do what you want in this sort of thing, but it's far better to be specific - you could write a real time multitasking OS, but you absolutely cripple performance, as Windows does!.

I suggest you ask us exactly what you're trying to do!.
 
I use RA0, RA1, RA2 and RA3, to control a step by step motor. RA0 goes to the first coil, Ra1 goes to the second coil and etc.

I need that RA0, RA1, RA2 and RA3 run always, because the others pins, RB0-RB7 as been used to sensors and switches.

How I do to keep RA0, RA1, RA2 and RA3 working ?
 
Dead simple, and standard programming - you use a timer interrupt to move the stepper.

It's basically how Windows (or Linux) does multi-tasking, but without the overhead.
 
kikefasa said:
Who I do that?

Learn to program?.

For a start I would suggest dumping the antique 84?, it doesn't have a lot going for it - it's replacement the 16F628 is cheaper and higher spec.

My tutorials show how to use tmr2 to multiplex seven segment displays, or 64 LED's - similar timer code code be used to drive a stepper motor.
 
You can also get some sample chips from microchip for free. That goes for antique chips to the really fancy chips. For programming, on top of learning on some hardware characteristics from sample code and datasheets, may be helpful to look at structures of c programs as well or assembly.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top