1 Reply Latest reply on Aug 29, 2017 6:36 AM by user_1377889 Branched from an earlier discussion.

    Re: Need to receive data in Unconfigured SCB Component which is configured as UART in Firmware?

    ranjithr4777_1983851

      This is the complete code of my Project and below this code I have uploaded the Screen Shot.

       

       

      #include "project.h"


      #define ENABLED         (1u)
      #define DISABLED        (0u)
      #define NON_APPLICABLE  (DISABLED)
      #define UART_TX_INTR_MASK       (0u)
      #define SCB_1_UART_OverSampling     13u
      #define UART_RX_BUFFER_SIZE     (COMMON_BUFFER_SIZE)
      #define UART_TX_BUFFER_SIZE     (COMMON_BUFFER_SIZE)
      #define UART_RX_BUFER_PTR       bufferRx
      #define UART_TX_BUFER_PTR       bufferTx
      #define UART_RX_INTR_MASK       (SCB_1_INTR_RX_NOT_EMPTY)
      #define UART_TX_INTR_MASK       (0u)

       

       

       

       


      #define COMMON_BUFFER_SIZE     (16u)
      uint8 bufferTx[COMMON_BUFFER_SIZE];
      uint8 bufferRx[COMMON_BUFFER_SIZE + 1u];


      static int k=0,j=0;
      char s;
      uint8 databits=0x08u;
      uint8 parity=SCB_1_UART_PARITY_NONE;
      SCB_1_UART_INIT_STRUCT config=
      {
          0u,3u,0x08u,2u,4u,13u,0u,0u,0u,0u,0u,0u,0u,UART_RX_BUFFER_SIZE,
          UART_RX_BUFER_PTR,UART_TX_BUFFER_SIZE,UART_TX_BUFER_PTR,0u,0u,
          0u,0u,1u,UART_RX_INTR_MASK,0u,0u,0u,0u,0u,0u,0u,0u
      };


      int main(void)
      {
          char string[10];
          int32 source=0;
          int i=0;
          CyGlobalIntEnable;
         
          SCB_1_UartInit(&config);
                 
          SCB_1_Start();
         
         
         
          Clock_1_SetFractionalDividerRegister(180u,0u);
         
          for(;;)
          {
             
              s=SCB_1_UartGetChar();               
                  string[i]=s;
                  if(s!='\0')
                  {
                      SCB_1_SpiUartWriteTxData(s);
                      s='\0';
                  }
                     
          }
      }

       

       

       

       

      ScreenShot: