Git Product home page Git Product logo

md_ad9833's People

Contributors

majicdesigns avatar per1234 avatar sveljko avatar vaishnavachath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

md_ad9833's Issues

Link to MD_cmdProcessor is incorrect

IMPORTANT

Before submitting this issue
[x] Have you tried using the latest version of the library?
[x] Have you checked this has not already been submitted and/or resolved?
[x] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

In the example sketch MD_AD9833_Test.ino on line 12 is a comment and link to the required MD_cmdProcessor library. This link is incorrect and points to the repository for MD_AD9833. Correct link address should be: https://github.com/MajicDesigns/MD_cmdProcessor

Your Environment

Library Version: 1.2.4
Arduino IDE version: NA
Microcontroller hardware: NA
OS and Version: NA

Steps to Reproduce

Open example: https://github.com/MajicDesigns/MD_AD9833/blob/main/examples/MD_AD9833_Test/MD_AD9833_Test.ino

Expected Behaviour

Link should point to correct library.

Actual Behaviour

Link points to this library.

Code Demonstrating the Issue

// Dependencies:
// MD_cmdProcessor is available at https://github.com/MajicDesigns/MD_AD9833
//

When switching to MODE_OFF from MODE_SQUARE1, the output stays high

IMPORTANT

Before submitting this issue
[x] Have you tried using the latest version of the library?
[x] Have you checked this has not already been submitted and/or resolved?
[ ] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

When switchiung to MODE_OFF from MODE_SQUARE1, the output stays high. Switching off from all other modes results in the expected low output

Your Environment

Library Version:1.2.0
Arduino IDE version:platformio
Hardware model/type:esp32
OS and Version:windows10

Steps to Reproduce

Just turn Square1 on, then off, and check the output

Expected Behaviour

output should be low after OFF

Actual Behaviour

output is high, but only after OFF from square1

Code Demonstrating the Issue

AD.setMode(MD_AD9833::MODE_SQUARE1);
delay(1000);
AD.setMode(MD_AD9833::MODE_OFF);
//output is now high

AD.setMode(MD_AD9833::MODE_SQUARE2);
delay(1000);
AD.setMode(MD_AD9833::MODE_OFF);
//output is now low

AD.setMode(MD_AD9833::MODE_TRIANGLE);
delay(1000);
AD.setMode(MD_AD9833::MODE_OFF);
//output is now low

AD.setMode(MD_AD9833::MODE_SINE);
delay(1000);
AD.setMode(MD_AD9833::MODE_OFF);
//output is now low

Frequency over 30kHz

I can´t set the Frequency over 30kHz, is their a lock in the library that blocks everything over a specific Frequency?

add reset() method

I try to build a sweep sine generator with this library and can't find a method to reset the ad9833 chip.
The problem is - when I start the sweep, the phase accumulator of ad9833 is not zero and each new sweep starts from a random phase.
Existing MD_AD9833::begin() method does the job but it is too slow - it takes 220us (which is almost quarter of 1kHz wave).

If there would be a method that triggers the reset bit of ad9833 and works fast it would be great!

Compiling errors for esp32s3

IMPORTANT

Before submitting this issue
[X] Have you tried using the latest version of the library?
[X] Have you checked this has not already been submitted and/or resolved?
[0] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

Describe your issue here.

I get errors while compiling example

Your Environment

Library Version: 1.2.2
Arduino IDE version:2.1.1
**Hardware model/type: ESP32S3DEV **
OS and Version: Windows 10 22h2

Steps to Reproduce

Explain how to reproduce this issue. Please provide working code below to demonstrate the issue.

Compiling the folowing code

Expected Behaviour

Explain what should happen.

Succesful Compiling

Actual Behaviour

Explain what happens instead. Provide log messages if relevant.
C:\Users\cob01\AppData\Local\Temp.arduinoIDE-unsaved2023710-9084-8c2zpa.xot4\MD_AD9833_Cycle\MD_AD9833_Cycle.ino:13: warning: "FSYNC" redefined
#define FSYNC 10 ///< SPI Load pin number (FSYNC in AD9833 usage)
c:\Users\cob01\Documents\Arduino\libraries\MD_AD9833\src\MD_AD9833.cpp:282:23: error: 'freq_select' may be used uninitialized in this function [-Werror=maybe-uninitialized]
spiSend(freq_select | (uint16_t)((_regFreq[chan] >> 14) & 0x3fff));

// Basic MD_AD9833 test file
//
// Initialises the device to default conditions
//
// Connect a pot to A0 to change the frequency by turning the pot
//
#include <MD_AD9833.h>
#include <SPI.h>

// Pins for SPI comm with the AD9833 IC
#define DATA 11 ///< SPI Data pin number
#define CLK 13 ///< SPI Clock pin number
#define FSYNC 10 ///< SPI Load pin number (FSYNC in AD9833 usage)

MD_AD9833 AD(FSYNC); // Hardware SPI
// MD_AD9833 AD(DATA, CLK, FSYNC); // Arbitrary SPI pins

#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))

void setup(void)
{
AD.begin();

/*
AD.setMode(MD_AD9833::MODE_TRIANGLE);
delay(2000);
AD.setMode(MD_AD9833::MODE_OFF);
delay(2000);
//output is now low

AD.setMode(MD_AD9833::MODE_SINE);
delay(2000);
AD.setMode(MD_AD9833::MODE_OFF);
delay(2000);
//output is now low

AD.setMode(MD_AD9833::MODE_SQUARE1);
delay(2000);
AD.setMode(MD_AD9833::MODE_OFF);
delay(2000);
//output is now high

AD.setMode(MD_AD9833::MODE_SQUARE2);
delay(2000);
AD.setMode(MD_AD9833::MODE_OFF);
delay(2000);
//output is now low
*/
}

void loop(void)
{
static bool bOff = false;
static uint8_t m = 0;
static MD_AD9833::mode_t modes[] =
{
MD_AD9833::MODE_TRIANGLE,
MD_AD9833::MODE_SQUARE2,
MD_AD9833::MODE_SINE,
MD_AD9833::MODE_SQUARE1
};

if (bOff)
AD.setMode(MD_AD9833::MODE_OFF);
else
{
AD.setMode(modes[m]);
m++;
if (m == ARRAY_SIZE(modes)) m = 0;
}
bOff = !bOff;
delay(2000);
}

Insert your code here.

Changing the MCLK frequency without changing the .h file

IMPORTANT

Before submitting this issue
[X] Have you tried using the latest version of the library?
[X] Have you checked this has not already been submitted and/or resolved?
[X] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

I would like to be able to change the clock frequency without changing the .h file for my projects.

Your Environment

Library Version: 1.2.3
Arduino IDE version: 2.1.1
Microcontroller hardware: RP2040
OS and Version: Mac OSX 13.5.1

Steps to Reproduce

I have low frequency requirements in some projects, therefore I use a 2.5MHz clock instead of the 25MHz clock. To make the calculations correct in my project, I change the MD_AD9833_lib.h file to reflect this.

Would it be possible to change the line 86 to:

#ifndef AD_MCLK
#define AD_MCLK 25000000UL ///< Clock speed of the AD9833 reference clock in Hz
#endif

to allow setting the clock frequency in the sketch? Then I do not need to edit the .h file in between projects with different clock frequencies.. Now this edit in the .h file is overwritten during an update of the library.

Thanks!

AD9833 Frequency Setting is not atomic

IMPORTANT

Before submitting this issue
[X ] Have you tried using the latest version of the library?
[X ] Have you checked this has not already been submitted and/or resolved?
[X ] If you are requesting help a better choice may be the Arduino forum

Subject of the issue

AD9833 Frequency Setting is currently not an atomic operation.

Your Environment

Library Version: 1.2.0
Arduino IDE version: 1.8.13
Hardware model/type: Arduino Uno and cheap AD9833 module
OS and Version: Windows 10

Steps to Reproduce

Perform a continual sweep of frequency, or derive the value of the frequency from a potentiometer.

Expected Behaviour

As the input value changes, there should be a smooth transition between frequencies.

Actual Behaviour

At certain values, there is an audible "click" when changing frequency.

In the function setFrequency, the library states the assumption that B28 is continually set and therefore does not need a control register write to set it every time prior to writing out the two frequency values using spiSend. However experimentation suggests that this results in a "click" at certain frequencies when attempting to smoothly change the frequency in the audio ranges and viewing the signal on a scope does show discontinuities in the frequency as it changes around certain values.

The datasheet seems somewhat ambiguous on the topic however Figure 28 (the flowchart for a write) does imply that the B28 bit ought to be set for every frequency update to ensure an atomic update.

Adding the line spiSend(_regCtl); prior to the two spiSend calls to update the frequency does seem to remove the click and results in a smooth frequency update which seems to confirm that B28 has to be set for every write.

Code Demonstrating the Issue

void loop () {
    // Assuming a 10k pot on A0
    AD.setFrequency(MD_AD9833::CHAN_0, analogRead(A0));
}

No Pin Control

This library, just like every other library I have found on this chip, has no ability to enable pin control. the AD9834 can be register controlled (Reset, Phase0/1, Freq0/1) as well as Pin controlled.

I need the ability to have pin control so I can use a physical chip pin to reset the chip, but more importantly, so I can Phase and Frequency modulate the output from external hardware.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.