0
\$\begingroup\$

I'm trying to understand a problem I'm having related to a USB connection. I'm working with a Mini PCIe 4G module (Quectel EC25 Mini PCle 4G/LTE) and at this moment my goal is to put it in sleep mode. I'm communicating with the module via UART (RX and TX) from which I send AT commands through a microcontroller (I'm using an atmega4809). I also have the module connected to a Raspberry Pi 4 through USB.

In order to put the module to sleep three conditions must be fulfilled (pag. 25 of manual):

  1. Write the AT Command for sleep mode
  2. Pull DTR pin to high
  3. Put the USB connection in suspended mode.

Following these rules, the module enters sleep mode.

My problem is that I'm trying to put the 4G module in sleep mode with the third condition replaced by turning off the RPI (that is connected with USB). It doesn't work and I'm trying to figure out why. If I execute condition 1, then condition 2, followed by turning off the RPI the module does not enter in sleep mode. However, if after turning the RPI off I disconnect manually the USB connection, the module enters sleep mode. So, it should be something related to USB suspended mode.

What is the standard for USB suspended mode and how is different from a disconnected cable? And any idea on how can I "simulate" a USB suspended mode to trick the 4G module to think that whatever is connected in the USB is in suspended mode

This is schematics of the USB connector and the 4G module:

enter image description here

PS: I'm not a professional, just currently a hobbyist trying to develop a DIY project.

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

What is the standard for USB suspended mode and how is different from a disconnected cable?

In connected state the bus conducts two actions:

  1. Device side maintains 1.5k pull-up;
  2. Host side sends periodic frame packets, 1ms (or 125 us) frames. (in LS mode these are simple pulses called "keep alive")

If the pull-up (device side!) disappears just for 2.5 us, the host identifies this state as DISCONNECT. Since the host keeps 15 k pull-downs on both D+ and D-, cable disconnect causes the same condition - single-ended zero.

If the host stops the transmission of SOFs (Start of Frames or "keepalive") for more than 3 ms, the device must recognize this as SUSPEND, and act accordingly by transitioning into low power state.

Therefore, to "simulate" SUSPEND state of the USB, you need to terminate bus "activity". One way is to disconnect both D+ and D- wires on host side while maintaining the VBUS connection. Normal way, however, is to sent SUSPEND command from inside RPi to corresponding (selected) port, which will block all data transmission and create SUSPEND state (after 3 ms).

\$\endgroup\$
0
0
\$\begingroup\$

condition 1, then condition 2, followed by turning off the RPI the module

Turning OFF the RPI will pull the DTR pin LOW. Thus condition 2 cannot be met any longer.

EDIT: Misread the question, DTR is from the other µC.

USB suspend keeps the bus in the idle state, which is one data line high and one data line low (and VBUS present).

If you turn off the RPi power, you cannot keep that one USB data line up. Both data lines down (SE0) for a "long" time is USB bus reset, and that turns off USB suspend.

\$\endgroup\$
3
  • \$\begingroup\$ No, I'm using the microcontroller to put and keep DTR HIGH. \$\endgroup\$ Commented Feb 2, 2021 at 15:18
  • \$\begingroup\$ Note: There is a 1k5 pullup resistor in all USB devices on one of the data lines, that is also used to detect device attatch/detatch. Many USB devices include that pullup on-chip. \$\endgroup\$ Commented Feb 2, 2021 at 18:42
  • \$\begingroup\$ Thanks for the info. Yes, I think is related to that. I have checked and when in suspension mode one of the data lines is pulled up. \$\endgroup\$ Commented Feb 3, 2021 at 10:24

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.