Announcement

Collapse
No announcement yet.

Microcode Studio Plus ICD with PIC16F1789

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GorCook
    replied
    While learning C++ would be a worthwhile skill, I really don't want to spend months getting back to where I was. I did learn enough write a program and get it to write and read I2C commands and data, but am getting stuck on the myriad combinations of variable scope. Hours spent trying figure out why it works this way but not that way. I didn't even get to classes and structure.
    So I am using hserout commands to debug my basic code instead of the MCSP ICD. Since the PCA was new, I finally found a couple of solder joint issues that were misleading me.
    I had been using DT interrupts and after studying the data sheet, and finding additional information on the DT Interrupts site about how to handle the PICs with individual pin enables and flags,
    I finally have gotten back to where I was.
    Basically (ha), you have to handle the pin enables and flags in the ISR. DT's interrupt will only handle the general interrupt enables. When using the IOC interrupt, the pin flag will determine which pin changed state and that is actually an advantage if you have multiple pins to monitor. Also nice to determine which transition you want to use. Don't forget to clear all the flags first or the ISR will keep getting called if another flag has been set somewhere.

    Leave a comment:


  • Henrik Olsson
    replied
    My guess is that not that many users are actually using the ICD feature in MCSP.
    I wish they'd implement proper source level debugging using hardware programmer/debugger or at least made it work properly in MPLABX - I'd certainly pay for that.

    /Henrik.

    Leave a comment:


  • GorCook
    replied
    I have previously been exposed to C++ while trying to debug a product where I used to work. I learned enough to change a few things so I could modify a function or test something out.
    I have spent a day or so going back to some of the online tutorials, and I remember why I didn't pursue learning C further. My eyes are glazed and my mind is numb already.
    And I haven't even hit the point of trying something yet. Languages were never my strong point.
    I have a support question into MEL, hopefully Charles will help me out.
    The PIC16F1789 isn't that new, and it is an obvious replacement/upgrade for the PIC16F887, so I am surprised that someone else hasn't had the same problem.

    Leave a comment:


  • mpgmike
    replied
    I took one of your options; I'm learning to code in C and utilize some of the fantastic FREE tools offered by Microchip (which only work with C and/or ASM).

    Leave a comment:


  • GorCook
    replied
    I have confirmed that when the MCSP ICD is used with the PIC16F886, it works as expected.

    The same program (or any program) applied to a PIC16F1789 will ICD compile without error, but ICD run will not connect. There is NO activity on the TX line from the PIC when "RUN" is clicked.

    I have gone over the various EUART settings many times, but have not found any issues there. The PIC16F1789 EUSART is very much the same as its predecessors except BAUDCTL is BAUDCON. I tried redefining that in the program (@BAUDON=BAUDCTL) but that had no effect.

    This means I do not have a satisfactory debugging tool for PICBASIC PRO and the PIC16F1789.
    I can continue to experiment with a DEBUGMON program as suggested by MEL, or perhaps it is time to learn C++ and use the Microchip tools.

    Another alternative is to try a different PIC with 16K program memory in the 44 pin TQFP package. Does anyone have experience with a different part? PIC16F18876 perhaps?
    Last edited by GorCook; 08-05-2019, 11:26 AM.

    Leave a comment:


  • GorCook
    replied
    ON the ICD issue, I am in a deep dive into the basic code that Microcode uses to create the ICD compile. I don't see anything yet.

    Leave a comment:


  • GorCook
    replied
    Thank you.
    I tried your version and find that there are register names that are not defined and throw assembler errors, which is a problem I ran into with the original 1.1 DT version. I was able to deal with that by equating the new names with the old names. The program definitely will respond to a pin state change, but the flags do not get reset properly.
    I am thinking that the 16F1789 has individual pin control for almost all the pins. That means that the flag signalling an interrupt on a specific pin will need to be dealt with in the interrupt handler because DT interrupts will trigger on any of the pins changing state. I.e. : IF IOCBF.2 THEN etc. and reset the flag at the end of the handler. INT_CLEAR doesn't work. IOCBF.2=0 does.
    I was looking into that today but haven't finished my investigation yet.

    Leave a comment:


  • DavidP
    replied
    I'm sorry, I misspoke, Attached is a version I modified for use with the processors I mentioned earlier. I call it DT-INTS-16. See it it works. I use it along with ReEnterPBP-14.bas.
    Attached Files

    Leave a comment:


  • DavidP
    replied
    What version of DT-Ints are you using? This is the latest I believe and I have been using with the latest 16F18326 and 16F18346 processors.
    Attached Files

    Leave a comment:


  • GorCook
    replied
    Yes.
    I've used the ICD function for years. This is the first time trying to use it on this PIC.
    I am seeing that there are also problems with DT Interrupts. I don't think the last version of that covered the expansion of interrupts to all ports and positive or negative transitions.

    Leave a comment:


  • DavidP
    replied
    Have you used the ENABLE DEBUG and DISABLE DEBUG commands in your program? This is covered in the HELP tab in MicroCode Studio.

    Leave a comment:


  • GorCook
    replied
    Hi, thanks for your reply.
    PBP is verson 3.1 and includes the PIC16F1789.PPBINC file. I can compile, program, and run no problem. Serial communication hardware all works; I just verified that with the serial communication window in MCSP and by using HSEROUT in the program.
    I set and checked the oscillator frequency and it is correct at 4 MHz. I am working with a small test program to sort out interrupt issues ( I am using DT interrupts) but not having ICD working is a handicap.
    It ICD compiles but get ICD connection timeout when RUN is pushed.

    Leave a comment:


  • mpgmike
    replied
    What version of PBP are you using? I don't think the PIC16F1789 works with the free version, or with really old versions.

    Leave a comment:


  • GorCook
    started a topic Microcode Studio Plus ICD with PIC16F1789

    Microcode Studio Plus ICD with PIC16F1789

    I am trying to use the ICD in MCSP with the PIC16F1789. The serial communication link is good and all hardware and software works fine with a PIC16F887. The program works with the '887 but I need more memory.
    I have built the ICD model as instructed, the ICD menu appears, and it will successfully complete the ICD compile but when the PIC is programmed it runs immediately as if it were a non- ICD compile. The ICD window and commands are not working.

    I installed and set up the MPLABX IDE to try to use that system instead, but the debugger doesn't recognize the PBP variables, the editor isn't set up for PBP syntax, and it is not nearly as useful.

    Has anyone else tried to use the PIC16F1789 with MCSP?
    Is there any way to check the ICD model?

    Any help would be appreciated.
Working...
X