I am trying to read an ADC a parallel binary data https://datasheets.maximintegrated.com/ ... AX2771.pdf at the speed of 4MSPS with nucleo-H743ZI2. The data is sent with from 2 bins (I0,I1), CLK_out and GNS pin, my main goal is to read the data then save into a file.
Code: Select all
//#define CLK_OUT PC0 //A1
#define CLK_OUT_READ PB1 //A3
#define READ_I1 PA3 //A0
//volatile byte ledState = LOW;
void setup() {
Serial.begin(4000000);
// pinMode(CLK_OUT, OUTPUT);
pinMode(CLK_OUT_READ, INPUT);
pinMode(READ_I1, INPUT);
attachInterrupt(digitalPinToInterrupt(CLK_OUT_READ), IDataRead, FALLING);
}
void loop() {
// ledState = !ledState;
// digitalWrite(CLK_OUT, ledState);
// const uint8_t BIT = (GPIOB->IDR & 0x00000008) >> 1;
}
void IDataRead() {
uint8_t I1 = (GPIOA->IDR & 0x00000008) >> 3;
Serial.println(I1);
}
Q1: how can I test if the the processer is fast enough?
Q2: Is the serial.Print() fast enough , if not what is a faster way to transmit and save the data ?
ps: the Code reads only 1 bit data from bin I1, the ADC can be set from 1 bit output and up to 3 bit
thank you in advance.