archusvijay1
Member level 3
hello,
i have some problem in initializing usart in pic 16f877a.during initialization function calling void initserial (void) become getting error "conflicting declarations" but using "int" instead of using "void" there is no error,but some times void will not get also a problem. why this happens?
void initserial (void) {
TRISC6 = 0;
TRISC7 = 1;
TXEN = 1;
CREN = 1;
SPEN = 1;
SYNC = 0;
RCIF = 0;
RCIE = 1;
BRGH = 1;
TXSTA = 0x24;
SPBRG = 129;
}
i have some problem in initializing usart in pic 16f877a.during initialization function calling void initserial (void) become getting error "conflicting declarations" but using "int" instead of using "void" there is no error,but some times void will not get also a problem. why this happens?
void initserial (void) {
TRISC6 = 0;
TRISC7 = 1;
TXEN = 1;
CREN = 1;
SPEN = 1;
SYNC = 0;
RCIF = 0;
RCIE = 1;
BRGH = 1;
TXSTA = 0x24;
SPBRG = 129;
}