Look in the manual on the figure covering the OPTION register=2E Hans > -----Ursprungligt meddelande----- > Fr=E5n: pic microcontroller discussion list > [mailto:PICLIST@MITVMA=2EMIT=2EEDU]F=F6r James Fitzsimons > Skickat: den 23 augusti 2001 12:53 > Till: PICLIST@MITVMA=2EMIT=2EEDU > =C4mne: [PIC]:How do I set the prescaler for a PIC 16F84? > > > Hello list, > I just want to thank everybody who has taken the time to help me > out so far > in my PIC adventures ;-) > > I am writing a timer driver in Hi Tech C for the 16F84 and want to set a > Timer0 interrupt period of 1 ms=2E > > So, so far I have enabled global interrupts (set GIE =3D1 ), enabled the > Timer0 interrupt (set T0IE =3D 1), cleared the PSA bit to assign > prescaler to > Timer0 module (PSA =3D 0), set TMR0 (TMR0 =3D 0x05) so TMR0 will count 250 > ticks=2E Now I fgure if I set a prescaler of 4 then the timer will interru= pt > evry 1000 cycles, which at a 4Mhz clock will be 1 ms=2E=2E=2E=2E is this > correct so > far? > > If I have managed to get this correct so far (my first timer playing with > interrupts on any micro!) could some one please tell me how I set a > prescaler value of 4? I know I have to set the PS0:PS2 bits, but > have no how > these bits create a prescaler value=2E I have read the datasheet pretty > thourghly, but still don't understand=2E > > Thanks so much for any help you can provide, > regards > James Fitzsimons > > -- > http://www=2Epiclist=2Ecom#nomail Going offline? Don't AutoReply us! > email listserv@mitvma=2Emit=2Eedu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body