1 2 Previous Next 21 Replies Latest reply on May 7, 2020 2:28 AM by MoTa_728816

    The new pcb without miniprog is not working.

    eeEn_4618901

      I made a new PCB board with PSOC chip. I installed this new chip program with miniprog3. the card works when I energize it with the programmer. But if I connect an external source it keeps working 1 time, what could be the reason?

        • 1. Re: The new pcb without miniprog is not working.
          MoTa_728816

          Hi,

           

          Although I think that some of us already know about your project,

          it is a good idea and manner to describe your environment,

          such as the device and the development environment.

           

          Now I assume that you are using

          Device: CY8C5888LTI-LP097

          Dev. Env: PSoC Creator v 4.3

          Programmer: MiniProg3

          Correct me if some of above is/are not crrect.

           

          So from what you wrote

          (1) The program works when powered by MiniProg3

          (2) But it has problem when MiniProg3 is not connected and the device is powered from an external power source.

          (3) BTW, I don't understand what you meant by "it keeps working 1 time."

               Does it mean, it works for the first power up, but it stops working from the 2nd power up or reset?

               Or does it stop working after some time passed?

           

          Right now, what I can imagine are

          - The hardware design around power may have problem.

          - The circuit around reset may have problem.

          - Being a software engineer, I can not go much further,

            it will help others to help you if you can provide your circuit.

            At least around "power", "reset" and PSoC connection.

           

          moto

          P.S. Oh, you could have put link to your previous discussion below.

          Still your circuit will be very important though.

          Psoc 5lp new pcb card

          • 2. Re: The new pcb without miniprog is not working.
            eeEn_4618901

            Hi,

            I changed the chip.

            Device: CY8C5868AXI-LP035

            Dev. Env: PSoC Creator v 4.3

            Programmer: MiniProg3

            If I connect it as in figure a, it works without problems. It does not work if I connect it as in figures b and c.

            miniprog prog.jpg

            Best Regards

            • 3. Re: The new pcb without miniprog is not working.
              MoTa_728816

              Hi,

               

              I wonder if you connect Target, GND, and XRES with MiniProg3, does it work or not?

               

              moto

              • 4. Re: The new pcb without miniprog is not working.
                eeEn_4618901

                Hi, If I connect with Target, GND, and XRES MiniProg3, it still doesn't work.

                • 5. Re: The new pcb without miniprog is not working.
                  MoTa_728816

                  Hi,

                   

                  > Hi, If I connect with Target, GND, and XRES MiniProg3, it still doesn't work.

                  That is interesting!

                   

                  How about connect SDA and SCL to VDD via some resistors such as 4.4K (2 ~ 10k Ohm)?

                   

                  moto

                  • 6. Re: The new pcb without miniprog is not working.
                    MoTa_728816

                    Hi,

                     

                    If the previous test works.

                    May be, you can test with the external power supply and connecting an external I2C device, such as the CradKb.

                     

                    moto

                    • 7. Re: The new pcb without miniprog is not working.
                      eeEn_4618901

                      Hi, there is no resistors.

                      • 8. Re: The new pcb without miniprog is not working.
                        MoTa_728816

                        Hi

                         

                        Then please try with the CardKb attached.

                         

                        moto

                        • 9. Re: The new pcb without miniprog is not working.
                          eeEn_4618901

                          hi, likewise the problem persists. Works with miniprog3. It does not work with dc adapter. Could there be a problem with crystal? Best Regrads.

                          • 10. Re: The new pcb without miniprog is not working.
                            MoTa_728816

                            Hi,

                             

                            Currently, I'm suspecting that some I2C call can not return because of the signals seems to be "Busy."

                             

                            To prove it, can you debug using MiniProg3 with Vtarget, GND, XRES connected, and SDA, SCL open.

                            Would you check

                            (1) When you start debug, does the debugger pointer come to the first part of main()?
                            (2) Place a break at the first I2C function call and run. Does the debugger pointer stop at the break point?

                            (3) Step Over the function, does the debugger pointer stop at the next line?

                            (4) From debugger, run (resume), and wait a while, then select pause. Where is the debugger pointer now?

                             

                            If

                            (1) fails, there may be some "real" hardware issue

                            (2) fails, there must be some more problem(s) which I have not been able to figure out is taking place

                            (3) fails, this is what I'm suspecting, may be we need to implement timeout for I2C functions.

                            (4) Probably where the pointer is at or lines before it has the problem.

                             

                            moto

                            • 11. Re: The new pcb without miniprog is not working.
                              eeEn_4618901

                              To prove it, can you debug using MiniProg3 with Vtarget, GND, XRES connected, and SDA, SCL open.

                              OK.Would you check

                              (1) When you start debug, does the debugger pointer come to the first part of main()?

                              YES

                              (2) Place a break at the first I2C function call and run. Does the debugger pointer stop at the break point?

                              YES

                              (3) Step Over the function, does the debugger pointer stop at the next line?

                              YES

                              (4) From debugger, run (resume), and wait a while, then select pause. Where is the debugger pointer now?     

                                 CyDelayCycles_loop:

                              debugger pointer here ===>  SBCS r0, r0, r1          /*  1    2  */

                              Best Regards.

                              • 12. Re: The new pcb without miniprog is not working.
                                MoTa_728816

                                Hi,

                                 

                                Today I came a cross with a KBA which stated that MiniProg3 had 5.6K Ohm pull-up for SDA and SCL.

                                So I think that the absence of pull-up resistor for these signals are causing trouble.

                                 

                                > (4) From debugger, run (resume), and wait a while, then select pause. Where is the debugger pointer now?    

                                >    CyDelayCycles_loop:

                                > debugger pointer here ===>  SBCS r0, r0, r1          /*  1    2  */

                                I'm sorry that I was not very specific, but at least this seems that the program is caught in some kind of loop.

                                (Probably waiting for I2C bus to be ready)

                                 

                                I suspect that this is caused by I2C API of PSoC 5.

                                Although recent version of PSoC 4 has "timeout" but not for PSoC 5.

                                 

                                Probably if you connect pull-up resistors to the I2C pins (SCL, SDA) the program will work.

                                 

                                One possible workaround is...

                                can you set both SDA and SCL to Resistive pull up?

                                001-SDA_pull-up.JPG

                                moto

                                • 13. Re: The new pcb without miniprog is not working.
                                  eeEn_4618901

                                  Hi, I set both SDA and SCL to Resistive pull up. still the same.

                                  • 14. Re: The new pcb without miniprog is not working.
                                    MoTa_728816

                                    Hi,

                                     

                                    Thanks for testing.

                                    Since it did not work, please revert those pins to Open drain to avoid further confusion.

                                    002-SDA_open_drain.JPG

                                     

                                    Then, I wrote earlier, probably the root cause is I2C API is stuck in some of the wait loop(s) when I2C bus does not react as expected.

                                    Namely, following functions have while loop without timeout, which can stuck.

                                    I2C_MasterSendStart()

                                    I2C_MasterSendRestart()

                                    I2C_MasterSendStop()

                                    I2C_MasterWriteByte()

                                    I2C_MasterReadByte()

                                     

                                    So I hacked a version with timeout for them and included in the cardkb.h and cardkb.c attached.

                                    I2C_MasterSendStart_TMO()

                                    I2C_MasterSendRestart_TMO()

                                    I2C_MasterSendStop_TMO()

                                    I2C_MasterWriteByte_TMO()

                                    I2C_MasterReadByte_TMO()

                                     

                                    Would you try replacing these two file and test if it can fix the problem?

                                     

                                    moto

                                    1 2 Previous Next