CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PWM problem with a PIC18f87 and PicKit3

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Microchiper



Joined: 01 Apr 2011
Posts: 1

View user's profile Send private message

PWM problem with a PIC18f87 and PicKit3
PostPosted: Fri Apr 01, 2011 6:17 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Apr 03, 2011 3:28 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Apr 03, 2011 6:41 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group