Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 11th October 2007, 07:59 PM   (permalink)
Default Question.... Two programs running in the same time

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.
kikefasa is offline  
Old 11th October 2007, 08:29 PM   (permalink)
Default

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.
ronsimpson is offline  
Old 11th October 2007, 09:22 PM   (permalink)
Default

Quote:
Originally Posted by kikefasa
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!.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 11th October 2007, 09:43 PM   (permalink)
Default

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 ?
kikefasa is offline  
Old 11th October 2007, 09:51 PM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 11th October 2007, 09:58 PM   (permalink)
Default

Who I do that?
kikefasa is offline  
Old 11th October 2007, 10:13 PM   (permalink)
Default

Quote:
Originally Posted by kikefasa
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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now  
Old 12th October 2007, 12:26 AM   (permalink)
Default

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.
ssylee is offline  
Old 12th October 2007, 01:35 AM   (permalink)
Default

Quote:
Originally Posted by Nigel Goodwin
- you could write a real time multitasking OS, but you absolutely cripple performance
I would not suggest using a RTOS on the 16F84 but they do have their place.
3v0 is online now  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Using Oscilloscopes mechie Electronic Theory 9 29th November 2007 10:49 PM
10 MHz only WWW time signal receiver atferrari Electronic Projects 3 6th July 2007 02:17 AM
Logic switching time on an input port question FusionITR Micro Controllers 8 24th March 2006 03:58 PM
Multisim Simulation Speed Question otacustes Electronic Projects Design/Ideas/Reviews 8 23rd March 2006 07:20 PM
PBX question waqar Electronic Projects Design/Ideas/Reviews 0 30th March 2003 07:21 PM



All times are GMT. The time now is 09:38 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker