I want to send multiple strings to be sent instead of a single variable. How to send string instead of single variable char in the following code
C:
#define SBIT_TXEN 5
#define SBIT_SPEN 7
#define SBIT_CREN 4
void UART_Init(int baudRate)
{
TRISC=0x80; // Configure Rx pin as input and Tx as output
TXSTA=(1<<SBIT_TXEN); // Asynchronous mode, 8-bit data & enable transmitter
RCSTA=(1<<SBIT_SPEN) | (1<<SBIT_CREN); // Enable Serial Port and 8-bit continuous receive
SPBRG = (20000000UL/(long)(64UL*baudRate))-1; // baud rate @20Mhz Clock
}
void UART_TxChar(char ch)
{
while(TXIF==0); // Wait till the transmitter register becomes empty
TXREG=ch; // load the char to be transmitted into transmit reg
}
char UART_RxChar()
{
while(RCIF==0); // Wait till the data is received
return(RCREG); // Return the received data to calling function
}
int main()
{
char ch = 'A';
char a[]={"Welcome to Pic Serial Comm"};
UART_Init(9600); //Initialize the UART module with 9600 baud rate
while(1)
{
UART_TxChar(ch); // Transmit the received char
}
}