×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

anyone using Pic16f452 ?

anyone using Pic16f452 ?

anyone using Pic16f452 ?

(OP)
can you tell me what is the best instruction which does not affect the program counter?

Thanks

RE: anyone using Pic16f452 ?

Uh, stopping the clock might do it, but I don't think there's an instruction for that.  And if there were, you'd never be able to execute the next instruction under program control.

By way of illumination, let me ask you this:  Why would you want to 'not affect' the program counter?

Mike Halloran
Pembroke Pines, FL, USA

RE: anyone using Pic16f452 ?

Where I'm going is this:  

I suspect that you are perhaps new to embedded system programming, and are asking a perfectly logical, classical 'noob' question, "How do I get my program to stop, and wait for an input, and then start up again?"  "When I program in a 'stop' command, it just stops, and never restarts."

The answer is, you write the program so it never, never, ever stops running, it just stops _appearing_ to do anything, but it really runs in a loop, constantly polling the input, i.e., asking the same switch, over and over, "Did the idiot out front do anything?", and repeating until it gets an answer different from "no".

I hope that helped, or at least didn't insult you.

Mike Halloran
Pembroke Pines, FL, USA

RE: anyone using Pic16f452 ?

Or you setup the appropriate interrupt and then execute the sleep instruction.  The processor then sleeps until the interrupt occurs.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com

RE: anyone using Pic16f452 ?

(OP)
you're right, i just started doing this about 2 months by myself, i bought few book and learn at home when i have time, i also bought some equipments to practice at home, thanks for the answer

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources