Program hangs on ELECHOUSE_cc1101.Init(); if connected to powersupply

Dear all,

I have connected my Lolin-s2 mini to a CC1101 external module and using the SmartRC-CC1101-Driver-Lib library to interact with it.

My program runs perfectly and I can follow on the serial monitor all the steps. The radio signal sent, is what I expect.

When I disconnect the S2 from the usb connected to the pc and add it to a external power supply or power bank, the program runs until the below line

ELECHOUSE_cc1101.Init();

and it freezes (extensive debug to identify the blocking point). I also removed all serial connection and output.
Instead, if the S2 is connected to the usb of the pc is working regardless if there is a serial monitor open or not.

Below the pinout connection and the code snippet

+=============+===================+
| CC1101 Pin  |   ESP32-S2 Pin    |
+=============+===================+
| 1 GND       | GND               |
+-------------+-------------------+
| 2 3V3       | 3V3               |
+-------------+-------------------+
| 3 GDO0 (TX) | GPIO-5            |
+-------------+-------------------+
| 4 CSN       | GPIO-12 (FSPICLK) |
+-------------+-------------------+
| 5 SCK       | GPIO-7            |
+-------------+-------------------+
| 6 MOSI      | GPIO-11 (FSPID)   |
+-------------+-------------------+
| 7 MISO      | GPIO-9  (FSPIHD)  |
+-------------+-------------------+
| 8 GDO2 (RX) | GPIO-3            |
+-------------+-------------------+
bool initCC1101(float mhz) {
  ELECHOUSE_cc1101.Init();             // <--- CODE BLOCKS HERE, led does not turn off if not connected to pc
  digitalWrite(LED_BUILTIN, LOW); 
  ELECHOUSE_cc1101.setGDO(TXPin, RXPin); // GDO0, GDO2

  digitalWrite(LED_BUILTIN, LOW);
  
  ELECHOUSE_cc1101.setSpiPin(SCKPin, MISOPin, MOSIPin, CSNPin);

  ELECHOUSE_cc1101.setMHZ(mhz);
  ELECHOUSE_cc1101.SetTx();
  ELECHOUSE_cc1101.setModulation(2);
  ELECHOUSE_cc1101.setDRate(512);
  ELECHOUSE_cc1101.setPktFormat(3);

  // Check the CC1101 Spi connection.
  if (!ELECHOUSE_cc1101.getCC1101()) {
    return false;  // Failure
  }

  // Turn off tx
  digitalWrite(TXPin, 0);

  return true;  // Success
}

Any ideas or suggestion please?

Kind regards,
dk

EDIT: using a usb power only cable (no data) seems not to block, but I have the feeling the range of the rf transmission is reduced

It sounds like you are drawing to much power. Please post an annotated schematic showing how it is wired. I do not do well with word questions. Also post links to technical information on the hardware devices.

Appreciate your response, the wiring is as in the table posted, no other components in the middle.

The strange thing I cannot explain is: having the S2 connected as described to the CC1101 module:

  • Connected USB data cable to PC (windows, linux, or linux based appliance with usb port) = it works
  • Same USB data cable or another data cable connected to power supply (different tried), power bank (2 different tried) = code freezes
  • Use a USB power only cable connected to power supply or power bank = it works

The details of the board used are here:
https://www.wemos.cc/en/latest/s2/s2_mini.html

the CC1101 module used:

I can get the same information form a catalog or web site. This or a frizzy are not considered a schematic. Schematic is the language of electronics. In the schematic be sure to include all connections, power, ground, interconnects and power sources.

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