Asm sleep - pbp sleep


Results 1 to 32 of 32

Threaded View

  1. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: Asm sleep - pbp sleep

    I read somewhere in microchip datasheets there might be a @NOP just past the @SLEEP ...

    INT1 is the wakeup event.

    here it has been working fine for me ... for about 15 years ! ( Lawn tractor computer ... )

    Code:
    Sommeil:
    
    	LCDOUT $FE,2, "BYE-BYE "
    
    	For I = 8 to 0	Step -1					'Animation arret
    	
    		LCDOUT 	$FE,$C0,REP "*"\I," "			'	...  4s 			
    		PAUSE 500
    		
    	NEXT I
    	
    	PORTB.4 	= 0					'Ports LCD à 0
    	PORTB.5 	= 0
    
    	PORTC.7 	= 0					' PortC à 0
    	PORTC.6 	= 0
    	PORTC.5 	= 0
    	PORTC.4 	= 0	
    	
    	
    	AlLCD 		= 1					' Coupure LCD
    	AlRef 		= 0					' Coupure Vref	
    	ADCON0.0	= 0					' Désactivation ADC
    
    	
    	T3CON.0		= 0				' arret TMR3
    	T1CON.0		= 0				' arret TMR1
    	T0CON.7 	= 0				' arret TMR0
    	
    	INTCON.7 	= 0			' Wakeup sans interruptions
    	
    	INTCON3.0 	= 0						' reset flag INT1
    	INTCON3.3 	= 1			' validation INT1 pour réveil
    
    	Alim		= 0			'Coupure alimentation
    	Signal 		= 0			'Extinction voyant régime
    				
    @ SLEEP
    @ Nop						' Redémarrage par mise du contact sans coupure générale
    							' Arret par décharge capa alim. 
    
    	
    	INTCON3.3 	= 0			'Neutralisation INT1
    	INTCON3.0 	= 0			'Reset Flag INT1
    	Alim		= 1			'Remise alimentation si remise contact rapide.
    	
    '*****************************************************************************
    Wakeup: 'Début du Programme - reveil du PIC / Affichage Memoire
    '*****************************************************************************
    '
    FLAGS 	= 0					' Validation Reset LCD
    
    	PORTB.4 = 0					'Ports LCD à 0
    	PORTB.5 = 0
    
    	PORTC.7 = 0					' PortC.4-7 à 0
    	PORTC.6 = 0
    	PORTC.5 = 0
    	PORTC.4 = 0
    	
    Reveil 	= 1
    LSelect	= 0
    Alain
    Last edited by Acetronics2; - 12th May 2020 at 16:12.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Can't @sleep
    By MOUNTAIN747 in forum General
    Replies: 3
    Last Post: - 30th December 2010, 17:29
  2. Trying to add a sleep function or pretend to sleep
    By lilimike in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th May 2010, 19:10
  3. Help with PBP 'SLEEP' command
    By dreadmaul in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 18th November 2006, 07:40
  4. How to go to sleep
    By savnik in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd September 2006, 18:38
  5. Sleep Mode in PBP
    By Keith in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th March 2005, 20:58

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