Trouble with PIC 18F2220


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53

    Unhappy Trouble with PIC 18F2220

    I have Microcode Studio Plus and EPIC programmer. I am trying to program the 18F2220 for the first time. I have of course bought a 100 of these chips and had a PCB built on the speculation that I would be able to program the 18F2220. 2 things

    Microcode says it does not support this chip (even though it available in the drop down). It them wants to find MPASM as an assembler, which causes nothing but errors on all my @ device INTRC_OSC_NOCLKOUT statements, so I took them out and get a successful compile, change all the configurations in EPICWin, then download. Does Microcode Studio Plus support this chip, why does it need MPASM and how do I get my picbasic special lines back in?

    When I download to the chip EPICWin just gives a Code programming error at 00000. The 2001 EPIC Programmer 40/28 Pin ZIF Adaptor I have does not have a part number other than "01189 JMS" on the back, is it the right one for the chip? Is there some unique way to put the chip in the socket (I was just putting pin 1 up by the lever handle of the ZIF)? Or is it a problem with the compiling?

    I tryed a simple program in CodeDesigner too, it did not work, nothing but errors...

    my PBP directory has files for the PIC18F2220

    Any help would be great, I really need this to work.

    Thanks

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    The PM assembler (used by PBP compiler) does not support 18F chips for the moment. So you have to use Microchip Assembler mpasm (download from microchip site).

    Also you have to note that mpasm does not have the same directives as PM.exe so you have to change the headers and other assembler commands as you already noticed.

    Ioannis

  3. #3
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53


    Did you find this post helpful? Yes | No

    Cool

    OK, so I used the MPASM and got it so there were zero errors, but when I go to download using the EPIC programmer, why do I get the program error 00000, which implies it can't find the chip right? any idea what I have to do with the epicwin program? Thanks!

    CHarlie

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    Can't tell you about EPIC, sorry!
    Ioannis

  5. #5
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53


    Did you find this post helpful? Yes | No

    Red face continued questions...

    OK I got the program to load backwards. I think it was sucessfull. I imported the hex into the MPLAB and programed it with my ICD2, it seemed to work.

    Now that I am using MPASM and the ICD2, I don't know how to turn on the internal oscillator or mclr since they are not legal statements for the PIC18s

    how do I program the following statemements in now?
    @ device INTRC_OSC_NOCLKOUT
    '@ DEVICE XT_OSC ' System Clock Options
    @ DEVICE WDT_ON ' Watchdog Timer
    @ DEVICE PWRT_ON ' Power-On Timer
    @ DEVICE BOD_ON ' Brown-Out Detect
    @ DEVICE MCLR_OFF ' Master Clear Options
    @ DEVICE LVP_OFF ' Low-Voltage Programming
    @ DEVICE CPD_OFF ' Data Memory Code Protect
    @ DEVICE PROTECT_OFF ' Program Code Protection

    OSCCON = $60 'sets the oscillator speed
    DEFINE OSC 4 'Oscillator speed in MHz: 3(3.58) 4 8 10 12 16 20 24 25 32 33

    I actually really only need the internal osc at 8mHz and the MCLR off, the rest would be nice to know for future reference.

    Any help? Thanks

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,807


    Did you find this post helpful? Yes | No

    Default

    the commands/directives of the mpasm assembler are different from PM.exe so you have to read the manual of the mpasm to understand the syntax and commands.

    I'd be happy to read for you but I do not have the time to do so.

    Ioannis

  7. #7
    Join Date
    Aug 2005
    Location
    NC, USA
    Posts
    53


    Did you find this post helpful? Yes | No

    Smile

    got it. in the front of the code, i put the following
    @ __CONFIG _CONFIG1H, _INTIO2_OSC_1H
    @ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    @ __CONFIG _CONFIG3H, _MCLRE_ON_3H
    @ __CONFIG _CONFIG4L, _LVP_OFF_4L

    but you have to go into PBP's 18F2220.INC and remark out the following...
    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F2220, r = dec, w = -311, f = inhx32
    INCLUDE "P18F2220.INC" ; MPASM Header
    ; __CONFIG _CONFIG1H, _XT_OSC_1H
    ; __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    ; __CONFIG _CONFIG3H, _MCLRE_ON_3H
    ; __CONFIG _CONFIG4L, _LVP_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 8

    Thanks...

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Trouble with most basic BLINK on PIC 16F819
    By confusedperson in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 16th April 2009, 21:46
  3. PIC 18F2220 from hell
    By RCTrepoman in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th November 2008, 20:00
  4. 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
  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