8 Replies Latest reply on Jan 15, 2019 9:15 PM by himam_31

    AT command

    magic_3776931

      Hi,

      I have a psoc 5LP  CY8CKIT-059

      I would like to send AT commands throught Hyperterminal (TeraTerm) using USB port and then send them to a wifi module throught UART.

      How could I manage this situation, because on the psoc I have only one UART port?Otherwise there are other possibilities to get the same result?

        • 1. Re: AT command
          AnkitaS_51

          Are you having issues in using USBUART and UART components simultaneously in a project.

          • 2. Re: AT command
            magic_3776931

            I haven't tried yet,I'm asking if is it possible manage both comunications in my psoc

            • 3. Re: AT command
              AnkitaS_51

              There are no Rx and Tx pins in a USBUART component, it is a USB interface and on the PC side the UART com-port is emulated.

              UART component will have Rx & Tx pins and both can be used in a project.

              • 4. Re: AT command
                himam_31

                Hello,

                 

                Do you want PSoC to act as a USB-UART bridge? Yes it is feasible.

                 

                Thanks,

                Hima

                1 of 1 people found this helpful
                • 5. Re: AT command
                  magic_3776931

                  Thank you for the answer,

                  but I didn't understand maybe I didn't explain in a good way what I'm trying to do or I didn't make the right question.

                  I want to send a message from my pc to one slave mcu throught a master mcu, I would like to send AT command.

                  To do this I need just one component,i.e UART, or I need two components,i.e UART and USBUART?

                  • 6. Re: AT command
                    himam_31

                    Hello

                     

                    Thank you for elaborating. You will need a UART component and a USBUART component. And the firmware should take care or receiving data over USBUART from PC and sending those over the UART.

                     

                    Thanks,

                    Hima

                    1 of 1 people found this helpful
                    • 7. Re: AT command
                      magic_3776931

                      Guys I need your help again, since i'm trying to understand the USB_UART module I'm studying the code example and the datasheet,  but I have  some troubles with a part of the code

                       

                      for(;;){

                      if (0u != USBUART_IsConfigurationChanged())

                              {

                                

                                  /* Initialize IN endpoints when device is configured. */

                                  if (0u != USBUART_GetConfiguration())

                                  {

                                       

                                      /* Enumeration is done, enable OUT endpoint to receive data

                                       * from host. */

                                      USBUART_CDC_Init();

                                  }

                              }

                      ...

                       

                      I dont understand what is mean and why I have two use these two API USBUART_IsConfigurationChanged() and USBUART_GetConfiguration().

                      • 8. Re: AT command
                        himam_31

                        Hello,

                         

                        USBUART_IsConfigurationChanged():

                        This function returns the clear-on-read configuration state. It is useful when the host sends double SET_CONFIGURATION requests with the same configuration number or changes alternate settings of the interface.

                        After configuration has been changed the OUT endpoints must be enabled and IN endpoint must be loaded with data to start communication with the host.

                         

                        USBUART_GetConfiguration(): This function gets the current configuration of the USB device

                         

                        Basically if the function USBUART_GetConfiguration() returns non zero value then that means the device is enumerated and hence the OUT EP has to be enabled. The API USBUART_CDC_Init() will take care of this. Win 7 OS could send double SET_CONFIGURATION requests with same configuration number. In this case user-level code should re-enable OUT endpoints after each request.

                        USBUART_IsConfigurationChanged() function should be used to detect that configuration has been changed from the PC. If it returns a nonzero value, the USBFS_GetConfiguration() API is can be used to get the configuration number. The snippet you have mentioned is for that objective.

                         

                         

                        Thanks,

                        Hima

                        1 of 1 people found this helpful