0.3.4 AD985X

This commit is contained in:
rob tillaart 2022-10-25 19:47:34 +02:00
parent 5fa5018b5f
commit f38eb9bcbc
20 changed files with 151 additions and 111 deletions

View File

@ -1,3 +1,18 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
@ -7,5 +22,6 @@ compile:
# - leonardo
- m4
- esp32
# - esp8266
- esp8266
# - mega2560
- rpipico

View File

@ -1,28 +1,12 @@
//
// FILE: AD985X.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.3.3
// VERSION: 0.3.4
// DATE: 2019-02-08
// PURPOSE: Class for AD9850 and AD9851 function generator
// URL: https://github.com/RobTillaart/AD985X
//
// HISTORY:
// 0.1.0 2019-03-19 initial version
// 0.1.1 2020-12-09 add Arduino-CI
// 0.1.2 2020-12-27 add setAutoMode() + offset
// 0.2.0 2020-12-28 major refactor class hierarchy + float frequency
// 0.2.1 2021-01-10 add get- and setARCCutOffFreq()
// 0.2.2 2021-01-24 add manual updating frequency
// get- setManualFQ_UD(), update()
// inverted SELECT line as preparation for multi-device.
// 0.3.0 2021-06-06 fix factory bit mask + new examples + some refactor
// added multi device document
// 0.3.1 2021-08-25 VSPI / HSPI support for ESP32
// faster software SPI
// minor optimizations / refactor
// 0.3.2 2021-10-16 update Arduino-CI
// 0.3.3 2021-12-10 update library.json, license, readme.md
// fix reset() for ESP32 hardware SPI
// HISTORY: see changelog.md
#include "AD985X.h"
@ -377,3 +361,4 @@ void AD9851::setARCCutOffFreq(uint32_t Hz)
// -- END OF FILE --

View File

@ -2,10 +2,9 @@
//
// FILE: AD985X.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.3
// VERSION: 0.3.4
// DATE: 2019-02-08
// PURPOSE: Class for AD9850 and AD9851 function generator
//
// URL: https://github.com/RobTillaart/AD985X
//
@ -14,7 +13,7 @@
#include "SPI.h"
#define AD985X_LIB_VERSION (F("0.3.3"))
#define AD985X_LIB_VERSION (F("0.3.4"))
#define AD9850_MAX_FREQ (40UL * 1000UL * 1000UL)
@ -49,7 +48,7 @@ public:
uint32_t getFactor() { return _factor; };
// autoUpdate is default true;
void setAutoUpdate(bool update) { _autoUpdate = update; };
void setAutoUpdate(bool update = true) { _autoUpdate = update; };
bool getAutoUpdate() { return _autoUpdate; };
void update();
@ -128,4 +127,6 @@ protected:
};
// -- END OF FILE --

View File

@ -14,10 +14,22 @@ Arduino library for AD9850 and AD9851 function generators.
## Description
Library for the AD9850 and AD9851 function generators.
These devices can produce a square and a sine wave
| type | max frequency | phase (stepsize) |
|:---------|---------------:|-------------------:|
| AD9850 | 40 MHz | 0..31 x 11.25° |
| AD9851 | 70 MHz | 0..31 x 11.25° |
Note that at the max frequency the devices do not give a nice sine anymore.
You need to check what is acceptable for your project.
The library has a AD9850 as base class that implements the commonalities.
The AD9851 is derived and has its own **setFrequency()** methods.
Furthermore the AD9851 also has function to select the reference clock,
a feature the AD9850 does not have.
This feature improves the tuning for both low and high frequencies.
**Warning**
The library is not suitable for AD9852 as that is a function generator with
@ -28,6 +40,7 @@ Note: mainly tested on Arduino UNO. Tweaking for other platforms is expected.
## Connection
Schema break-out
```
TOP VIEW
@ -54,9 +67,10 @@ Note: mainly tested on Arduino UNO. Tweaking for other platforms is expected.
```
### Multi device
See Multi_AD985X_devices.pdf
See **Multi_AD985X_devices.pdf**
Discussion leading to the document see - https://github.com/RobTillaart/AD985X/issues/13
@ -292,4 +306,5 @@ The user is also responsible to store it e.g. in EEPROM to make it persistent.
- examples for ESP32 HWSPI interface
- do tests on ESP32
- performance measurements
- move code to .cpp

View File

@ -1,8 +1,8 @@
//
// FILE: AD9850_demo.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,8 +1,8 @@
//
// FILE: AD9850_demo_float.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,9 +1,8 @@
//
// FILE: AD985X_multi.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo multi device
// DATE: 2021-06-04
// URL: https://github.com/RobTillaart/AD985X
/*

View File

@ -1,9 +1,8 @@
//
// FILE: AD9850_multi_sync.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo multi device
// DATE: 2021-06-06
// URL: https://github.com/RobTillaart/AD985X
// measure speed difference when updating multiple devices
// - sequentially

View File

@ -1,9 +1,8 @@
//
// FILE: AD9851_demo.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,8 +1,8 @@
//
// FILE: AD9851_demo_2.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,9 +1,8 @@
//
// FILE: AD9851_demo_float.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,8 +1,8 @@
//
// FILE: AD9851_manual update.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -0,0 +1,27 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
- uno
# - due
# - zero
# - leonardo
- m4
- esp32
# - esp8266
# - mega2560
# - rpipico

View File

@ -1,8 +1,8 @@
//
// FILE: AD9851_six_potmeter.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,8 +1,8 @@
//
// FILE: AD9851_sweeper.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// PURPOSE: demo
// URL: https://github.com/RobTillaart/AD985X
#include "AD985X.h"

View File

@ -1,9 +1,8 @@
//
// FILE: AD985X_array.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.0
// PURPOSE: demo multi device
// DATE: 2021-06-04
// URL: https://github.com/RobTillaart/AD985X
/*

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/AD985X.git"
},
"version": "0.3.3",
"version": "0.3.4",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*",

View File

@ -1,5 +1,5 @@
name=AD985X
version=0.3.3
version=0.3.4
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for AD9850 and AD9851 function generators. Supports both hardware SPI as software SPI.

View File

@ -27,8 +27,10 @@
unittest_setup()
{
fprintf(stderr, "VERSION: %s\n", AD985X_LIB_VERSION);
}
unittest_teardown()
{
}
@ -36,7 +38,6 @@ unittest_teardown()
unittest(test_constructor)
{
fprintf(stderr, "VERSION: %s\n", AD985X_LIB_VERSION);
AD9850 funcgen0;
AD9851 funcgen1;
@ -47,7 +48,6 @@ unittest(test_constructor)
unittest(test_auto_update)
{
fprintf(stderr, "VERSION: %s\n", AD985X_LIB_VERSION);
AD9850 funcgen0;
AD9851 funcgen1;
funcgen0.begin(4, 5, 6);
@ -191,6 +191,7 @@ unittest(test_ad9851_offset)
assertEqual(0, funcgen.getCalibration());
}
unittest(test_ad9851_float_freq)
{
AD9851 funcgen;