Jump from ISR


Results 1 to 16 of 16

Thread: Jump from ISR

Threaded View

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


    Did you find this post helpful? Yes | No

    Question

    Hi, Yasser

    Ok, I begin to see ...

    How much time do the addresses contents have to be displayed on your LCD before displayin the next adress content ??? ( pause between EEPROM address increments )

    I begin to doubt seriously you need any kind of interrupt ( for the part we know ... of course)

    By the way ... which processor and memory do you use ???

    Alain

    PS: I had a moment and Threw that on the screen ...
    - Compiles Ok
    - But not tested ... the idea is here

    NO INTERRUPT !!!

    Re PS: Compiled AND Tested ...

    Code:
    ' Processor 16F877a @ 4Mhz
    
    'Yasser's light or text show
    
    '*****************************************************************************
    '*****************************************************************************
    ' 						IMPORTANT NOTE
    '*****************************************************************************
    '*****************************************************************************
    '	
    '			The 16F877a shows only 256 EEPROM Bytes ...
    '
    '       				  DO NOT ASK IT 1500 !!!
    
    '*****************************************************************************
    '*****************************************************************************
    
    '*****************************************************************************
    '*                  LCD Defines for EasyPic5                                 *
    '*****************************************************************************
      
    '    DEFINE LCD_DREG PORTB               ' I/O port where LCD is connected
    '    DEFINE LCD_DBIT 0
    '    DEFINE LCD_RSREG PORTB
    '    DEFINE LCD_RSBIT 4                  ' Register select pin
    '    DEFINE LCD_EREG PORTB
    '    DEFINE LCD_EBIT 5                   ' Enable pin
    '    DEFINE LCD_BITS 4                   ' 4-bit data bus
    '    DEFINE LCD_LINES 2                  ' LCD has 2 character lines
     
    '    DEFINE OSC 8
     '*****************************************************************************
    '*                        LCD Defines                                         *
    '******************************************************************************
      
        DEFINE LCD_DREG PORTD               ' I/O port where LCD is connected
        DEFINE LCD_DBIT 4
        DEFINE LCD_RSREG PORTD
        DEFINE LCD_RSBIT 2                  ' Register select pin
        DEFINE LCD_EREG PORTD
        DEFINE LCD_EBIT 3                   ' Enable pin
        DEFINE LCD_BITS 4                   ' 4-bit data bus
        DEFINE LCD_LINES 2                  ' LCD has 2 character lines   
    '*****************************************************************************
    'Chip initialization
    
    	ADCON0 	= 0
    	ADCON1 	= 7
    	CMCON	= 7
    	CVRCON	= 0
    	 
    '*****************************************************************************
    'Variables & aliases
    
    '	Scroll			var PORTA.0					' Start and Scroll up/dn button
    	Scroll			var PORTB.4					' Start and Scroll up/dn button
    
    
    	Index 			var Word
    	I				var Word
    	
    	Delay 			var Byte
    	Value			var Byte
    	
    	Cold			var Bit
    	
    'Variables initialization
    
    CLEAR
    
    	Cold	= 1
    
    '*****************************************************************************
    'Constants
    
    	Endaddress 		CON $FF' 05DC			'Memory last address to read
    	ScrollPause		CON 400					'ReadPause duration in ms
    	
    '*****************************************************************************
    'PORTS Initialization
    	 	 
    	PORTA = 0
    	PORTB = 0
    	PORTC = 0
    	PORTD = 0
    	PORTE = 0
    	TRISA = 0
    	TRISB = %00010000
    	TRISC = 0
    	TRISD = 0
    	
    '*****************************************************************************
    'LCD Initialization
    
    LCDOUT $FE,1								'Clearscreen
    PAUSE 700
    	
    '*****************************************************************************
    '*****************************************************************************
    Coldstart:
    
    Delay = 0
    BUTTON Scroll,1,255,0,delay,1,Released
    		
    IF cold THEN 
    
    	LCDOUT $FE,$80," Hello Yasser  " 	' Waiting Message
    	LCDOUT $FE,$C0,"Waiting for you"
    	cold = 0
    	
    ENDIF
    
    goto ColdStart
    
    Released:
    
    Delay = 0
    BUTTON Scroll,1,255,0,delay,1, Released	' Wait for button release
    
    LCDOUT $FE,1						'Clear Screen
    
    
    Increase:
    
    	Index = I
    	
    	FOR I = Index to (Endaddress - 1) Step 2
    
        	READ I,Value
    		LCDOUT $FE,$80, BIN8 Value,"  ",DEC3 I			'BIN8 for Binary, may be decimal or character
    		READ I+1,Value						
    		LCDOUT $FE,$C0, BIN8 Value,"  ",DEC3 I+1
    		PAUSE ScrollPause
            	
    		Delay = 0
    		BUTTON Scroll,1,255,0,delay,1,Decrease		'Reverse Scrolling requested ?
    				
    	NEXT I
    	
    	I = 0							'No toggle ... let's rewind	Index = 0
    	Goto Increase
    	
    	
    Decrease:
    
    	Index = I
    	FOR I = Index to 1 Step - 2
    
       	    READ I,Value
    		LCDOUT $FE,$80, BIN8 Value,"  ",DEC3 I			'BIN8 for Binary, may be decimal or character
    		READ I+1,Value						             
    		LCDOUT $FE,$C0, BIN8 Value,"  ",DEC3 I+1
    		PAUSE ScrollPause
    			
    		Delay = 0
    		BUTTON Scroll,1,255,0,delay,0,Increase		'Continue Reverse scrolling ?
    			
    	NEXT I
    	
    	I = EndAddress -1 							'No toggle ...let's rewind	Index = Endaddress		
    	Goto Decrease
    	
    
    	END
    Last edited by Acetronics2; - 4th May 2008 at 18:36. Reason: a little mismatch between I and Index ... LOL !!!
    ************************************************** ***********************
    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. DT-Ints latency and other interrupt conciderations
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 58
    Last Post: - 12th March 2010, 18:27
  2. ELSEIF Block Would be Good.
    By T.Jackson in forum PBP Wish List
    Replies: 30
    Last Post: - 14th May 2007, 03:36
  3. jump out from a for/next loop
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th March 2007, 15:50
  4. Jump into eeprom address
    By Lotondo in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd April 2006, 18:29
  5. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59

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