8 Replies Latest reply on Mar 7, 2013 2:41 AM by user_1377889

    PSoC 1 Tx and Rx on J13 ?

    riko.husin

      Friends,

         

       

         

      Can I connect directly to external device from Tx and Rx at J13 ? For example I wanna send 0x01 to another device from PSoC 1?

         

      Then send command to Tx with UART_CPutString("My command");

         

      what's the different between UART_CPutString and UART_PutString

         

       

         

      thank you

        • 1. Re: PSoC 1 Tx and Rx on J13 ?
          rajiv.vasanth.badiger

          Yes, in CY3210-PSoC Eval board, you can use J13 header to connect TX and RX lines to any IO pin of PSoC device on the board. Remember to remove JP1 and JP2 jumpers, which when placed, connects specific pins of PSoC to RX and TX. 

             

           

             

          In UART_CPutString API, the string has to reside in flash, whereas, in UART_PutString API, string has to be in RAM. For more details, please see the user module datasheet of UART.

          • 2. Re: PSoC 1 Tx and Rx on J13 ?
            user_14586677

            Just to be clear, J13 is the TTL/CMOS side of RS232 physical layer. So if

               

            you connect to another TTL/CMOS device, you are good to go. But if you

               

            are trying to connect to full RS232 signaling spec device, that has to be done

               

            on the DB9 side of the translator.

               

             

               

            With respect to the 2 LCD printing f()'s keep in mind either string, ROM or RAM,

               

            must be null terminated with a '\0'. When you enclose a string in ""initiating a

               

            variable, compiler adds the null for you, as in

               

             

               

            unsigned char pString [ 20 ] = "This is a test"

               

             

               

            but RAM based string you have to specifically add the null character after you

               

            load string, unless you are using some of the string functions in extended library.

               

             

               

            Regards, Dana.

            • 3. Re: PSoC 1 Tx and Rx on J13 ?
              riko.husin

              So for example I wanna send hexa 01 , I'm going to put the code like this below :

                 

               

                 

              //start UART begin
                  mov   A, UART_PARITY_NONE
                  lcall UART_1_Start            ; Enable UART

                  mov   A, >sRomString3
                  mov   X, <sRomString3
                  lcall UART_1_CPutString       ; Display example string
                  lcall UART_1_PutCRLF
              //UART END

                 

               

                 

              sRomString3:
              DS "01"
              db 00h

                 

               

                 

               

                 

              or should I put DB 01 ?

                 

              And how can I read from RX ?

                 

              Thank you

              • 4. Re: PSoC 1 Tx and Rx on J13 ?
                user_14586677

                Here is a project you can consider -

                   

                 

                   

                http://www.cypress.com/?id=4&rID=58574

                   

                 

                   

                Regards, Dana.

                • 5. Re: PSoC 1 Tx and Rx on J13 ?
                  user_1377889

                  Did you consider to write your program in "c" which will make it more readable (fewer overlooked errors) no prolemds with definitions (0x01 will always be the same). The APIs are shown in C as well as in assembly.

                     

                   

                     

                  Bob

                  • 6. Re: PSoC 1 Tx and Rx on J13 ?
                    riko.husin

                    How can I use this one :

                       

                     

                       
                        
                         
                    lcall  UART_bReadRxData
                         
                    mov   [bRxData],A  How can I define [bRxData] ?  and display the character into LCD ? thanks
                        
                       
                    • 7. Re: PSoC 1 Tx and Rx on J13 ?
                      riko.husin

                      char c;
                          
                          UART_1_Start(UART_PARITY_NONE);      /* Enable UART */
                          UART_1_CPutString("Read from RX"); // Example string */
                          UART_1_PutCRLF();
                          
                          LCD_1_Start();                       /* Init the LCD */
                          LCD_1_InitBG(LCD_1_SOLID_BG);
                          LCD_1_Position(0,0);
                          LCD_1_PrCString("PSoC LCD");
                          
                          c = UART_1_cGetChar();
                          LCD_1_PrCString(c);

                      • 8. Re: PSoC 1 Tx and Rx on J13 ?
                        user_1377889

                        Before calling UART_GetChar() you have to check if there is a character already received. Check the Rx-Status first.

                           

                         

                           

                        Bob