SAM4S Explained Pro UART configuration issue

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using SAM4S explained Pro board for writing code for SAM4SD32C microcontroller. I am trying to configure USART1 peripheral. code is getting compiled properly but garbage data is coming on USART1. I have attached code below kindly tell me what is going wrong?
Macros are defined in conf_uart_serial.h file.
    #define USART_SERIAL                    USART1         //CONSOLE_UART
    #define USART_SERIAL_ID                    ID_USART1    //    CONSOLE_UART_ID  //USART0 for sam4l
    #define USART_SERIAL_BAUDRATE            2400
    #define USART_SERIAL_CHAR_LENGTH        US_MR_CHRL_8_BIT
    #define USART_SERIAL_PARITY                US_MR_PAR_NO
    #define USART_SERIAL_STOP_BIT            US_MR_NBSTOP_1_BIT
 
Thank You
Ashish

Attachment(s): 

Last Edited: Thu. Sep 23, 2021 - 10:08 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you mean that whatever device to which you're sending data is receiving garbage?  Are you only sending from the SAM4SD32C or using it as a receiver also?  Make sure the receiver is also set to 2400 baud.  When garbage comes up on a USART connection, it is nearly always because of incorrectly set baud rates.  Good luck!

 

Jarrod