Smartelex's Atmega32 development board Serial Communication Problem

The Smartelex’s Atmega32 Development Board has Micro-B USB for serial communication as well as pins PD0(Rx) & PD1(TX) that can be
configured to work with DB9 (RS232) connector. When DB9 connector is being used, the board is not able to receive whatever the computer is sending. Is there any hardware settings that need to be done in order to use PD0 & PD1 with DB9 connector. The transmission by pin PD1(TX) is fine.

The attached program works fine when Micro USB to Serial slot is used for communication between the Computer and the Atmega32 board,
but doesnt work when the PD0 & PD1 pins are configured ( using MAX232 ) to use with DB9(RS232) connector.

I have used Atmel Studio 6.0.
Please give suggestions.
Code that I have used to test the reception activity on the pin PD0(RXD) is as below:

/*

  • Serial_Test.c
  • Created: 11/18/2020 4:32:25 PM
  • Author: User
    */

//#define USART_BAUDRATE 9600
#define USART_BAUD_PRESCALE (((F_CPU / (USART_BAUDRATE * 16UL))) - 1)
#define F_CPU 12000000

#include <avr/io.h>
#include <util/delay.h>
#include <stdlib.h>
#include <stdio.h>

void UART_init(long USART_BAUDRATE)
{
UCSRB |= (1 << RXEN) | (1 << TXEN) | (1 << RXCIE);/* Turn on transmission and reception /
//UCSRB |= (1 << TXEN) | (1 << RXCIE);
UCSRC |= (1 << URSEL) | (1 << UCSZ0) | (1 << UCSZ1);/
Use 8-bit character sizes /
UBRRL = USART_BAUD_PRESCALE; /
Load lower 8-bits of the baud rate value /
UBRRH = (USART_BAUD_PRESCALE >> 8); /
Load upper 8-bits*/
}

unsigned char UART_RxChar()
{
while ((UCSRA & (1 << RXC)) == 0);/* Wait till data is received /
return(UDR); /
Return the byte*/
}

void UART_TxChar(char ch)
{
while (! (UCSRA & (1<<UDRE))); /* Wait for empty transmit buffer*/
UDR = ch ;
}

void UART_SendString(char *str)
{
unsigned char j=0;

while (str[j]!=0)		/* Send string till null */
{
	UART_TxChar(str[j]);
	j++;
}

}

int main()
{
char c;
UART_init(9600);

UART_SendString("\n\t Echo Test ");
while(1)
{
	c=UART_RxChar();
	UART_TxChar(c);
}

}