Does 16F628a support debugging or not?


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    • If I put CPD_OFF in the config line, it will not compile, gives me an error that "symbol not previously defined". I looked it up in the .INC file and there is no CPD_OFF key. When I remove it from the CONFIG statement, the program compiles.
    • I have loopback working.
    • I'm compiling for a 16F628a chip. I have 2 circuits with the same chip, one is in the PCB I made, the other is just breadboarded and connected to the MAX232 serial chip to my PC. The latter is for testing.
    • If I ICD compile to the latter circuit, all works well until I RUN and then I get a time-out error. So I'm not even at the point where I can use the serial connection and ICD software.
    Current software: MCS+ 5.0.0.3
    PBPX 3.0.5.4
    MPlab IDE 8.84
    MPLab Suite -XC32 8.84

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    Something doesn't add up.
    This is from the p16F628a.inc file from MPLAB 8.84
    _CPD_OFF is defined, and it compiles fine with the stated config lines.

    Code:
    _LVP_OFF             EQU  H'3F7F'    ; RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming
    _LVP_ON              EQU  H'3FFF'    ; RB4/PGM pin has PGM function, low-voltage programming enabled
    
    _CPD_ON              EQU  H'3EFF'    ; Data memory code-protected
    DATA_CP_ON           EQU  H'3EFF'    ; Data memory code-protected
    _CPD_OFF             EQU  H'3FFF'    ; Data memory code protection off
    DATA_CP_OFF          EQU  H'3FFF'    ; Data memory code protection off
    
    _CP_ON               EQU  H'1FFF'    ; 0000h to 07FFh code-protected
    _CP_OFF              EQU  H'3FFF'    ; Code protection off
    Did you re-boot your computer after installing?
    There is an MPASM-MPLAB Setup that runs once on booting that connects PBP3 to the MPASM path.

    Did you download the larger PBP3 file that has MPLAB in it?
    Did you accept all the defaults during installation?

    If you send the .LST file after compiling, I might be able to see what's wrong. [email protected]
    Last edited by Darrel Taylor; - 5th June 2012 at 02:27.
    DT

  3. #3
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    Problem Solved:

    I discovered this BEFORE Darrel replied. He was right on, as it turned out. Here's my post before I read HIS post:

    CPD_OFF was not listed in the hard copy INC file I had (dated 2011 by Microchip) for the 16F628A.

    Having upgraded, I checked again, and in the 2012 version, CPD_OFF IS LISTED. So why no workee?

    I never shut my computer off (put it in sleep) so I hadn't done the reboot required after the upgrade. This was confirmed when I did reboot and a PBP install window popped up asking where the assembler was.

    I put the CPD_OFF switch back in the config line and it now compiles.

    I haven't verified the ICD operation yet, but thought I'd get this new development out so no one would waste their time trying to figure it out.

    Thanks for your patience.
    Last edited by queenidog; - 5th June 2012 at 15:04. Reason: timing info

  4. #4
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    I hooked up the MAX232 circuit and using the loopback program can echo characters after a "normal" compile.
    After an ICD compile, typing the letter "h" returns $3C04B6.
    Selecting RUN on the ICD menu, pops up a box that says I'm not connected to the serial port, which of course is incorrect, since I can loopback typed characters.
    Getting closer!
    What is significance of the returned hex value (just curious)?

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    Each time you compile a program for ICD, MicroCode Studio generates a new "handshake" number so that it can match the program in the chip to the program on the PC.

    After using Serial Communicator, be sure to Disconnect before trying to use the ICD in MCSP.
    MCSP cannot connect if Serial Communicator is using the port.
    DT

  6. #6
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    Regarding the quote, I guess since I made lots of mistakes, I made SOMETHING.

    SUCCESS! I can ICD compile and debug my program on a 16F628a
    • I wasn't using the full config string as you had said is necessary because #CONFIG sets everything back to default.
    • My bad habit of doing this: TRISB=%0000000 instead of really looking at what the pins are doing got me. PortB.1 is Rx and is an input, not an output. I've been doing outputs-only for so long, it never dawned on me I'd need an input...
    Thanks again for your support and your suggestions. It made me really want to fix this thing to the point where I was anal about it. The advice you gave is much better than those who say, "RTFM".

    The serial loop back program was really good too because it allowed me to verify my circuit, comm from PC, comm to chip. Good stuff.

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Does 16F628a support debugging or not?

    Great!
    I'm glad you got it working.
    And I'm glad I could help.
    DT

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