Felix Posted July 5, 2013 Report Share Posted July 5, 2013 with ZPUino thing, is it possible to fake a 4MHz clock to feed into a PIC? normally its 2 caps and a crystal feeding osc in/out like this:: Link to comment Share on other sites More sharing options...
alex Posted July 5, 2013 Report Share Posted July 5, 2013 Read the PIC data sheet. It should tell you which pin you can feed a digital clock if you don't want to use a xtal. Normally one of these pins would be an input and the other is the output of the internal xtal driver. Link to comment Share on other sites More sharing options...
Felix Posted July 5, 2013 Author Report Share Posted July 5, 2013 thing is, the pic is already programmed. i am trying to interface into it without modifying its program. i just don't know if its possible to run zpuino and generate a 4MHz clock with zpuino at the same time. heck i dont even know if its possible to *accurately* generate a 4MHz clock with zpuino by itself. i would think not, but i figure it doesnt hurt to ask. i will most likely wait for my caps/xtal to come in the mail in a few days and do it that way, but was hoping foran all in one solution. short of adding in a 2nd pic just for clock which would be kind of dumb Link to comment Share on other sites More sharing options...
alvieboy Posted July 8, 2013 Report Share Posted July 8, 2013 Felix: the best way to generate the 4MHz clock is to program the 16-bit timer w/o prescaler to provide a 50% duty cycle PWM. From top of my head, set the CMP to 23 ((96000000/4000000)-1), and set the CMPLOW of the relevant PWM output to 0, and CMPHIGH to 12. I can write a simple sketch that does this for you later today, if you are kind enough to tell me to which FPGA pin you'll be expecting the clock output. Link to comment Share on other sites More sharing options...
alvieboy Posted July 8, 2013 Report Share Posted July 8, 2013 Side note: the 4MHz clock will be >99% accurate. The only innacuracy can come from the board oscillator (32MHz), and even then the internal PLL will probably reduce the skew and jitter a lot. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.