Jump to content
Sign in to follow this  
rdp

Registers Window displaying incorrectly

Recommended Posts

Here is the code I entered to see how well I could implement a PWM project.

            ccp1con = 1100b; //  PWM mode

pr2 = 200; //Period = 25kHz,

ccpr1l = 100; //Duty Cycle

clear_bit( trisc, 2 );            //  PWM CCP1 = Output

t2con = 0x04; //timer 2 on bit = on

The issue is in the Registers Watch window in Debug mode.  The ccp1con register does not display my data correctly.   it appears to be shifted right one bit.  The asm file is correct however as it looks correct in MPLab.  It also seems to act as if I did not set bits 2 and 3, but 1 and 2 istead, ie the PWM was not working.

Share this post


Link to post
Share on other sites
Guest Dave

rdp,

 

Just tried your code fragment on an 16F877A target.

 

I can see no problem.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...