1 Reply Latest reply on Jun 18, 2015 10:41 AM by ArvindS_76

    Peripheral UART: To FIFO, or not to FIFO

      Hi there,

       

      we are using the peripheral UART of the BCM20736S SiP module extensively for communication with our main MCU on a custom PCB. At the moment I got our custom services and characteristics running thanks to this forum!

       

      I already devised a packet-based UART protocol that takes the 16 bytes long FIFO of the BCM20736S into account, i.e. maximum packet size is 16 bytes, which is somewhat of a nuisance as we use 20 bytes long characteristics that need to be transferred in multiple packets.

      While experimenting with different funcitons we found the following:

      void puart_write(UINT8 byte);
      void puart_print(char * string);
      BOOL32 puart_read(UINT8* readbyte);
      void puart_synchronousRead( UINT8* buffer, UINT32 length );
      void puart_synchronousWrite( UINT8* buffer, UINT32 length );
      

       

      Is it correct, that puart_write, puart_print and puart_read use the underlying RTOS and don't care much about the hardware FIFO size of 16 bytes?

      And when using the puart_synchronousRead and Write functions they directly interface the hardware?

       

      Should I revise the UART protocol, because packets can be longer than 16 bytes?

       

      Thanks in advance!

       

      Best regards

      Hannes Baumgart

        • 1. Re: Peripheral UART: To FIFO, or not to FIFO
          ArvindS_76

          puart_read/puart_write will never underflow/overflow the FIFO (they always check to see if the FIFO has bytes/not full before reading/writing).

           

          puart_synchronousRead/puart_synchronousWrite may underflow/overflow the FIFO. So you should know how many bytes you can read/write from/to FIFO before you call these.

           

          puart_print is a string printing function that looks for a null terminator to indicate when to stop printing. It uses puart_write to do the actual write.