salut à tous, je voulais relier deux pic 16F877A. mon but est de emettre un octet par une transmission serie asynchrone. voici la fonction de l' emission et de reception que j' ai eccrit et malheuresement ca marche pas. j' ai pas pu trouvé le probléme.
void emission_octet(unsigned short octet)
{
int i;
unsigned short temp=octet;
for(i=0;i<8;i++)
{
PortA.F0 = temp & 0b00000001;
PortA.F1=1;
Delay_ms(1);
PortA.F1=0;
Delay_ms(1);
temp>>1;
}
}
void reception()
{
while(Fin_reception==0)
{
unsigned short temp=0;
while(nb_bits<8)
{
if((PortA.F3==1)&&(Acquisition_permise==1))
{
Acquisition_permise=0;
if(PortA.F2==1)
temp+=valeur[nb_bits];
nb_bits++;
if(nb_bits==8)
{
data[nb_octets]=temp;
temp=0;
nb_octets++;
}
}
else if (PortA.F3==0)
Acquisition_permise=1;
}
nb_bits=0;
if(nb_octets==4)
Fin_reception=1;
}
}