Arduino DUE SPI MAX4823E

I would like to turn on and off OUT2 (the code might be for OUT7?)

as I didn't get it working I made this sketch that tries a few options

https://datasheets.maximintegrated.com/en/ds/MAX4822-MAX4825.pdf

#include <SPI.h> // Include the SPI Library

void setup() {
SPI.begin(52);  //CS PIN - 10,4, or 52
SPI.setClockDivider(52,21); //4MHz SPI
}

void loop() {
SPI.setBitOrder(LSBFIRST);
SPI.setDataMode(52,0);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setDataMode(52,1);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setDataMode(52,2);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setDataMode(52,3);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setBitOrder(MSBFIRST);
SPI.setDataMode(52,0);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setDataMode(52,1);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setDataMode(52,2);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);

SPI.setDataMode(52,3);
delay(50);
SPI.transfer(52, 00000010);
delay(100);
SPI.transfer(52, 00000000);
delay(100);
}

It still doesn't work.

Wiring:
MAX4823E -> Arduino DUE
CS -> Pin52
DIN -> SPI DATA MOSI
SCLK -> SPI CLK
RESET & SET is pulled up, they are both low active
VCC, GND connected accordingly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.