joselam
Newbie level 2
rcif+ccs
How can i sent data kept into the eeprom memory of pic 16f876 to a program of Visual basic into the Pc. I am using putc function but i cannot send nothing. In principle i send a simple "H" letter, but only obtain a message of the visual basic program which say "Send Data", do not show me "H" which i send.
Best regards.
:|
these is my code
#int_rda // Serial input interrupt
void serial_isr(void)
{
byte dummy;
if (rcif==1){ // ¿ Interrupción por recepción ?
bandera_interrupcion = 1; // salvamos para utilizarlo en la sección PC_SI_NO y si no existió
interrupción, permanecerá en cero..
rcif=0; // Sí, reponer flag.
parametros[elemento]= getc();
if(ferr) // if we have a framing error clear it by reading rcreg
dummy = rcreg; // this is just a variable dummy used to clear the rcreg after a read
if(oerr) // if we have a overrun error clear it by reseting the cren flag
{ cren = 0; cren =1;}
elemento++;
if(elemento==7){ // para limitar a 7 los caracteres de llegada, el 8vo ya no le cogería:
funciona perfectamente
finrecepcion=1;
disable_interrupts(int_RDA); // deshabilitamos interrupción de la UART.. ....
disable_interrupts(GLOBAL); // deshabilitamos interrupciones globales.
}
} // fin del if del rcif
putc('\n');
puts("H");
delay_ms(1000);
putc('\n');
}
How can i sent data kept into the eeprom memory of pic 16f876 to a program of Visual basic into the Pc. I am using putc function but i cannot send nothing. In principle i send a simple "H" letter, but only obtain a message of the visual basic program which say "Send Data", do not show me "H" which i send.
Best regards.
:|
these is my code
#int_rda // Serial input interrupt
void serial_isr(void)
{
byte dummy;
if (rcif==1){ // ¿ Interrupción por recepción ?
bandera_interrupcion = 1; // salvamos para utilizarlo en la sección PC_SI_NO y si no existió
interrupción, permanecerá en cero..
rcif=0; // Sí, reponer flag.
parametros[elemento]= getc();
if(ferr) // if we have a framing error clear it by reading rcreg
dummy = rcreg; // this is just a variable dummy used to clear the rcreg after a read
if(oerr) // if we have a overrun error clear it by reseting the cren flag
{ cren = 0; cren =1;}
elemento++;
if(elemento==7){ // para limitar a 7 los caracteres de llegada, el 8vo ya no le cogería:
funciona perfectamente
finrecepcion=1;
disable_interrupts(int_RDA); // deshabilitamos interrupción de la UART.. ....
disable_interrupts(GLOBAL); // deshabilitamos interrupciones globales.
}
} // fin del if del rcif
putc('\n');
puts("H");
delay_ms(1000);
putc('\n');
}