MCS+ ICD Freezes


Closed Thread
Results 1 to 11 of 11
  1. #1
    mslaney's Avatar
    mslaney Guest

    Default MCS+ ICD Freezes

    Hi there,
    I'm using MCS+ ICD and it just stops on the fourth command. For instance, in the code below the ICD will freeze on "porta = %00000000". If I rem that line out it will freeze on the next and so on.
    The program runs fine without the ICD running.
    Does anybody have any ideas?


    'Defines

    define OSC 20
    define LOADER_USED 1

    trisa = %00000000
    trisb = %00000000
    trisc = %00000000

    porta = %00000000
    portb = %00000000
    portc = %00000000

    'Variables and Constants
    counter var word 'For-Loop variable
    servo var byte 'Servo output pin
    'servo = portb.5

    'Servo movement module

    spin_CCW:
    counter = 0
    for counter = 1 to 100
    pulsout portb.5, 150
    pause 20
    next

    spin_CW:
    counter = 0
    for counter = 1 to 100
    pulsout portb.5, 1500
    pause 20
    next
    goto spin_ccw
    end

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i'm not sure of it but... what about if you switch your 2 first lines like this

    define LOADER_USED 1
    define OSC 20
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    capitano's Avatar
    capitano Guest


    Did you find this post helpful? Yes | No

    Post ICD

    Try

    Disable Debug

    define LOADER_USED 1
    define OSC 20


    trisa = %00000000
    trisb = %00000000
    trisc = %00000000

    porta = %00000000
    portb = %00000000
    portc = %00000000

    'Variables and Constants
    counter var word 'For-Loop variable
    servo var byte 'Servo output pin
    'servo = portb.5


    Enable Debug


    'Servo movement module

    spin_CCW:
    counter = 0
    for counter = 1 to 100
    pulsout portb.5, 150
    pause 20
    next

    spin_CW:
    counter = 0
    for counter = 1 to 100
    pulsout portb.5, 1500
    pause 20
    next
    goto spin_ccw
    end

  4. #4
    mslaney's Avatar
    mslaney Guest


    Did you find this post helpful? Yes | No

    Default

    niether change is working. Switching the defines didn't change anything and enable/disable debug times out when I click the ICD start button.

    ICD is working with most of my other programs as long as the main part of the program is within 4 lines of the chip registers and port init states.
    I'm using a 16F876A and compiling the program with that MCU in the drop-down. I've also tried changing OSCs and speeds in the .inc file.

    For example, the following program works ok with ICD:

    define OSC 20
    define LOADER_USED 1

    trisa = %00000000
    trisb = %00000000

    top:
    porta = %11111111
    portb = %11111111
    pause 1000
    porta = %00000000
    portb = %00000000
    pause 1000
    goto top

  5. #5
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Mike

    you have already found the the solution to your problem.
    you just haven't realised it.


    The problem is with:

    trisc = %00000000

    the HWUSART TX and RX pins are on portc.6 and portc.7
    and you are setting RX (which is supposed to be an input) to output.
    This will stop the ICD from working
    since bidirectional communitaction between PIC and PC is no longer possible.

    with
    trisc = %10000000
    it should work.
    Last edited by NavMicroSystems; - 3rd February 2005 at 21:33.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  6. #6
    mslaney's Avatar
    mslaney Guest


    Did you find this post helpful? Yes | No

    Default

    Hah!!!

    Thanks! Changing the tris reg. worked. This will fix 2 other programs that have brought me to my knees in frustration.

  7. #7
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Hi Mike,

    good to know your problem has been solved.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Red face

    why i didn't see it damn... seems i become older and my glasses need to be changed...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Hi Steve,

    it's probably just because your "favourite" chips
    (the ones you have plenty on shelf of)

    don't have HWUSART and Loader cabability.

    As long as you are able to solder SMD devices your glasses (and Health in general) are ok.

    ;-)
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Thanks ralph for the good words Looks like my glasses and my health are not so bad after all... SMD is much than easy to do.

    For the very first time in my life i did a mistake, and i'll have to live with it.

    LMAO!
    Last edited by mister_e; - 4th February 2005 at 00:40.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  11. #11
    mslaney's Avatar
    mslaney Guest


    Did you find this post helpful? Yes | No

    Default

    I thought I was wrong once but i was mistaken

Similar Threads

  1. MCS Plus ICD with 16F88x; again!
    By ardhuru in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th February 2010, 06:51
  2. DT Interupts and ICD?
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th November 2009, 02:02
  3. ICD use with MCS Plus, PBPro & PicKit2??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 30th September 2009, 23:06
  4. ICD Woes
    By spad13m in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 14th February 2008, 05:56
  5. Another MSCP ICD question
    By keithdoxey in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st July 2006, 00:07

Members who have read this thread : 0

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