PBP3 with PIC18F87K22 and variables


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    4

    Question PBP3 with PIC18F87K22 and variables

    I have just spent 10 hours or so struggling with the following problem:-

    HARDWARE
    EasyPIC PRO board from Mikroelektronika fitted with PIC18F87K22. Modified to use PICkit3 programmer, as it programs much faster than the Mikroelektronika mikroprog.

    SOFTWARE
    PBP3 with MicroCode Studio, using MPLAB X. All downloaded a few days ago, so up to date.

    I can compile code and download it and it runs, so the setup is basically sound. I have put a simple loop with 200mS delay flashing an LED on RA4 so I can tell the program runs.
    My problem is with variable names and what happens when I change them.

    zhfk_81 and zhk82 are pre-defined BYTES
    The following code section runs ok. LEDs on PORTD count up as expected.

    zfhk_81 = zfhk_81 + 1
    zhk82 = zfhk_81
    portd = zhk82

    However the following code section does not run, although RA4 still flashes, showing that the loop is going round.
    (the declaration for zfhk_81 has been changed to a word)

    zfhk_81 = zfhk_81 + 1
    zhk82 = zfhk_81.BYTE0
    portd = zhk82

    Also changing the name of variable zfhk_81 (a BYTE) to something like charger_demand or reg81 stops the originally working version. Although the LED on RA4 still flashes. The PIC watchdog has been turned off in the config, so I am sure the PIC is not crashing and resetting.

    All of the above works fine with PBP 2.6 and MPLAB.

    Does anybody have any ideas???

    Many thanks

    MisterT

  2. #2
    Join Date
    Jan 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: PBP3 with PIC18F87K22 and variables

    Problem solved.
    I have reinstalled PBP 3 and set the assembler to MPASM instead of MPASM X.
    Everything works ok now.

    MisterT

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