RA3 won't get a high level.


Closed Thread
Results 1 to 15 of 15

Hybrid View

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

    Default RA3 won't get a high level.

    Hello, I'll put it short:

    -PIC 16F628A
    -Vdd is 5.04 Volts
    -Quarz is available
    -PORTB can give a high level.

    Problem:
    -RA3 doesn't get a high level.

    Done so far:
    Code:
    -
    Start:
    	CMCON.0 = 1
    	CMCON.1 = 1
    	CMCON.2 = 1
    
               Pause 5000
    -	Trisa.3 = 0
    	High Porta.3
    	Pause 5000
    	Low Porta.3
               GOTO Start
    -Ideas ?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    All fine here... Depending your osc and config fuses setting it may work or not.

    Make sure you're using a 20Mhz Crystal (and a PIC16F628-20), MCLR pin set to Vdd, and try that one and post your results
    Code:
            @ __CONFIG  _HS_OSC & _MCLRE_ON  &  _LVP_OFF & _WDT_OFF & _PWRTE_ON  & _BODEN_ON  
            DEFINE OSC 20
            PORTA=0        
            TRISA=0
            CMCON=7
    
    Start:  TOGGLE PORTA.3
            PAUSE 500
            GOTO START
    Last edited by mister_e; - 5th February 2007 at 20:22.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    In MPLAB having @ __CONFIG _HS_OSC & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON included.
    Code:
    Error[118]   C:\PIC\XYZ.ASM 106 : Overwriting previous address contents (2007)
    Error[118]   C:\PIC\XYZ.ASM 106 : Overwriting previous address contents (2007)
    Loaded C:\PIC\XYZ.COD.
    BUILD SUCCEEDED: Mon Feb 05 21:24:52 2007
    Having it removed, it compiles. I changed the conf.bits via menu according to your idea.

    What happens(RA3):
    Moment of Low: 0V
    Moment of High: 0,71V

    Other PINS
    Moment of Low: 0V
    Moment of High: 5V
    Last edited by selbstdual; - 5th February 2007 at 20:38.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Seems you didn't have a look to the thread i suggested, but anyways...

    RA.3 is a full CMOS output type, so unless
    1. you have this pin shorted to gnd
    2. this i/o is blow

    it have to work. Try with another PIC.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #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.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i didn't check the whole thing but i confirm that it blink PORTB.5 led, then turn on the LED on PORTA.3, then turn it off.

    Your PIC i/o is dead OR there's a bad contact.

    And i posted a link before in post #2 about the config fuses.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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