If this is for IR modulation (38Khz) you could even use the internal RC o= sc? But the frequency adjustment would be crude. You could write a short loop with the 1uS instruction times and avoid usi= ng=20 the Timer0? Decrement a software timer 12 times and toggle a bit. That would be the cheapest way using the internal RC osc. PLUS you would not have to worry whether the Prescaler was set correct in= =20 the Option Reg? How accurate do you want? 38Khz is 26.3uS. So you want to set a bit high and back to low in that ti= me? For using a crystal and Timer0.. Use 16 MHz crystal for 1/4 uS instruction cycle. Prescale 2 and preload= =20 Timer0 so timeout is in 26 cycles? Preload would be (255-26). That sho= uld=20 be 13uS or half of the period. Just be sure to read the rules on setting the prescaler and what happens = to=20 it on PIC reset. That is in the OPTION Reg, and on reset it get defaulted to a prescale of= =20 128! Put it back to 2 each time to be safe. Read the warnings in section 4.4 = of=20 the data sheet. Have Fun!, Mike Hagen Crestline, Ca Mike@DogItDesign.com ----- Original Message -----=20 From: "Octavio Nogueira" To: Sent: Wednesday, March 30, 2005 8:49 AM Subject: [PIC]: generating 38KHz >I need to generate 38KHz with 12F675 using TIMER0 or > TIMER1 but I'm having some difficulties. > > I'm using external cristal and I can choose any > commercial frequency. > > Any help to do this using MPASM? > > Octavio Nogueira > Tato Equipamentos Eletr=F4nicos Ltda > (11) 5506-5335 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > nogueira@tato.ind.br ICQ# 222558485 > BASIC Step - O microcontrolador mais f=E1cil do mercado > BASCOM - O mais poderoso compilador BASIC para ATMEL > http://www.tato.ind.br > ProPic tools - low cost PIC programmer and emulator > http://www.propic2.com > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --=20 > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > >=20 --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist