Thanks so much for that Nick, you have explained that wonderfully and I can now understand that better.
So, shifting that bit 5 places gives the value of 32 I normally see in this TCCR3A register.
I didn't realise that what I was looking at pointed back to a bit position within that register.
So, just to summarise my program flow around the use of this TimerThree function.
Firstly, I have removed the TimerThree generated 1000mSec interrupt used to call a routine.
That interrupt has been replaced with a standard 1000mSec millis() time check, which works fine.
In my setup() I do the following;
Timer3.initialise(100000); // initialise timer 3 and set for a 100mSec period
Timer3.pwm(pin_TurbineDumpPWM, 0); // pre-initialise the pwm on pin 2 and set for 0% duty cycle
Nick, I need to do that second step to setup the correct operating mode for pwm on specified pin, (you did question my use of it in an earlier post)
When you call the Timer3.pwm, that is where DDRE and TCCR3A get set.
Then in my routine that gets called each 100mSec I do the following;
Timer3.setPwmDuty(pin_TurbineDumpPWM, hydroPID.cvPID)
In the above routine, DDRE and TCCR3A are not re-set at all, and it is assumed that they will hold their initial values from the initial setup function
This function is called by Timer3.pwm and from the Timer3 documentation it states the following;
setPwmDuty(pin, duty)
A fast shortcut for setting the pwm duty for a given pin if you have already set it up by calling pwm() earlier.
This avoids the overhead of enabling pwm mode for the pin, setting the data direction register, checking for optional period adjustments etc. that are mandatory when you call pwm()
Rob, just noticed your post, yes, what you are saying is clear, I can understand that.
But still the problem..
Paul