I was trying to program a PIC 16f877A Micro-controller to rotate a servomotor, 0 to 180 degrees, but every time i try to build the program i get an error "member reference base type 'volatile unsigned char' is not a structure or union".I am using MPLAB with xc8 compiler. I couldn't find the issue.
#include<xc.h>
void Rotation0()
{
int i;
for(i=0;i<50;i++)
{
PORTB.F0 = 1;
__delay_us(800);
PORTB.F0 = 0;
__delay_us(19200);
}
}
void Rotation90()
{
int i;
for(i=0;i<50;i++)
{
PORTB.F0 = 1;
__delay_us(1500);
PORTB.F0 = 0;
__delay_us(18500);
}
}
void Rotation180()
{
int i;
for(i=0;i<50;i++)
{
PORTB.F0 = 1;
__delay_us(2200);
PORTB.F0 = 0x00;
__delay_us(17800);
}
}
void main()
{
TRISB = 0;
PORTB = 0x00;
do
{
Rotation0();
__delay_ms(2000);
Rotation90();
__delay_ms(2000);
Rotation180();
}while(1);
}