Oscillator not working on PIC16F877

Discussion in 'Embedded Systems and Microcontrollers' started by lehee2003, Apr 7, 2011.

  1. lehee2003

    Thread Starter New Member

    Apr 7, 2011
    6
    0
    Hello All,
    Am in serious trouble and i need your assistance. My project is not working and after trouble shooting I found out that d problem is from the oscillator. The crystal (4MHz) was connected to pin 13 & 14 of the PIC16F877A with a capacitor of 30PF. Also on my pin 1 I have a 10K resistor to power. At pin 11,12, 31 & 32 were connected to Vdd & Vss with a 100nF connected across each pin (i.e 11&12, 31&32) respectively.

    The output voltage from the oscillator is less 0.7V instead of 2.2 0r 2.5V respectively.
    The project is Automatic Plant Irrigation. At the moment only the red LED that is up, and the other Leds are down even if my probe (copper wires) are dip into wet soil.

    Please help as soon as possible as death line is jst a few days frm nw
    Thanks
     
  2. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Sounds like the oscillator is fine if the red LED is connected to an IO pin. If it wasn't running the pins would be inputs and could not power a LED.
    We would need a schematic and code if you need more help.
     
  3. lehee2003

    Thread Starter New Member

    Apr 7, 2011
    6
    0
    Thanks Mark for the reply.Also the LCD is also not coming up.
    Attached is d circuit diagram and my codes thanks.
     
  4. lehee2003

    Thread Starter New Member

    Apr 7, 2011
    6
    0
    Hello Mark,
    Hw has bin ur day? jst to check if my qeries has bin solved
    Tanks
     
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You do not set the configuration word(s) in your code. It may be because you do set them in MPLAB. But if the configuration word(s) are not properly set. Your MCU you will not work as wanted
     
  6. MikeInRI

    New Member

    Apr 6, 2011
    3
    0
    "...I found out that d problem is from the oscillator..."

    You can doublecheck this by configuring the internal RC for now.

    Is this circuit on your own PCB or breadboard?
     
  7. lehee2003

    Thread Starter New Member

    Apr 7, 2011
    6
    0
    Hello MikeInRI

    The circuit is still on my bread board.

    How can i go about this (the truth is that am very new in the PIC world) and i guess that is why am experiencing new thing.
    I wouldn't mind if i can be given some guide line .

    @t06afre
    Can you please throw more light on this?

    Tanks, as u guys are doing a great job in the engineering profession

    Regards,
     
  8. MikeInRI

    New Member

    Apr 6, 2011
    3
    0
    The oscillator and the two caps are meant to be as close as possible to the PIC to reduce extra capacitance from the leads.

    You can try the internal RC by selecting it in the MPLAB IDE configuration settings or put it in code in the project. See post #5.
     
  9. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Breadboards have a fair amount of stray capacitance and can be troublesome at high frequencies.
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Go to help then search in MPASM Assembler for __config (yes it is two underscores). The data sheet contains all related information. Se the section "special futures of the CPU" At the end of your chip include file you will find the fuse names.
     
  11. debjit625

    Well-Known Member

    Apr 17, 2010
    790
    186
    Are you sure its your mcu i.e.. the problem is in your mcu rather in software.First check it out,write a simple program which use about 1 second delay to turn on and off a LED at any port and test it if it works then you are having problem with your software or the hardware that interface the probe to mcu for proper conditions.

    Good Luck
     
  12. lehee2003

    Thread Starter New Member

    Apr 7, 2011
    6
    0
    Hello All, thanks for the assistance so far. The sensors are nw responding but the prblem is that the LCD is not writing just half (i.e not full).
    Plz assist
    Tanks
     
Loading...