Menu

Blink LED 16F84A Problem

Help
2008-12-03
2013-05-30
  • Nobody/Anonymous

    Hi am new to the world of pic and have been trying to blink an LED for a while now and havent managed to do so with GCBASIC

    The circuit i am using is http://www.voti.nl/blink/pics/b-84a-150.gif (without the D-plug)

    When i use the HEX file supplyed with the Diagram it works fine, but when i use my code is does nothing...

    my code is:

    #chip 16F84A, 20

    MAIN:
    SET PORTA.0 high
    Wait 1 s
    SET PORTA.0 Low
    Wait 1 s
    goto MAIN

    Any ideas that might help me resolve this?

    Thanks

    Dan

     
    • Nobody/Anonymous

      I have fixed the problem now i added

      dir portA.0 out

      thanks anyway

       
    • kent_twt4

      kent_twt4 - 2008-12-03

      Still good to know, because as a default, GCBasic will try to initialize the a-d input pins to a digital output condition.  That is not happening for the 16f84a or the 16f84 for that matter.  Surprised this has not come up before.

      The Port pins can be set as output/input individually like you have.  Also, the whole port can be set by dir PortA out, or the TRISA = b'00000'.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.