- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i made a new AD9833 custom component i follow the video tutorials it compile with no error but when i add it to a project it give me this error
also i try to add the h file and c file but it couldn't find the directory
i've attached the file for the custom component
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You had instantiation of constant in AD9833.h
> const int SINE = 0x2000; // Define AD9833's waveform register value.
> const int SQUARE = 0x2028; // When we update the frequency, we need to
> const int TRIANGLE = 0x2002; // define the waveform when we end writing.
> const long refFreq = 25000000; // On-board crystal reference frequency
I moved them in AD9833.c and made them extern
< extern const int SINE ; // Define AD9833's waveform register value.
< extern const int SQUARE ; // When we update the frequency, we need to
< extern const int TRIANGLE ; // define the waveform when we end writing.
< extern const long refFreq ; // On-board crystal reference frequency
In AD9833.c
sdata_write() needed to be `$INSTANCE_NAME`_SDATA_Write()
Since you were using pow(), I added included "math.h" and add "m" in Linker Library
Build Settings > <Project> > ARM GCC 5.4-.. > Linker > General > Additional Libraries : m
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DavidFarid,
Please follow these steps to attach the project: (1) Build->Clean. (2) File->Create archive bundle->Minimal. (3) In newly created zip file delete Generated_source folder to reduce the Archive size.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You had instantiation of constant in AD9833.h
> const int SINE = 0x2000; // Define AD9833's waveform register value.
> const int SQUARE = 0x2028; // When we update the frequency, we need to
> const int TRIANGLE = 0x2002; // define the waveform when we end writing.
> const long refFreq = 25000000; // On-board crystal reference frequency
I moved them in AD9833.c and made them extern
< extern const int SINE ; // Define AD9833's waveform register value.
< extern const int SQUARE ; // When we update the frequency, we need to
< extern const int TRIANGLE ; // define the waveform when we end writing.
< extern const long refFreq ; // On-board crystal reference frequency
In AD9833.c
sdata_write() needed to be `$INSTANCE_NAME`_SDATA_Write()
Since you were using pow(), I added included "math.h" and add "m" in Linker Library
Build Settings > <Project> > ARM GCC 5.4-.. > Linker > General > Additional Libraries : m
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks
just for the record i still had problems with the extern
change const int SINE = 0x2000; with #define SINE 0x2000 and it work just fine