I am using 16f876a family of PIC micro controller.
How i can do the Programming of Synchronous mode in the USART on the PIC micro controller?
I am sending you my prog. so please suggest for correct one...as soon as possible...
[code lang="c"]
#include
void init_uart()
void tx(unsigned char ch)
void main()
{
TRISC=0x00;
init_uart();
while(1)
tx('A');
}
void init_uart()
{
TXSTA=0xb0;
SPBRG=103;
RCSTA=0x80;
}
void tx(unsigned char ch)
{
TXREG=ch;
while(TXIF==0);
TXIF=0;
}
[/code]
How i can do the Programming of Synchronous mode in the USART on the PIC micro controller?
I am sending you my prog. so please suggest for correct one...as soon as possible...
[code lang="c"]
#include
void init_uart()
void tx(unsigned char ch)
void main()
{
TRISC=0x00;
init_uart();
while(1)
tx('A');
}
void init_uart()
{
TXSTA=0xb0;
SPBRG=103;
RCSTA=0x80;
}
void tx(unsigned char ch)
{
TXREG=ch;
while(TXIF==0);
TXIF=0;
}
[/code]