Hi all,
I am new with the teensy, I got 3.2, I am trying to control PGA2311 with the SPI channel.
I followed the SPI lib guide page to make the conections (https://www.pjrc.com/teensy/td_libs_SPI.html)
Teensy 8 (SS) to PGA2311 2 (CS)
Teensy 11 (MOSI) to PGA2311 3 (SDI)
Teensy 12 (MISO) to PGA2311 7 (SDO) optional..
Teensy 13 (CLK) to PGA2311 6 (SCLK)
I didnt got any change in the behavior of the gain in the PGA, so i decided to check with osciloscope if the teensy SPI channel works as it should.
I found that the SS\CS leg drops down and up but i didnt found any bits sending from leg 11, and also didnt find any clock out from leg 13.
maybe the scope configurations??
i have connected the probe to the 13 leg, the ground is connected to the GND next to 0 leg.
and this is my simple code:
btw, what are those spi modes SPI_MODE0\1\2\3 ?
I hope i did something wrong...
Thanks a lot!
Best
I am new with the teensy, I got 3.2, I am trying to control PGA2311 with the SPI channel.
I followed the SPI lib guide page to make the conections (https://www.pjrc.com/teensy/td_libs_SPI.html)
Teensy 8 (SS) to PGA2311 2 (CS)
Teensy 11 (MOSI) to PGA2311 3 (SDI)
Teensy 12 (MISO) to PGA2311 7 (SDO) optional..
Teensy 13 (CLK) to PGA2311 6 (SCLK)
I didnt got any change in the behavior of the gain in the PGA, so i decided to check with osciloscope if the teensy SPI channel works as it should.
I found that the SS\CS leg drops down and up but i didnt found any bits sending from leg 11, and also didnt find any clock out from leg 13.
maybe the scope configurations??
i have connected the probe to the 13 leg, the ground is connected to the GND next to 0 leg.
and this is my simple code:
Code:
#include <SPI.h> // include the SPI library:
const int slaveSelectPin = 8;
void setup() {
// set the slaveSelectPin as an output:
pinMode (slaveSelectPin, OUTPUT);
// initialize SPI:
Serial.begin(9600);
// SPI.setSCK(13); // SCK on pin 13
// SPI.setMOSI(11);
SPI.begin();
}
void loop() {
// take the SS pin low to select the chip:
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
digitalWrite(slaveSelectPin,HIGH);
delayMicroseconds(10);
digitalWrite(slaveSelectPin,LOW);
delayMicroseconds(10);
SPI.transfer(0x55);
SPI.transfer(0x55);
// take the SS pin high to de-select the chip:
digitalWrite(slaveSelectPin,HIGH);
SPI.endTransaction();
delay(200);
}
btw, what are those spi modes SPI_MODE0\1\2\3 ?
I hope i did something wrong...
Thanks a lot!
Best
Last edited: