- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
I am generating sine wave of 4kHz using external DAC124s085 spi interface with CY8CKIT-059 PSoC® 5LP Prototyping Kit . I am sending different data in decimal or hex that convert in sine wave.I am new in spi interface and new in these kit. I don't have much idea about schematic and how to write data in code? Can any one help me out that how can i write look up table?
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this example for sine/cos calculation.
There are a lot of video examples showing how to deal with the IDE Creator
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this example for sine/cos calculation.
There are a lot of video examples showing how to deal with the IDE Creator
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for replying,it helps me alot.
Now ,I generated sine wave with external DAC that not in 4khz frequency how can I calculate my frequency? I have sample points in look up table and clock value ,can I use this values for frequency calculation?how?help me out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a little problem understanding your issue (English is nor my native language).
What you exactly mean with "external DAC that not in 4khz frequency"
Dil you alredy have a look at the WaveDAC component in which you could replace the PSoC internal DAC with an SPI interface.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want 4kHZ sine wave . I generated sine wave that is in 1 khz frequency . I can't understand how to change my frequency ? I used sine look up table with 60 samples and 12MHz clock frequency. And I am generating square wave using PWM,I want to synchronise both wave . How can I synchronise?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i am unable to share or attach file here ,i don't get any option like this .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Drashti,
Please go to use advance editor option in right corner.
There you should be able to attach document.
Best Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Your program is generating 1kHz without problem, right?
I think your program is accessing the table with index which is increased every time for each 1ms delta.
I think that making increase of the index 4 times (and round back to 0 when it exceeds the maximum index of the table) will generate 4kHz.
For example if you are generating value for the DAC
something like
==============
while(1) {
output_value = sin_table ;
i = (i + 1) % TABLE_SIZE ;
}
==============
then, make it
==============
while(1) {
output_value = sin_table ;
i = (i + 4) % TABLE_SIZE ; // <-----
}
==============
or I may write
1kHz
i = (i + delta_for_1kHz) % TABLE_SIZE ;
4kHz
i = (i + 4 * delta_for_1kHz) % TABLE_SIZE ;
moto