Pic 18f252 not responding


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2007
    Posts
    7

    Question Pic 18f252 not responding

    Hey, guys I have been diligently searching the internet for information about my problem but cannot figure it out.
    I have just switched from the 16f876 and am now trying to use the 18f252.
    I loaded microcode's 18f252 boot loader using a JDM programmer and WinPic 800. The ICD cannot communicate with the chip for some reason. If I push the Loader information button it will tell me I have a different pic every time. Also I tried making a hex file for a blinking led and then programming it with WinPic but it blinked erratically. Tried a second chip, same thing. I used the same 20mhz resonator for the 16f876 and it works fine.

    Any Ideas what might be wrong? I would really appreciate any tips.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringo332 View Post
    Hey, guys I have been diligently searching the internet for information about my problem but cannot figure it out.
    I have just switched from the 16f876 and am now trying to use the 18f252.
    I loaded microcode's 18f252 boot loader using a JDM programmer and WinPic 800. The ICD cannot communicate with the chip for some reason. If I push the Loader information button it will tell me I have a different pic every time. Also I tried making a hex file for a blinking led and then programming it with WinPic but it blinked erratically. Tried a second chip, same thing. I used the same 20mhz resonator for the 16f876 and it works fine.

    Any Ideas what might be wrong? I would really appreciate any tips.
    Got a pullup on MCLR?
    Got caps across Vdd and Vss? (the 18F practically NEEDS these, moreso than the 16F series).
    What pin is the LED on?
    Show us your program...show us your schematic...

  3. #3
    Join Date
    Mar 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default My Code

    Thanks for the reply:
    I'm not sure off the top of my head about the size of the caps I have. I'll have to check when I get home. What size should I use?
    Yes, MCLR has a pullup ,I built it into the serial ICD programmer that was suggest by Microstudio. The programmer and power supply (7805) work well for the 16f876.

    If The boot loader for the 20mhz 18f252 works fine for for my setup, and I get a different Pic Model # from the Microcode Loader Information tool every time I push it, it would seem to be a hardware issue. What do you think? Could the JDM/WinPic be programming it wrong. I did a verify after programing.

    here's my code:
    ;18f252 test
    ; i tooks these configs from Microcode's bootloader
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
    @ __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_ON_2L
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H
    @ __CONFIG _CONFIG3H, _CCP2MX_ON_3H
    @ __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    @ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
    @ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
    @ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    @ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
    @ __CONFIG _CONFIG7H, _EBTRB_OFF_7H

    define OSC 20
    DEFINE LOADER_USED 1
    trisb.0 = 0

    main
    high portb.0
    pause 200
    low portb.0
    pause 200
    goto main

    Thanks a lot.
    Last edited by gringo332; - 22nd March 2007 at 20:03.

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gringo332 View Post
    Thanks for the reply:
    I'm not sure off the top of my head about the size of the caps I have. I'll have to check when I get home. What size should I use?
    Yes, MCLR has a pullup ,I built it into the serial ICD programmer that was suggest by Microstudio. The programmer and power supply (7805) work well for the 16f876.

    If The boot loader for the 20mhz 18f252 works fine for for my setup, and I get a different Pic Model # from the Microcode Loader Information tool every time I push it, it would seem to be a hardware issue. What do you think? Could the JDM/WinPic be programming it wrong. I did a verify after programing.

    here's my code:
    ;18f252 test
    ; i tooks these configs from Microcode's bootloader
    @ __CONFIG _CONFIG1H, _OSCS_OFF_1H & _HS_OSC_1H
    @ __CONFIG _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_ON_2L
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H
    @ __CONFIG _CONFIG3H, _CCP2MX_ON_3H
    @ __CONFIG _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    @ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
    @ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
    @ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    @ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
    @ __CONFIG _CONFIG7H, _EBTRB_OFF_7H

    define OSC 20

    trisb.0 = 0

    main
    high portb.0
    pause 200
    low portb.0
    pause 200
    goto main

    Thanks a lot.
    Where's the define for the bootloader?
    Use .1uf on the power rail near the PIC, good generic value, works for almost everybody.

  5. #5
    Join Date
    Mar 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Problem found

    I have found the problem, but I'm not sure why it is happening. I had a sharp infrared sensor connect to the power supply but no control signals hooked to the pic. When I disconnected from the supply, the pic started communicating with Microstudio.
    I have a 1uf capacitor close to the max232 which shares a supply with with the pic. I don't know why this would be happening. It worked fine when I had the 16f876 on the supply.
    Any ideas on that?

    Thanks for the help.

  6. #6
    Join Date
    Mar 2007
    Posts
    7


    Did you find this post helpful? Yes | No

    Smile Capcitor

    I put a .01uf capacitor (in addition to the 1uf cap on the programmer board) right next to the PIC and this allowed the Infrared sensor to be connect with no problems. My only guess is that it doesn't like having supply wires 4 inches long without have a capacitor very close by.

    Oh looking above I can see that "Skimask" suggested putting it close to the rail.

    Thanks, Skimask!
    Last edited by gringo332; - 22nd March 2007 at 21:23.

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. PIC stop responding - Strange Problem!
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st August 2009, 14:06
  3. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  4. PIC 18F252 to NOKIA 7210
    By Speedykart in forum Off Topic
    Replies: 0
    Last Post: - 9th June 2005, 13:30
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 1

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