How to go to sleep


Results 1 to 10 of 10

Threaded View

  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302

    Default How to go to sleep

    I have this :
    Code:
    	DEFINE LCD_DREG	PORTB	
    	DEFINE LCD_DBIT 0	    
    	DEFINE LCD_RSREG PORTA
    	DEFINE LCD_RSBIT 2	    
    	DEFINE LCD_EREG	PORTA  
    	DEFINE LCD_EBIT 3	    
    	DEFINE LCD_BITS 4		
    	DEFINE LCD_LINES 2	  
    
    	DEFINE I2C_SCLOUT 1
    	
    	SCL var PORTA.1     
    	SDA	var	PORTA.0		
    
    	UP	    var	PORTB.6	
    	DOWN	var	PORTB.7		
    	CH_PAS	var	PORTB.5	 
    
    	Input	UP		     	
    	Input	DOWN
    	Input	CH_PAS
    
        b1	var Byte
        b2	var Byte
        b3	var Byte
        b5	var	Byte
    
        F1	var	Word
        F2	var	Word
        F3	var	Word
    
        ADDR1   VAR	Byte
        ADDR2	VAR	Byte
    	LOCK	VAR	Byte
    	TMP	    VAR	Word
    	TMP_LO	VAR	TMP.LowByte
    	TMP_HI	VAR	TMP.HighByte
    	PLLBASE	VAR	Word
    	PLL	    VAR	Word
    	LO	    VAR	PLL.LowByte
    	HI	    VAR	PLL.HighByte
    	PAS	    VAR	Byte
     loop:	
             Button UP,1,10,2,b1,1,MONTE	       
    		Button DOWN,1,10,2,b2,1,DESCEND	   
    		Button CH_PAS,1,255,0,b3,1,	CHOIX  		
    		PAUSE 100                          
      	    I2CREAD SDA,SCL,ADDR2,[LOCK]       
            GoSub AFFICHAGE		               
            GoTo loop

    and i want the pic to go to sleep if no button is pushed.And awake if i push any button.
    I have read the datasheet but i don't know how to make
    Pic is 16f84a
    Last edited by savnik; - 13th September 2006 at 13:33.

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Battery powered applications
    By NavMicroSystems in forum Off Topic
    Replies: 7
    Last Post: - 22nd June 2009, 07:12
  3. 16F628A current high during sleep
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th October 2006, 10:21
  4. Wierd sleep issue
    By orca in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th March 2006, 22:06
  5. SLEEP Command and Interupts 16F648A
    By ghoot in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 28th May 2004, 18:35

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts