| Electronics > Projects, Designs, and Technical Stuff |
| variable frequency square wave |
| << < (6/7) > >> |
| NorthGuy:
--- Quote from: ogden on May 24, 2019, 05:39:53 pm ---Requirements are clearly stated in the OP: "0.1% accuracy of the frequency control". --- End quote --- If only the frequency must be accurate, then many MCUs have NCO or DCO peripherals which can generate frequency very accurately, at the expense of higher jitter. |
| ogden:
--- Quote from: NorthGuy on May 24, 2019, 07:12:14 pm --- --- Quote from: ogden on May 24, 2019, 05:39:53 pm ---Requirements are clearly stated in the OP: "0.1% accuracy of the frequency control". --- End quote --- If only the frequency must be accurate, then many MCUs have NCO or DCO peripherals which can generate frequency very accurately, at the expense of higher jitter. --- End quote --- Those usually are kinda fractional frequency dividers, right? Yes, that's option indeed - in case jitter of +/- clock cycle (of divider) is acceptable. |
| IDEngineer:
--- Quote from: ogden on May 24, 2019, 07:00:02 pm ---Divisor 59,234,757 to get what exactly??? 72000000/59234757 =1.2155 Hz. It is way off 993000 Hz I asked for. --- End quote --- OMG. :horse: I'll try one more time. Your 72MHz clock scaled by 32 bits yields an LSb of 0.017Hz. Your desired frequency of 993KHz means you need (993000 / 0.017Hz) LSb's. Do that equation and see what number you get. Then calculate the error of that "missing" 0.3 LSb. EDIT: I just know you're going to freak out over your answer being different than the number I gave. The reason is because my number comes from doing precise math, while in my equation above I rounded the value of the LSb. The exact equation is: (993000 / (72^06 / (2^32))) ...which yields my earlier value. QED. :horse: |
| ogden:
--- Quote from: IDEngineer on May 24, 2019, 07:22:03 pm --- --- Quote from: ogden on May 24, 2019, 07:00:02 pm ---Divisor 59,234,757 to get what exactly??? 72000000/59234757 =1.2155 Hz. It is way off 993000 Hz I asked for. --- End quote --- OMG. :horse: I'll try one more time. Your 72MHz clock scaled by 32 bits yields an LSb of 0.017Hz. Your desired frequency of 993KHz means you need (993000 / 0.017Hz) LSb's. Do that equation and see what number you get. Then calculate the error of that "missing" 0.3 LSb. EDIT: I just know you're going to freak out over your answer being different than the number I gave. The reason is because my number comes from doing precise math, while in my equation above I rounded the value of the LSb. The exact equation is: (993000 / (72^06 / (2^32))) ...which yields my earlier value. QED. :horse: --- End quote --- LOL. No horses were harmed in this most ridiculous calculation of frequency division, ever. Do you even know how timer peripheral or any other discrete frequency divider works? BTW I did provide hint for you, "Hint: 72MHz divided by 72 is 1MHz but divided by 73 is... 986 KHz which is 0.68% away from 993 KHz." |
| IDEngineer:
Anyone else want to try explaining prescalers to this guy? I've taken my turn in the barrel, ready to sit back and :popcorn:. |
| Navigation |
| Message Index |
| Next page |
| Previous page |