1 2 Previous Next 18 Replies Latest reply on Sep 30, 2015 5:23 AM by userc_40511

    UART not working

      Forget marketing. Is UART supported on this  ?

         

      When interrupt is set internal RX interrupts don't trigger, except  UART_INTR_RX_OVERFLOW

         

      When switched to external neither of interrupts trigger.

         

      My code:

         

      EXT_UART_Interrupt_StartEx(myinterrupt_func);

         

      UART_Start();

         

      UART_SetRxInterruptMode(UART_INTR_RX_NOT_EMPTY|UART_INTR_RX_OVERFLOW);
      UART_SetTxInterruptMode(UART_INTR_TX_NOT_FULL|UART_INTR_TX_UART_DONE);

        • 1. Re: UART not working

          And ofcourse:

             

          CY_ISR_PROTO(myinterrupt_func);

             

          CY_ISR(myinterrupt_func){

             

          }

          • 2. Re: UART not working
            DaKn_263916

            Did you enable global interrupts. Without seeing project hard to judge

               

            what is going on.

               

             

               

            “File”                                                             Creator

               

            “Create Workspace Bundle”

               

             

               

             

               

            Regards, Dana.

            • 3. Re: UART not working

              I've succeeded.  RX interrupts are triggered when all intr (RX) are on.

                 

              However during all interrupts (around 8) FIFO is empty , so no data read (and no error). I love it

                 

              UART_RX_FIFO_STATUS_REG is 0 all the time

              • 4. Re: UART not working

                Do You know any UART example working with ProcBLE and Tx and Rx enabled?

                • 5. Re: UART not working

                  Do You know any TRM for this chip?

                     

                  How could it be, that RX_INTR_NOT_EMPTY is triggered, but _RX_FIFO_STATUS_REG is 0? My imagination is failing

                     

                  Status reg inform about data available (first 3 bits)

                     

                  At the same time fifo ctrl reg is 7

                  • 6. Re: UART not working
                    JoMe_264151

                    As Dana already suggested:

                       

                    Can you please post your complete project, so that we all can have a look at all of your settings? To do so, use
                    Creator->File->Create Workspace Bundle (minimal)
                    and attach the resulting file.

                       

                     

                       

                    Bob

                    • 7. Re: UART not working

                      What does it mean if on FIFO reg(0x40240340) there is a value 0xFF, but Cypress API return 0?

                      • 8. Re: UART not working
                        JoMe_264151

                        How can you be sure that you are referring to the right register (0x...) after a build? Maybe you've reset the bits already by reading them.

                           

                        Post your project, we'll see.

                           

                         

                           

                        Bob

                        • 9. Re: UART not working

                          As always marketing is far ahead of reality.

                             

                          in my case FIFO has 0xFF. then fifo is translated into uint32. SO we have 0xFFFFFFFF. Then we get error value and or with FIFO

                             

                          result. In my case (ff OR 0x40) has ff which means error is ff.

                             

                          This is the first BUG i've found here

                          • 10. Re: UART not working

                            How could it be, that NOT_EMPTY event is triggered, but where FIFO read we have event 0x40 ( trying to read empty FIFO)?

                            • 11. Re: UART not working

                              To Bob:

                                 

                              What I see is related to any UART example, so neither example can work. This is why CYpress published example which read FIFO without interrupts. My UART case is real life scenario, and polling byte by byte is not possible

                              • 12. Re: UART not working

                                This is a cypress code where BUG is:

                                   

                                 rxData = Sim900_RX_FIFO_RD_REG;

                                   

                                >>>rxData is 0xFFFFFFFF. How 8-bit FIFO data can become 32bit value is another story to investigate

                                   

                                            /* Enables interrupt to receive more bytes.
                                            * The RX_NOT_EMPTY interrupt is cleared by the interrupt routine
                                            * in case the byte was received and read by code above.
                                            */
                                            #if (Sim900_CHECK_RX_SW_BUFFER)
                                            {
                                                Sim900_EnableInt();
                                            }
                                            #endif
                                        }

                                   

                                        /* Get and clear RX error mask */
                                        tmpStatus = (Sim900_GetRxInterruptSource() & Sim900_INTR_RX_ERR);
                                        Sim900_ClearRxInterruptSource(Sim900_INTR_RX_ERR);

                                   

                                        /* Puts together data and error status:
                                        * MP mode and accept address: 9th bit is set to notify mark.
                                        */
                                        rxData |= ((uint32) (tmpStatus << 8u));

                                   

                                >>>rxData is 0xFFFFFFFF again masking error

                                • 13. Re: UART not working
                                  JoMe_264151

                                  Without your complete project (or at least a project that shows the error) anything could be guessing only.

                                     

                                  What are the component's buffer size? which component do you use and which version? Any other settings that could affect your receiving?

                                     

                                  # of bits, baud, clock settings.......

                                     

                                   

                                     

                                  Bob

                                  • 14. Re: UART not working

                                    I agree. Painful problem isolation. Create the test case is time consuming but I have to find time.

                                       

                                    Meantime I've found out that UART_DONE (for TX line) interrupt  loops forever blocking chip functionality.

                                       

                                    ClearTxInterruptSource(UART_INTR_TX_UART_DONE); doesn't work

                                    1 2 Previous Next