PIC programs, resonator resonates, but does not run code.


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    Well, a third PIC shows the exact same behavior. It will program and verify fine but will not execute code. I changed the resonator, same result. Will try a new pcb next.

  2. #2
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    New pcb, new PIC, same result. Only populated the board with a 5v regulator and caps, plus resonator and PIC. Layout is good. Can program, verify, read back, erase etc etc. Again, resonator is showing clean 20mhz waveform, it just will not execute the code.

  3. #3
    Join Date
    Aug 2008
    Location
    Portugal
    Posts
    240


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    Try this please;

    Code:
    loop1:
    LATB.2 = 1
    pause 100
    LATB.2 = 0
    PAUSE 100
    goto loop1
    Also check if MCLR is connected to VCC. I don't see the configuration bits of your code!
    Last edited by gadelhas; - 8th August 2012 at 22:32.
    Thanks and Regards;
    Gadelhas

  4. #4
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    Confusing since it worked on the 18 pin but I would also try configuring in the order shown in Example 10-2 of the data sheet:
    Code:
    PORTA = %00000000       ' Turn off all PORTA 
    PORTB = %00000000       ' Turn off all PORTB
    ADCON1 = %01111000
    ADCON2 = %10000111
    TRISA = %11100111
    TRISB = %11000011
    Louie

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    Let's look at the code that works. Maybe theres something you left out...
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    The 20-pin version has separate AVSS and AVDD pins.
    Did you connect them to VSS and VDD?
    DT

  7. #7
    Join Date
    Feb 2004
    Location
    Michigan, USA
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: PIC programs, resonator resonates, but does not run code.

    Fixed!

    So it would appear if you use the auto insert serial number feature it changes your config bits during programming. This applies to the U2 programmer software. Uncheck this feature, problem solved, and the design functions just fine.

Members who have read this thread : 0

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

Posting Permissions

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