Jump to content

Handling Split Registers


Recommended Posts

Ok well i am trying to implement some PWM control on my robot/micromouse and have come across a small problem (No thanks to microchip on this one).

 

Basically the duty of the PWM module is controlled by a 10 bit register, which is split with the high 8bits in CCPR1L and the lower 2bits in CCP1CON<6:5>

 

I would idealy like to use the whole 10bit regsister like a psudo 16bit register, which then would allow me to use a 16bit unsigned short to control it (rather than setting the 8bit regsiter and then sorting the 2 lsb)

 

Any ideas? I am sure its possible but cannot think of how to do it, my C books dont really apply to this sort of thing.

 

Many thanks,

 

- Martyn

Link to comment
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...
 Share

×
×
  • Create New...