clocks


Felix

Recommended Posts

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

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 for

an 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

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

Archived

This topic is now archived and is closed to further replies.