LED flickering project

Discussion in 'Embedded Systems and Microcontrollers' started by John12345, Feb 20, 2009.

  1. John12345

    Thread Starter New Member

    Feb 16, 2009
    3
    0
    i have programed HEX file(LED flickering HEX was downloaded from web. Had verified with simulation software, it works) into the PIC16F84A chip.
    After assembling the circuit, the LED lights up but did not blink. Could it be bad IC?
    Have tried programed another HEX file into chip but this time no looping in the program what the program does is to detect a high on portA pin 1, and if detected it light up the LED on portB pin 1. For this HEX file it works.
    From the above experiment i found that whenever i burn a program which involve braching (loop, call, goto) instruct. the program will run and halt at branching intruction. for example
    org 0x00
    bsf status,5
    clrf trisb
    bcf status,5
    start
    movlw 0xff
    movwf portb
    call delay
    clrf portb
    call delay
    goto start
    end
    So for above program, i see all led light up at portb, but did not blink. Anyone experience the same problem or has a solution.

    Thanks in advance
     
  2. Skeebopstop

    Active Member

    Jan 9, 2009
    358
    3
    The LEd might just light up because that port is 'defaulted' to what turns the LED on at power up. This therefore should not necessarily be an indication that your code is even running.
     
  3. John12345

    Thread Starter New Member

    Feb 16, 2009
    3
    0
    yup agree with u. But i have already verified by changing the program sequence that is by putting the call delay right after the start label. By doing so i found the led doesn't light up at all. But when i program back the original program i got the same output that is all led light up but did not blink.
     
  4. maxpower097

    Well-Known Member

    Feb 20, 2009
    795
    388
    There was a similar issue with a LED flicker program with the PIC32. Could it be that the simulation runs much much slower then the actual chip and the chip is flashing so fast it looks solid?
     
  5. Skeebopstop

    Active Member

    Jan 9, 2009
    358
    3
    write it in C and I might help you :)
     
Loading...