This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/CC1310: How to control the switching of multiple working modes by two GPIO pins

Part Number: CC1310


Tool/software: TI-RTOS

Hi Team,

My project needs to implement such a function: four operating modes are controlled by two pins.

I have encountered several difficulties in implementation:

1.I put the four modes of code in the same task and constantly polling the pin level,like if(read(pin1)&read(pin2))do something;Since my UART uses blocking mode, the task can't detect the level change when the pin is switched, so it doesn't make sense.

2.How to implement the logic of entering and exiting shutdown mode with two pin control modules?

My approach may not be reasonable. Do you have any good ideas?

  • Could you elaborate a bit why you want to implement it like this, why do you want to define modes like this?
  • Hi TER,
    Our request is like this, the purpose is to make the module more versatile and flexible, to adapt to the needs of different occasions.which is also a common type of wireless module.

    The first two modes are for UART and RF applications, the difference is only the length of the preamble.The third mode is to save power while maintaining the reception of air data. At this time, the serial port can only print data.The fourth mode is for the lowest power consumption of the product.

    But I think there are a lot of things to consider when switching between modes, such as whether the way to select a pin is interrupted or polled.Is it done with one task or multiple tasks?Can you provide some good implementation ideas based on my question?
  • I guess my should have been: Why do you want the mode switch done with the level on two pins and not via software/ other inputs?

    Does that mean you are planning to have a main CPU that controls CC1310 and if so, why do you need this since CC1310 is a wireless MCU?

    I believe you have to have a separate pin for shutdown. Also, polling the pins will be inefficient, interrupt (edge) based would be better.
  • Yes, software control switching will be better, but our customer needs are like this. Externally we used an MSP430 microcontroller to control the CC1310. Our peripheral functions are more, so only one CC1310 can't meet the requirements. It is only used to achieve wireless transmission.

    Do you mean that it is not possible to control shutdown with two pins, only one pin can be used?
  • Out of curiosity, did you run out of IOs since you needed to supplement with a MSP430?

    See 11.11.3 IOC Registers in www.ti.com/.../swcu117h.pdf:
    10: Wakes up from shutdown if this pad is going low.
    11: Wakes up from shutdown if this pad is going high

    Meaning that you would not be able to set that two pins has to be high at the same time to enter shutdown. You have to use a dedicated pin for this.
  • Hi TER,
    IO is sufficient, just use pins to control several modes of operation. The UART blocking task is a big problem. When I detect the level change, how can I cancel the UART blocking operation?
  • You can call write_chancel, check the UART driver.
  • I have a question, our official information said that write_chancel can only be used in callback mode, blocking mode can also take effect?
  • I'm not sure if the documentation is correct here, could you try write_cancel() and see if that does the trick?
  • The actual result is that it works.Thank you TER!