LSatan / SmartRC-CC1101-Driver-Lib

This driver library can be used for many libraries that use a simple RF ASK module, with the advantages of the cc1101 module. It offers many direct setting options as in SmartRF Studio and calculates settings such as MHz directly.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wiring for Arduino Leonardo and Uno - verification needed

OevreFlataeker opened this issue · comments

I wanted to try this library with a CC1101 module I bought on ebay. The board resembled the green middle one on https://github.com/LSatan/SmartRC-CC1101-Driver-Lib/blob/master/img/Wiring_CC1101.png and has 2x4 pins.

I wired as follows on my Leonardo:

black : GND
blue: D11
green: D12
yellow: D6
red: VCC 3,3V
purple: D13
grey: D2
orange: D10

Then I compiled and uploaded example sketch: SmartRC-CC1101-Driver-Lib/CC1101 Default Examples/New_method_without_GDO0/cc1101_New_transmit_method_serial_minimal

Absolutely nothing happens. Funnily enough not even the code

    Serial.begin(9600);    
    if (ELECHOUSE_cc1101.getCC1101()){         // Check the CC1101 Spi connection.
    Serial.println("Connection OK");
    }else{
    Serial.println("Connection Error");
    }

seems to print anything?

Other sketches which print on the serial work fine

Is my wiring correct for the Arduino Leonardo?

I am using a Flipper Zero reading on 433.92 MHz to verify any transmission (nothing is recorded)

Changing the setup() code to:

...
 Serial.begin(9600);
     while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
    Serial.println("Before everything");
    if (ELECHOUSE_cc1101.getCC1101()){         // Check the CC1101 Spi connection.
    Serial.println("Connection OK");
    }else{
    Serial.println("Connection Error");
    }

now successfully prints "Connection error" which is kind of expected. But what's wrong with the wiring them?

According to the code in setSpiI():

void ELECHOUSE_CC1101::setSpi(void){
  if (spi == 0){
  #if defined __AVR_ATmega168__ || defined __AVR_ATmega328P__
  SCK_PIN = 13; MISO_PIN = 12; MOSI_PIN = 11; SS_PIN = 10;
  #elif defined __AVR_ATmega1280__ || defined __AVR_ATmega2560__
  SCK_PIN = 52; MISO_PIN = 50; MOSI_PIN = 51; SS_PIN = 53;
  #elif ESP8266
  SCK_PIN = 14; MISO_PIN = 12; MOSI_PIN = 13; SS_PIN = 15;
  #elif ESP32
  SCK_PIN = 18; MISO_PIN = 19; MOSI_PIN = 23; SS_PIN = 5;
  #else
  SCK_PIN = 13; MISO_PIN = 12; MOSI_PIN = 11; SS_PIN = 10;
  #endif
}```

my wiring looks correct? I also switched MISO/MOSI just in case, but still get "Connection error"


OK, I just learnt there is a v1 and v2 of the module. Apparently you usually get v2 these days. The pinout is totally different! That's the correct wiring for v2:

pinout_CC1101_433

I couldn't get my module to work though - I presume it's because I connected it to 5v during testing and fried the board, as it is a 3.3v only....