Comments (10)
I tested this the first time with a Giga, which had a newer core. I tested it again with a Portenta, and the Portenta does fail with an older core (4.0.8) but works with the latest (4.1.3).
from arduino_advancedanalog.
This might be related to this issue: arduino/ArduinoCore-mbed#867
But how do you know if it works or not ? The M4 can't use serial to print message. The difference between A0..A3 and A4-A7, is that A0-A3 are dual-pad pins. The M4 may have an issue configuring or accessing them.
from arduino_advancedanalog.
Please note I use Serial1 for M4, which does work with output on UART1 pins.
When I use A0 or A1, I get the message βFailed to start analog acquisition!β on UART1. For A4 to A7, it prints the read values as expected. A2 and A3 don't work either, but that's the expected behavior for ADC1 according to the documentation.
from arduino_advancedanalog.
Ah I see. Well, as I've mentioned those pins happen to be dual-pads pins. That's the only difference, and I'm guessing but there might be an issue we've missed with using them from the M4. I'll give this a try next week.
from arduino_advancedanalog.
I tested this issue and I just can't reproduce it. I tried A0->A4, all seem to work fine, see the screenshot. Note the serial monitor is connect to a USB to serial port.
Sketch:
#include "RPC.h"
#ifdef CORE_CM7
void setup() {
bootM4();
Serial.begin(9600);
}
void loop() {
}
#else
#include <Arduino_AdvancedAnalog.h>
AdvancedADC adc(A0); // not working with A0 or A1. It does work with A4 to A7
uint64_t last_millis = 0;
void setup() {
Serial1.begin(9600);
// Resolution, sample rate, number of samples per channel, queue depth.
if (!adc.begin(AN_RESOLUTION_16, 16000, 32, 128)) {
Serial1.println("Failed to start analog acquisition!");
while (1);
}
}
void loop() {
if (adc.available()) {
SampleBuffer buf = adc.read();
// Process the buffer.
if ((millis() - last_millis) > 20) {
Serial1.println(buf[0]); // Sample from first channel
Serial1.println(buf[1]); // Sample from second channel
last_millis = millis();
}
// Release the buffer to return it to the pool.
buf.release();
}
}
#endif
from arduino_advancedanalog.
Were you using the latest library or an older release ? You should be using 1.4.0.
from arduino_advancedanalog.
I'm using Advanced Analog 1.4.0 and board 4.1.1
I've uploaded your sketch to both cores and I still get the "Failed to start analog acquisition!" message on pin 14. I've even tried changing the #define DUAL_PIN according to commit 992ed2c but I still get the error message.
I'm using a Portenta H7 with no peripherals. Just USB-C for programming and Serial to USB on pin 14 (picture attached).
from arduino_advancedanalog.
@mrubioroy changing only the source files has no effect since the same setting should be applied to the precompiled library. Can you give a spin to core 4.1.3 (just released) that contains the full patch? Thx
from arduino_advancedanalog.
Works now, thank you
If I may, what is a "dual pad" pin?
from arduino_advancedanalog.
If I may, what is a "dual pad" pin?
Special pins that connect to two pads, or used separately as a GPIO pad and an ADC input.
from arduino_advancedanalog.
Related Issues (15)
- Giga R1 Wifi Sample Rate Slower than expected HOT 8
- Programming >2M Samples/sec on DAC seems to cause Giga board to hang HOT 9
- DMA DAC intialization is unstable HOT 8
- Number of ADC channels arbitrarily limited HOT 3
- DAC Output Hangs With No Available DMA Buffer HOT 4
- ADC read speed HOT 10
- Documentation issue - README.md points to wrong repository
- DAC maximum Voltage is low (0.33V) HOT 4
- Sampling with very high frequencies did not work as expected. HOT 12
- Synchronized ADC Capture HOT 3
- Added dual-mode support for ADC. HOT 1
- Programmable Sample Time parameter for faster sample rates
- Doc missing for AdvancedADCDual
- Adding Interleaved Sampling for 2X Sample Rate improvement HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino_advancedanalog.