pic controller doesn't work properly


Closed Thread
Results 1 to 6 of 6
  1. #1

    Default pic controller doesn't work properly

    my PIC 18f452 doesn't simulate program in hardware it will blink the LED when i touch my hand to one of the pin of OSI1 & OSI0 (oscillator pins)..the progrram is simulated in proteous7.7..plz solved my problem..

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default Re: pic controller doesn't work properly

    Hmm, OK, I solved it!

    Ioannis

  3. #3
    Join Date
    Nov 2008
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: pic controller doesn't work properly

    Can you post the Code. Also What hardware are you using?
    Last edited by c_moore; - 23rd September 2011 at 00:43.

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

    Default Re: pic controller doesn't work properly

    nightrider

    Most likely source of your problem is you missed decoupling your circuit with 0.1uF capacitors. Second likely candidate is a noisy/bad switch mode power supply that you power your circuit with.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: pic controller doesn't work properly

    ;Test Program
    LIST P=PIC18F452, F=INHX32, N=0, ST=OFF, R=HEX
    #INCLUDE P18F452.INC
    CONFIG OSC=HS, OSCS=OFF
    CONFIG WDT=OFF
    CONFIG BOR = OFF
    ;CONFIG BORV=0, PWRT=OFF
    CONFIG PWRT=OFF
    CONFIG DEBUG=OFF, LVP=OFF, STVR=OFF

    ;Equates Section
    TRISB EQU H'0F93'
    PORTB EQU H'0F81'
    R1 EQU 0x07
    R2 EQU 0x08

    ORG 0000H

    CLRF TRISB
    MOVLW 0x55
    MOVWF PORTB
    L3 COMF PORTB,F
    CALL QDELAY
    BRA L3


    ;------------1/4 SECOND DELAY
    QDELAY
    MOVLW D'200'
    MOVWF R1
    D1 MOVLW D'250'
    MOVWF R2
    D2 NOP
    NOP
    DECF R2,F
    BNZ D
    DECF R1,F
    BNZ D1
    RETURN

    END

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


    Did you find this post helpful? Yes | No

    Default Re: pic controller doesn't work properly

    Code seems ok, but you don't need to redefine PORTB & TRISB... this is what the INCLUDE line does for you.

    You want to check MCLR pin, must be tied to Vdd.

    ALL VDD, ALL VSS pins MUST be connected.

    Check your crystal connection... and your capacitors around the crystal.

    Last thing, this is a Melabs PICBASIC forum here... with some tolerence & expertise for assembler
    Steve

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

Members who have read this thread : 1

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