PDA

View Full Version : How do I to set one bit in a register?



jessey
- 10th February 2006, 10:23
Hello,

I have a quick question, I'm trying to figure out how to address bit 3 of the T1CON: Timer1 Control Register for an 18F452 but can't figure out how to do that. If I do this "T1CON = %00001000" as far as I know (correct me if I'm wrong) would enable the Timer1 Oscillator but also it would be affecting the other bits in that register which is something I don't want to do. Could I use T1OSCEN = 1 to enable the oscillator and or T1OSCEN = 0 to shut it off?

Thanks
jessey

Melanie
- 10th February 2006, 11:52
T1CON.3=0

or

T1CON.3=1

jessey
- 11th February 2006, 09:43
Thanks Melanie,

I appericate your response.

jessey