RA3 won't get a high level.


Results 1 to 15 of 15

Threaded View

  1. #5
    Join Date
    Aug 2006
    Location
    In a world of german electrons
    Posts
    102


    Did you find this post helpful? Yes | No

    Default

    I used another one and the same result.

    This pin is not connected yet so outer components don't interfere.

    Here's the whole code. It is a POT command replacement that fits to my circuit (RC = 420 µs). Normally Wert is replaced by Wert2's contents.

    If you are not german, you should understand it anyway(Wert means value, Zaehler = counter, Gelb = yellow and Gruen = green)...

    Code:
    Define OSC 8
    
    Variablen:
    PORTA=0        
            TRISA=0
            CMCON=7
    	TRISB = 0
    	PORTA = 0
    	;VRCON = $20
    
    
    	Gruene_LED VAR PORTB.5
    	Gelbe_LED VAR PORTB.4
    
    
    	ADCWert VAR WORD
    	Erster_Wert VAR WORD
    	Zweiter_Wert VAR WORD
    	Zaehler VAR WORD
    	Zahl VAR BYTE
    
    		;Interrupts
    		INTCON = 0
    Start:
    Zahl = 0
    FOR Zahl = 1 TO 4
    	High Gelbe_LED
    		Pause 167
    	Low Gelbe_LED
    		Pause 307
    NEXT Zahl
    GOSUB Wert
    	Erster_Wert = ADCWert
    	WRITE 0, Erster_Wert.BYTE0
    	WRITE 1, Erster_Wert.BYTE1
    
    Pause 2931
    
    Zahl = 0
    FOR Zahl = 1 TO 4
    	High Gruene_LED
    		Pause 167
    	Low Gruene_LED
    		Pause 307
    NEXT Zahl
    GOSUB Wert
    	Zweiter_Wert = ADCWert	
    	WRITE 2, Zweiter_Wert.BYTE0
    	WRITE 3, Zweiter_Wert.BYTE1
    
    Pause 2791
    
    IF Erster_Wert = Zweiter_Wert THEN
    	High Gelbe_LED
    	Pause 3140
    	Low Gelbe_LED
    	Pause 2010
    ENDIF
    
    IF Erster_Wert <> Zweiter_Wert THEN
    	High Gruene_LED
    	Pause 3140
    	Low Gruene_LED
    	Pause 2010
    ENDIF
    
    	GOTO Start
    
    Wert:
    	HIGH PORTA.3
            PAUSE 5000
    	LOW PORTA.3
    	RETURN
    
    Wert2:
    	ADCWert = 0
    	Trisa.3 = 0
    	High Porta.3
    
    	Pause 243
    	
    	Trisa.3 = 1			;Vertrauscht
    	WHILE Porta.3 = 1
    		ADCWert = ADCWert + 1
    	WEND
    	Zaehler = 600 - ( (600 / 1200) * ADCWert)
    	Pauseus Zaehler
    	RETURN
    END
    Which thread are you referring to ?
    Last edited by selbstdual; - 5th February 2007 at 21:44.

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. confused problem with interrupt in a working program
    By illuminator4 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th November 2008, 17:01
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Serin and TMR0
    By capitano in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2006, 14: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