View previous topic :: View next topic |
Author |
Message |
Microchiper
Joined: 01 Apr 2011 Posts: 1
|
PWM problem with a PIC18f87 and PicKit3 |
Posted: Fri Apr 01, 2011 6:17 pm |
|
|
Dear all,
I'm using Pickit3 to interface my board, and when using the debugger, there is a strange behavior (or, let's say, one I don't understand). Indeed, when using the "watch" feature in MPLAB, and considering the CCP4 for example (pin n°3 of Port G), I always have:
PORTG = 0000 0000
even when my voltmeter proves me that it changes merely as expected.
But if, in the code, I add:
Code: | state = PORTGbits.CCP4; |
then, the variable "state" switches regularly in a normal way in the "watch" window.
Note that when using the SIM mode of MPLAB, PORTG has at each time the correct output.
I need to understand what's wrong because I can see that my motor does not run the way it is supposed to do, and this is maybe a good start to find a solution.
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Apr 03, 2011 3:28 pm |
|
|
There is no 18F87.
Since your question is mostly about MPLAB and Pickit3, you might get
more replies if you try the Pickit3 forum:
http://www.microchip.com/forums/f15.aspx |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9229 Location: Greensville,Ontario
|
|
Posted: Sun Apr 03, 2011 6:41 pm |
|
|
You should show us a complete but small program that shows the problem.
One item you must understand with MPLAB, is that you MUST recompile your program after you select 'release' in the build configuration menu.
You cannot properly program a PIC with your code while in the 'debug' mode. |
|
|
|