1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

PIC18 Simulator IDE with PICkit2

Discussion in 'Oshonsoft' started by Gaby, Oct 7, 2014.

  1. Gaby

    Gaby New Member

    Joined:
    Mar 15, 2014
    Messages:
    14
    Likes:
    0
    Hello,

    How to make PIC18 Simulator IDE from Oshonsoft compatible with the PICkit2 from Microchip ?
    when I write a program using Oshonsoft and download it to the PIC18F4550, it doesn't work, whereas an assembly program works.
    The program code I wrote using Oshonsoft is correct. How it can be downloaded using PICkit2 ?
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    Pickit2 is a binary writer.... When you compile your code in Oshonsoft just load the hex file into the "Stand alone" pickit2 program....
    Have you installed the stand alone pickit 2 v2.61 programmer ?
     
  3. Gaby

    Gaby New Member

    Joined:
    Mar 15, 2014
    Messages:
    14
    Likes:
    0
    I have the PICkit2 v2.55 programmer. After compiling the program, I download the hex file (the binary code), But it does not work.
    The prgram is downloaded successfully to the PIC18, I see the code in its memory, but it doesn't operate on hardware.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK

    What is your FOSC setting..... And what OSC are you using...

    What makes you think its not working....
     
  6. Gaby

    Gaby New Member

    Joined:
    Mar 15, 2014
    Messages:
    14
    Likes:
    0
    FOSC_EC_EC_1H
    OSC: 20MHz
     
  7. Gaby

    Gaby New Member

    Joined:
    Mar 15, 2014
    Messages:
    14
    Likes:
    0
    I will tell you how I know that the code is correct, and what is not working.
    I used to program the PIC18 using USB module using a bootloader of 20MHz, and I download the program using PICDEM ES USB demo tool. This way the program works, but with some problem with the start up of the PIC18, I need to try 3 - 4 times to make it start.
    Now I am trying to download the same program using PICkit2, I download it and put the PIC18 in the test, but nothing happens.
     
  8. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,310
    Likes:
    914
    Location:
    Rochdale UK
    I was just making sure you didn't select XT type osc instead of HS.... When simulating this setting doesn't matter but in real device it makes a lot of difference...
     
  9. languer

    languer Active Member

    Joined:
    Oct 26, 2010
    Messages:
    193
    Likes:
    25
    Location:
    Arizona
    That is about the only thing I've used with Oshonsoft - Pickit 2. And it does work. But what I do know (from experience) is that the oscillator settings are sometimes not handled completely on Oshonsoft (especially on the chips that have built-in calibration and the calibration gets lost - it happens).
     
  10. languer

    languer Active Member

    Joined:
    Oct 26, 2010
    Messages:
    193
    Likes:
    25
    Location:
    Arizona
    Can you post a very short piece of code (LED blink or something) which works on the Simulator, does not work with PicKit2, and works with bootloader (remember that in bootloader mode, the clock configuration is already "programmed" by the bootloader code - only saying that this may be where the error is occuring)?
     
    • Thanks Thanks x 1
  11. camerart

    camerart Active Member

    Joined:
    Jun 12, 2008
    Messages:
    1,420
    Likes:
    11
    Location:
    Dorset UK.
    Hi,

    When programming 18F2431 make sure that when using the Pickit2 the pins 8 and 19 and 26, 0V pins plus PGM, are connected together also pins 7 and 20, 5V are connected together. This might also works for 18F4550 PIC with VSS VDD and PGM pins.

    Double check.

    C.
     
    Last edited: Nov 19, 2014

Share This Page