A 20Mhz PIC can generate a 500KHz clock via its PWM output. Set period to 10 (ie set PR2 to 9) Set duty cycle to 5 And you've got 500KHz, symmetrical. Bob Ammerman RAm Systems ----- Original Message ----- From: "Jinx" To: Sent: Wednesday, November 27, 2002 7:57 PM Subject: Re: [OT]: game boy camera > > On (10) it says the MAX Xck rise time is 0.2 uS > > (that's MAX) > > > > my stamp cannot do this, > > (I don't think??) > > At the pin itself the rise/fall time probably is that fast, but > generating a 500kHz clock signal is a different matter > > > I guess I better get out the pic (877) or whatever is needed > > (I always have trouble getting the higher Mhz oscillators to > > function - at all) > > You have several options for getting Xck > > 1) 500kHz ceramic resonator + a few gates > > 2) use a 20MHz crystal for the PIC and divide it down in hardware > to get 500kHz. 20MHz for a PIC is pretty routine (for a properly > rated part of course), you shouldn't have any trouble > > Tap off the 20MHz from OSC1 or OSC2 with a high impedance > gate and run it through division h/w as discussed the other day > ( "[OT]:Need to divide frequency by 163" ). The aim is produce > a 500kHz Xck with > 800ns hi/lo times as per (10). > > 3) A 20MHz PIC may just be able to generate a 500kHz clock via > TMR0 IRQ at 50% duty cycle. However, the ISR would be coming > every 5 clock cycles (2 ISRs per Hz - one for high, one for low) so > > 4) use one (small/cheap) PIC dedicated to making the 500kHz at > whatever mark/space ratio is passable by simple instruction cycle > usage between pin toggles and another PIC for everything else. I > haven't tried to work it out but you should be able to write a toggling > routine that takes 10 cycles at 20MHz = 500kHz output > > 5) 555 timer > > > Let me know if I'm screwing the pooch here....thanks > > Please, my reputation for salacious comments is already well > established ;-) I have no further need to enhance it > > (BTW, if some of you guys are in the "doghouse", what does > that make the house where your missus is ? Starts with "b") > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads