ICD Compile Program in MicroCode Studio Plus


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57

    Default ICD Compile Program in MicroCode Studio Plus

    I have been trying to get the ICD to connect/work and have had no luck.

    I get a message "MIcroCode Studio is unable to connect to the target PIC microcontroller using the assigned serial port."

    I have a serial cable going to a MAX 232 chip, following the schematic in the documentation.

    Here is my code:
    Code:
    INCLUDE "modedefs.bas"
        include "ALLDIGITAL.pbp"
        DEFINE LOADER_USED 1
        OSCCON =$60 'clock speed 
       '
        DEFINE OSC 4
    LED    VAR  PORTB.0' Assign name "LED" to PORTB.0
    
    mainloop:
       High LED        ' Turn on LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
    
       Low LED         ' Turn off LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
       Goto mainloop   ' Go back to loop and blink LED forever
       
       End
    My configs:
    Code:
     LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F4550.INC"	; MPASM  Header
            __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
            __CONFIG    _CONFIG1H, _FOSC_INTOSC_HS_1H  & _FOSC_INTOSCIO_EC_1H & _FCMEM_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    Any Ideas?

  2. #2
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    I guess I need to load the bootloader....my question is, Where is the bootloader files located?

  3. #3
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mike2545 View Post
    My configs:
    Code:
     LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F4550.INC"    ; MPASM  Header
            __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
            __CONFIG    _CONFIG1H, _FOSC_INTOSC_HS_1H  & _FOSC_INTOSCIO_EC_1H & _FCMEM_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    Any Ideas?
    The only difference I see between your configs, and the default configs is you have two processor configs configured. I am a little surprised you got no errors. Maybe only the last one would take, I am not sure. I take it you are using internal OSC? Here is the description of each:

    _FOSC_INTOSCIO_EC_1H EQU H'F8' ; Internal oscillator, port function on RA6, EC used by USB
    _FOSC_INTOSC_HS_1H EQU H'FB' ; Internal oscillator, HS used by USB

    Default is _FOSC_HSPLL_HS_1H (or at least that what mine is now)

    As far as ICD, A bootloader has nothing to do with ICD compile. But the bootloader files are located here: C:\Program Files\Mecanique\MCSP\MCLoader\LoaderHEX

    Is your program blinking the led?
    http://www.scalerobotics.com

  4. #4
    Join Date
    Jul 2009
    Location
    Ohio, USA
    Posts
    57


    Did you find this post helpful? Yes | No

    Default

    Yes the program blinks the led, if I do Compile Program. It does not if I do ICD compile program
    Thanks for the info on where the files are located.
    I guess that I need stepped through the process of getting the bootloader file on the uC and then running the ICD.

  5. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    That's funny, the PIC18F4550 wasn't on their supported list on their website (for ICD) but it is in the ICDMODELS folder. It is most likely that something is wrong with your serial connection. Maybe you could double check that. Name:  icd-serial.PNG
Views: 1533
Size:  84.8 KB
    I would not mess with a bootloader until you get the ICD running, because it could screw the ICD up.
    <small>

    </small>
    Last edited by ScaleRobotics; - 4th December 2010 at 16:20.
    http://www.scalerobotics.com

  6. #6
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    That's funny, the PIC18F4550 wasn't on their supported list on their website (for ICD) but it is in the ICDMODELS folder.
    Would it be because there is only BETA icd model available for 18F4550 and for many other unsupprted PIC's too?

    BR,
    -Gusse-

  7. #7
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Hi Gusse,

    Looks like you are right.

    But it looks like this page has not been updated in 4 years: http://www.mecanique.co.uk/code-stud...ICDModels.html

    Walter
    http://www.scalerobotics.com

  8. #8
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    Or they have quite long beta testing period still going on

    BR,
    -Gusse-

  9. #9
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Hi Mike,

    I tried getting your code going with internal oscillator, and had the same results at you. It would work without using ICD, but I got a communication error after I compiled for ICD. Then I tried a 20 mhz oscillator, and it did work. I modified the configs for the 20 mhz crystal. I then tried it using MCLoader bootloader, and it works as well.

    Code:
    asm
            __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
            __CONFIG    _CONFIG1H, _FOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    endasm
    INCLUDE "modedefs.bas"
        include "ALLDIGITAL.pbp"
    
        DEFINE LOADER_USED 1
        'OSCCON =$60 'clock speed 
       '
        DEFINE OSC 20
    LED    VAR  PORTB.0' Assign name "LED" to PORTB.0
    
    mainloop:
       High LED        ' Turn on LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
    
       Low LED         ' Turn off LED connected to PORTB.0
       Pause 500       ' Delay for .5 seconds
       Goto mainloop   ' Go back to loop and blink LED forever
       
       End
    http://www.scalerobotics.com

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