Results 1 to 4 of 4

Thread: Copy of PIC chip fails... timing issue?

  1. #1
    Senior Member

    Join Date
    Jan 2008
    Location
    A rock in the ocean
    Posts
    752
    Thanks
    99
    Thanked 135 Times in 79 Posts
    Rep Power
    291
    Reputation
    3356

    Default Copy of PIC chip fails... timing issue?

    I'm trying to copy a PIC chip (a DIP8 12F510, not embedded in anything) and have read the source PIC with a Pickit3 and MPLAB. I've then written it to new PIC chips (SMD SOIC this time), and they verify perfectly against the source.
    But when the copied PICs are put into circuit, they don't do what they're supposed to. They're supposed to wait for an input to become active, then wait a predetermined time using the internal oscillator as a reference, then put out a fixed bit pattern on an output. In circuit, at the time the PIC should be triggered, the processor doesn't seem to get any response from the PIC - gets an all 0s response.

    MPLAB didn't force over-write the internal osc calibration value at 0x03FF, so that should be OK. I'm guessing the timing of this application must be fairly critical; there's evidence of some fine tuning of timing with lots of NOPs by the original author, who I've lost contact with now so I can't ask him.
    Would there be any other reason why an otherwise good copy of a PIC wouldn't work in circuit for the desired application?



Look Here ->
  • #2
    Premium Member
    Skepticist's Avatar
    Join Date
    Apr 2009
    Posts
    1,139
    Thanks
    714
    Thanked 670 Times in 525 Posts
    Rep Power
    475
    Reputation
    12780

    Default

    Could be something simple like configuration bits EG internal pullup on inputs not enabled or osc settings wrong.

  • #3
    Senior Member
    Reschs's Avatar
    Join Date
    Aug 2010
    Location
    Outside a few schooners
    Posts
    3,082
    Thanks
    914
    Thanked 2,151 Times in 1,060 Posts
    Rep Power
    936
    Reputation
    33318

    Default

    Firstly, Is the SMD Chip the exact same chip. Check what comes after 12F510 in the PIC number.
    Are you testing both with the same external components and not different boards ?
    As one is SMD I suspect not and an external fault maybe the cause.

  • #4
    Senior Member

    Join Date
    Jan 2008
    Location
    A rock in the ocean
    Posts
    752
    Thanks
    99
    Thanked 135 Times in 79 Posts
    Rep Power
    291
    Reputation
    3356

    Default

    Just worked out what is going on. Code protection is set, but the first 96 bytes are readable even with code protection set (as per datasheet), which tricked me into thinking the entire chip was readable. I should have picked up on that, with a few jumps to subroutines that appeared to go beyond the end of the (readable) code. Now I have to work out a way to glitch my way into getting a full dump of the code.

  • Bookmarks

    Posting Permissions

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