1 2 Previous Next 22 Replies Latest reply on Nov 8, 2020 11:35 PM by MoTa_728816

    Issue with uart

    psco_3295286

      Hello,

       

      I am trying to interface CY8C4245AXI-483 with ESP8266. The code is attached below.

       

      As per my knowledge, the code should get the ip address and also return string 'welcome' , but there is nothing displayed on the serial terminal.

       

      H/W connections apart from GND are :

      MCU tx - ESP rx, FTDI rx

      MCU rx - ESP tx, FTDI tx

      Also, FTDI 3.3 V is given to ESP module.

       

      Please let me know what should be done to at least establish communication between wifi module and MCU.

       

      Thank you.

        • 1. Re: Issue with uart
          GaneshD_41

          Hi,

           

          Please ensure that the GND pin of ESP8266 module is connected to CY8C4245AXI-483 device ground.

           

          For example project on interfacing PSoC with ESP8266, please go through the following web page.

           

          Cypress PSOC 4 + ESP8266 WS2812 RGB XMAS Lights | Hackaday.io

           

          Thanks

          Ganesh

          • 2. Re: Issue with uart
            psco_3295286

            I have already connected GND.

             

            I tried again and found that for    'UART_PutString("AT+CIFSR\r\n");'    serial terminal shows random values like EB, FC etc

            and code stops at    'while(!HaveAnswer) Wait();'   so I suppose there is no answer from device.

             

            Kindly suggest what should be done.

             

            Thank you.

            • 3. Re: Issue with uart
              MoTa_728816

              Hi,

               

              I tried your project using CY8CKIT-042.

              I connected UART_1 to the KitProg's 12[6] and 12[7] and connected to a TeraTerm named "UART_1"

              UART to my FTDI USB-Serial converter and Connected a TeraTerm named "UART"

               

              At first when I ran your program,

              I could see only

              AT_C

              then after reset I saw

              IFSR

              It seems that the UART is sending only 4 bytes,

              so I checked your UART component Configuration

              001a-UART_Config_orig.JPG

              I noticed that TX buffer size was set to 40!

              So I changed it to 4

              001-UART_Config.JPG

               

              Now after starting the program, I could see

              AT+CIFSR

              in UART.

              So after restarting the program and saw "AT+CIFSR" I typed "Ready" and a Enter key.

              Then WELCOME was shown.

              And in the UART_1 TeraTerm my "Ready" was written.

              003-UART.JPG

              002-UART_1.JPG

               

              moto

              1 of 1 people found this helpful
              • 4. Re: Issue with uart
                psco_3295286

                I changed ascii instead of hex in my 'receive' part of serial monitor and now I am getting 'welcome' etc strings.

                Also, I have made changes in the tx buffer size as per your suggestion.

                But there is no communication between esp8266 and mcu, as the code execution doesn't go beyond   ' while(!HaveAnswer) Wait();'

                If my code is ok, are there any changes required in the hardware?

                Thank you.

                • 5. Re: Issue with uart
                  MoTa_728816

                  Hi,

                   

                  I'm glad to hear that you are now receiving strings OK.

                   

                  Since I don't have esp8266, I can't try it on my side,

                  I would suggest you try the following.

                   

                  (1) Connect esp8266 to the USB-UART (FTDI) and type commands from your terminal program

                  and note the exact letters you are sending and receiving. (PC <-> esp8266)

                   

                  (2) Connect PSoC and USB-UART to PC and emulate esp8266 from your second terminal program (UART)

                      I suppose that you will find that your program is not writing or answering the strings just like (1)

                    (PC <-> PSoC)

                   

                  (3) Modify your program to generate/expect exactly the same strings you noted in (1)

                   

                  Hopefully, by doing these, the situation will get better.

                  Meantime I would add some timeout for the wait loop so that the program can retry.

                   

                  moto

                  • 6. Re: Issue with uart
                    psco_3295286

                    Hi,

                    I am not sure whether I have performed the steps you have suggested properly or not. The psoc-pc communication is working (step 2).

                    But I am still having issue with interfacing esp8266.

                    Please guide.

                    Thanks.

                    • 7. Re: Issue with uart
                      MoTa_728816

                      Hi,

                       

                      All I can help is something to do with PSoC and I have no knowledge about esp8266 nor what you want to do with that device.

                       

                      Having written above, have you tried the step (1)?

                      What did you sent from your Terminal program.

                      And what was the response from the device?

                       

                      Would you provide me some (expected) sample conversation between PSoC and esp8266?

                      Such as

                      =================

                      PSoC > AT+CIFSR[EOL]

                      ESP8266 > Ready[EOL]

                      =================

                      Note: [EOL] can be '\n', '\r' or "\n\r" ...

                       

                      moto

                      • 8. Re: Issue with uart
                        psco_3295286

                        The serial monitor doesn't detect the com port when I plug in the kit programmer for UART_1.

                        Although the com port with ftdi for UART is identified.

                        • 9. Re: Issue with uart
                          MoTa_728816

                          Hi,

                           

                          I assume that you are using CY8CKIT-042.

                          Then you need to jumper connect

                          UART_1:rx P4[0] to KitProg's tx 12[7]

                          UART_1:tx P4[1] to KitProg's rx 12[6]

                           

                          Meantime, if you are using KitProg,

                          your PC should detect COM port

                          even if the jumpers are not connected.

                           

                          If it's the case, please download PSoC Programmer from the URL below

                          and update firmware of your kit. (From Utilities Tab > Update Frimware)

                          https://www.cypress.com/documentation/software-and-drivers/psoc-programmer-archive

                           

                          010-PSoC_Programmer.JPG

                           

                          moto

                          • 10. Re: Issue with uart
                            psco_3295286

                            Yes I am using CY8C4245axi-483.

                            I have separated upper part of cy8ckit-059 to program the mcu.

                            Also, I have used jumpers to connect pins12(6), 12(7) to UART_1 and ftdi is connected to UART.

                            • 11. Re: Issue with uart
                              MoTa_728816

                              Hi,

                               

                              You wrote that the KitProg is not detected from your PC.

                               

                              When you connect the KitProg, do LEDs on the KitProg light?

                               

                              Mine (taken from CY8CKIT-043) lights LED3 Green and Power Orange.

                              And my PC is detecting the COM port even the KitProg is not connected to other MCU.

                               

                              If none of the LEDs are lit, may be there is a problem in connection or the KitProg.

                               

                              moto

                              • 12. Re: Issue with uart
                                psco_3295286

                                Both the power LED and LED3 light up. Only the com port is not identified.

                                • 13. Re: Issue with uart
                                  MoTa_728816

                                  Hi,

                                   

                                  Is the Green LED blinking?

                                  If so, please push RESET button and keep it for 5 seconds or so.

                                   

                                  moto

                                  1 of 1 people found this helpful
                                  • 14. Re: Issue with uart
                                    psco_3295286

                                    Hi,

                                    I kept the reset button pushed for a few seconds and it worked. Now the com port is identified.

                                    And I managed to perform what you had done in previous answers, i.e. writing ready and pressing enter will display 'welcome' and 'ready' on 2 different com ports.

                                    Thanks.

                                    Now, the main question is regarding communication with esp8266, which is still unsolved.

                                    1 2 Previous Next