Hi Guys.
Firstly Bert....apologies I didn't post the full code (ironically, I thought for simplicity's sake)....further up my program, I had exactly as you'd outlined, namely...
Code:
CCP2CON.4 = duty.0
CCP2CON.5 = duty.1
CCPR2L.0 = duty.2
CCPR2L.1 = duty.3
CCPR2L.2 = duty.4
CCPR2L.3 = duty.5
CCPR2L.4 = duty.6
CCPR2L.5 = duty.7
in fact I tried Henrik's simpler way first, but when that didn't work (ie period register didn't update as I thought they should), I mapped them longhand as above.
Apologies for not showing the full picture....and many thanks for helping me out (again!)
Henrik,
Sometimes I get so wrapped up that I lose sight of the obvious (I had many things on the go yesterday ....ultimately cracking a long standing coding issue (yay) ....but while doing so, I think my brain got fogged).....yep, my variable 'Duty' is not 'tracked' in real time as it were, which means I do need to update the period setting bits bt y pointing at my variable everytime I wish to change the duty...so yes, your sub routine is the order of the day.
Many, many thanks
....thanks heavens for forums like this with people so willing to help.
Bookmarks