Home     Contact     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS     Terms of services     Privacy policy  
   
 Home      Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science   



Miscellaneous Instructions

A couple more instructions are left to fulfill the instructions set summary of the PIC 16F88 devices:

Instruction Description
NOP This instructions is the No Operations instructions and does nothing at all.

CLRWDT This instructions will reset the Watchdog Timer

SLEEP This instructions will put the chip into Sleep mode


Now, let's see the instructions one by one:



NOP

This is the No Operation instructions. When this is executed, nothing will happen at all. It has no occurrence to anything on the chip or program. This instructions is commonly used to create time delays for synchronization or other purposes.



Example
          nop    ;This program will do nothing at all
          nop
          nop





CLRWDT

This instructions will clear the Watchdog timer. The Watchdog timer is a very useful independent on-chip timer that is used to ensure the chip is operating normally. When the Watchdog Timer is enabled, it will then require periodically a Watchdog Timer software reset via this instruction. The programmer needs to have put this instructions in strategically positions where it will periodically reset the Watchdog Timer. If the timer is not reseted within a preselected time period, the Watchdog Timer will reset the PIC and the program will start over, because it will assume that the program flow is interrupted of fallen into an infinitude loop. The Watchdog Timer will be extensively explained on the advanced book pages.



Example
          .
          .
          CLRWDT     ;The Watchdog Timer is reseted
          .
          .


SLEEP

This instruction will put the chip into Sleep mode. Sleep mode is a state where the PIC will draw as low as 0.1uA current, and it will only have some basic operations still running for waking it up. The Sleep mode is basically for power maintenance.

When the SLEEP instruction is excecuted, the Watchdog timer and it's prescaller are cleared. The Power Down bit (-PD) is also cleared, and the Time Out Status bit (-TO) is set. The chip then goes into Sleep mode and the oscillator stops.



Example
          .
          .
          SLEEP     ;The chip is gone into Sleep mode
          .
          .










Previous page ---- Next page



Go back to the book contents

Go to the discussion forum of this book





 

Comments

  Name

  Email (shall not be published)

  Website

Notify me of new posts via email


Write your comments below:
BEFORE you post a comment:You are welcome to comment for corrections and suggestions on this page. But if you have questions please use the forum instead to post it. Thank you.


      

No comment yet...

Be the first to comment on this page!
 






No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise without the prior written permission of the author.

Read the Disclaimer


All trademarks used are properties of their respective owners.
Copyright © 2007-2009 Lazaridis Giorgos.
All rights reserved.






 HOT in heaven!


  • Disclaimer
  • Book Contents
  • Discussion forum

  • Basics
  • What will you need
  • Choosing the right PIC
  • The MPLAB
  • Getting familiar with the MPLAB environment
  • Creating a new project
  • Open and close projects
  • Creating new files and including them in the project
  • Your very first assembly program
  • Compile a program and transfer to the PIC
  • Section 1: Beginner's theory
  • Memory Organization
  • The Data Memory Organization
  • The Program Memory Organization
  • The instructions
  • General knowledge about instructions
  • Value Loading Instructions
  • Program Flow Instructions
  • Mathematic Instructions
  • Logic Function Instructions
  • Bit Orientated Instructions
  • Byte Orientated Instructions
  • Miscellaneous Instructions
  • The Basic Special Function Registers
  • The Status Register
  • The Option_Reg Register
  • The TRIS and PORT registers
  • Beginner's PIC Tutorials
  • How to use our PIC Tutorials
  • A Pushbutton turning an LED on and off
  • A Simple LED Flasher
  • Interfacing Multiple Switches - The internal Pull-Up resistors
  • An LED Sequencer
  • Interface a Single 7seg Digit
  • Interface Multiple 7seg Digits
  • A 3-digits Decimal Counter
  • A Clever Button
  • Section 2: Intermediate theory
  • Instruction Cycle Duration and Calculated Delays
  • The Timer Modules - Timer0
  • The Timer Modules - Timer1
  • The Timer Modules-Timer2



  • NEW in heaven!



    New Theory: AC electric motor working principle






     Contact     Forum     Projects     Experiments     Circuits     Theory     BLOG     PIC Tutorials     Time for Science     RSS   

    Site design: Giorgos Lazaridis
    © Copyright 2008
    Please read the Terms of services and the Privacy policy