PIC18F4850 will not oscillate


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Mar 2011
    Posts
    10

    Default PIC18F4850 will not oscillate

    I have board that I can program using the U2 (USB) Programmer from melabs. I have a blink program that works well when I pick the internal oscillator (at 8Mhz). I have designed the card to use a 20MHz external oscillator but I have not been able to make it work. I just bought the programmer not too long ago, and I am able to program the device as long as I use the internal oscillator.

    When I change the settings to HS on the meprog software, the board will not work and the oscillator will not oscillate (checked with a 10x probe). The design uses a 20Mhz oscillator (PN: ECS-200-20-5PXDU-TR, see attached schematic) and 20pF loading caps. The board layout is exactly as what has been recommended on the PIC datasheet. The only lines from the programmer to the card are GND, PGC, PGD, and my card has a 100K pull down on PGM. I have change the oscillator to another can oscillator I used on another circuit, but it still the new design does not work. During programming I am using the internal power supply which I checked an it is 4.98V. So I tried using the programmers Pin1 5V to power my board but that did not work either. I have also tried the @confiure..... but no luck neither.

    I believe that somehow the fuses for external oscillator do not set properly and the oscillator does not oscillate. I have changed, oscillators, placed different loading caps, put a 1M across the oscillato, removed the laoding caps, but no luck so far. I am only able to run the board with internal OSC set up. I read on another thread that someone used the Vdd (Pin 4) on the USB programmer to power the board during programming and it worked. Nevertheless your website does explicitly said not to use the Vdd pin 4 as it is used for powering adaptors and not ICSP.

    I would really appreciate if anyone can point me in the right direction, as I have tried everything and I have not been able to make the external oscillator to work. I believe I am having an issue with the programming of the HS fuse, but I just have not been able to make it work with the PIC18F4580. I am always setting up the HS with the programmer.

    I have never had issues with oscillators not working, but somehow this one doesnt. By the way I have 2 board populated and they behave exactly the same, with and without the same oscillators.

    Thank you,
    Attached Images Attached Images   

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4850 will not oscillate

    Try setting the configs in the *.inc file found in the PBP directory.
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4850 will not oscillate

    Hello,
    You also need to have the MCLR connected to the U2 programer. I did not see it connected in your schematic or discription? Set the config to "HS" and it should work.

    I am sure you have seen this page
    http://melabs.com/support/icsp.htm

    Power your circuit with an external 5v supply
    connect U2 with GND, PGD, PGC and VPP(mclr) to the PIC
    Last edited by mark_s; - 8th March 2011 at 21:54. Reason: add link

  4. #4
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4850 will not oscillate

    Mark,
    Although not completle shown on the schematic I posted, the MCLR is pulled-up with a resistor and a diode, and it also goes to the U2 Programmer. I have also set the meprog to HS as show in the attached picture.

    Mackrackit,
    The PIC18F4850.INC (file which is in the include statement of my *.asm) is as follows and it too sets up the oscillator to HS

    Code:
    ;****************************************************************
    ;*  18F4580.INC                                                 *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2008 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 09/15/08                                        *
    ;*  Version   : 2.60                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F4580, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F4580.INC"	; MPASM  Header
            __CONFIG    _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L,  _STVREN_ON_4L & _LVP_OFF_4L & _BBSIZ_1024_4L & _XINST_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	8
    Attached Images Attached Images  

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4850 will not oscillate

    Are you picking the correct PIC?

    Take a look at the inc you posted...
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Mar 2011
    Posts
    10


    Did you find this post helpful? Yes | No

    Default Re: PIC18F4850 will not oscillate

    Dave,

    Good catch and it got me excited for a second there, but I just noticed that I have a typo on my thread title.

    The PIC I have is the 18F4580, there is not such a thing as a PIC4850. I might be dislexic . THe file I posted is the correct one, so is the decription of the PIC on the schematic I posted.

    Any other ideas? I am setting the "Fail-safe clock monitor" and "Internal External Switch over" options so the PIC can run from the internal oscillator while I get this external oscillator to work. But I have tried it all, so any fresh input from anyone, will really help.

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts