[PIC] initialization usart

Status
Not open for further replies.

archusvijay1

Member level 3
Joined
Mar 12, 2014
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
6
Visit site
Activity points
553
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;
}
 

Hi archusvijay1, first What is the compiler you are using? I guess is something like CCS. Maybe the problem arises because the compiler has a native function with a prototype similar to the function you are declaring, i.e.
Code:
void initserial(void)
.

Also in your next post try to be more specific, that is, put more details on your problem to allow others to help you more. Yosmany325.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…