I don't know how fast a PIC at 10, 15 or 20 MHz can output new values on a Port but sure he has a 3rd order filter at the output that makesthe difference.
Note that.
Ioannis
I don't know how fast a PIC at 10, 15 or 20 MHz can output new values on a Port but sure he has a 3rd order filter at the output that makesthe difference.
Note that.
Ioannis
Depends how much distortion you want to acheive. Sure enough you need a filter somewhere OR a way better granularity which imply a way bigger lookup table, but if you do so, you also limit your max Freq. Even with that, you'll always have some steps in your waveform.
Another thing, 1% (or less) precision resistor MAY help... but still.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well that is not exactly what I was thinking about. but it does provide some data. with the tuning word = 1 I caculate it takes about 24 instrcution cycles to get through the main loop. thats 3 uS. or the 333K you referenced above. IMHO that seems plenty fast enough to make a 5K signal. at 5K, you will have enough time to run your loop ~66 times. so thats 33 loops for each half cycle. so every 5.4 degrees you change output values. that would be the same as skipping values in the table I suppose. I know I am not helping here, but something just feels better thinking about the values this way. the next issue is sine waves are not triangle waves. there is more action over time at the reversals. during the rise and fall they are almost vertical, well more then 45deg anyway. So it seems to me you need more of those samples there.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
Why dont you change to a 18F46K20 or similar that you can run on 64MHz. A 64MHz pic is not that much more expensive unless you plan to make lots and lots of your product.
Speed could be helpful sometimes.
Meep Meeep as the Road Runner would have said!
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I'm not designing a product...this is just me learning about the benefits/constraints of DDS, think I need a break from this one for a few days now though!
RE going with an 18F PIC....the 16f1822 can run at 32Mhz (which is pretty fast!)....also smaller PICs just appeal to my sense of "wow, look what was squeezed out of that tiny thing!"
MIIPS MIIIPS !! What the Road Runner really meant.
Hi,
I had a play with this. Just a counter variable pointing into the lookup table which outputs the value to PortB where a R2R ladder and 2nd order low-pass filter with a cutoff at ~6kHz is waiting.
Here's a scopeshot, raw signal on Ch1, filtered on Ch2 (as if that wasn't obvious):
To get ~5kHz output I had to index the table in steps of 20 but then I'm only running at 8Mhz. At 32Mhz you should be able to get pretty good performance and signal "quality". Of course, everything is relative...
I did (or do) have a weird problem though with the PIC resetting that I can't figure out but I'll post that in a separate thread.
/Henrik.
Bookmarks