Menu

16F84A , crystal issue?

Help
2008-08-04
2013-05-30
  • Nobody/Anonymous

    Im new to pic/microcontrollers and im trying to get a 16F84A to simply flash an LED, it however does nothing unless i touch the crystal which results in the LED lighting for the duration the contact. Ive also tried a 10Mhz crystal and it behaves the same.

    Here is my circuit:
    http://img.photobucket.com/albums/v729/frontmandan/untitled.jpg

    Here is the code im using:

    'Chip model
    #chip 16F84A, 20

    'Set the pin directions
    dir PORTB.5 out

    'Main routine
    Start:

    'Turn one LED on
    SET PORTB.5 ON
    wait 1 sec

    'Now toggle the LEDs
    SET PORTB.5 OFF
    wait 1 sec

    'Jump back to the start of the program
    goto Start

     
    • Nobody/Anonymous

      Does anyone have any idea why i may be having these issues?

      thanks in advance

      Dan

       
    • kent_twt4

      kent_twt4 - 2008-08-04

      Makes no sense to have the 220R on OSC1 pin, ditch that.  You have effectively created an RC circuit, which is creating a delay on the oscillator.  The capacitors for the crystal are critical, and must be installed.  Also put a 0.1uf capacitor as near to the V+ and GND pins of the 16f84A as possible.

       
    • Nobody/Anonymous

      Thanks for your help, this solved my issue :D

       

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.