- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm still new to the PSOC family, so please forgive what may be a potentially daft question. With the WaveDAC I know it's possible to set a frequency and leave it running (yay), but is it possible to change this frequency in software?
For example, read an ADC, do some munging in C, then change the frequency of the WaveDAC output. Is that possible?
Paula
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Short answer: yes.
Long answer: use an external clock.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, I don't really want to use an external clock as that would mean taking my signal in through the PSOC ADC, processing it in the CPU, then sending it to some external clock to generate the required frequency, bringing it back into a pin on the PSOC.
So I'd really like to see if it's possible to do directly from the CPU.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
External clock means "external to the component", not "external to the chip". You select this in the component configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Interesting approach, thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I've compiled the DDS_HW example and changed the output pins so they are connected to the LED and another pin on my FreeSoC2 (PSOC5LP based) board. but I'm not seeing the LED flash, I changed the frequency to 1hz (as below) But I'm not seeing the LED flash/light up at all. Am I missing something obvious?
Many thanks in advance
double FStart = 1.0f; //100000.0f; // start frequency
double FStep = 1.0f; //1000.0f; // frequency increment step
uint16 NSteps = 300u; //number of increment steps (FStop=FStart + FStep * NSteps); Npoints = NSteps + 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
no it doesn't work for me, though it compiles and builds.
I'll respond a bit later with a copy of the imported DDS_HW code as well.
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Start with basic DDS24_SW example. Also note that DDS minimal freq = Clock/2^24. To get 1Hz output with 0.1 Hz resolution, set input clock to 1.6777216 MHz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, the DDS24_SW version works perfectly.
I've used this to drive the WaveDAC which works just as I wanted. thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you everyone, I'll try some of the things suggested 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not that you haven't already thought of it, you could use the Counter component as your clock source. Use the comp out as the clock in to the WaveDAC8 and set the compare value via software using WriteCompare(value). This will allow you to vary the clock frequency relatively easily. It may not be as precise as odissy1's DDS module though, I haven't tried that yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Jeffery, I sort of tried that, using a timer and toggling a pin, but it didn't give me a great frequency resolution.
I'm going to try the DDS module tomorrow, I'll post my results.
Thanks everyone.