Hola..lo que se me ocurrio intentar para tratar de aprovechar mejor las patitas del pic es crear un puerto a partir de pines libres de diferentes puertos..por que pasa muchas veces que según el proyecto se necesitan los 8 pines de un puerto completo pero se tienen ocupados algunos aunque se dispone de de 8 pines I/O de puertos distintos todavia..entonces se me ocurrio hacer una cosa asi..quiero sus opiniones y mejoras de esto..
[b]
#define RA0 PIN_A0 //Aqui podria agregar todos estos define al .h del pic
#define RA1 PIN_A1 //O bien crear uno nuevo..
etc
etc
int PORT_VIRTUAL_8;
main()
{
PORT_VIRTUAL=15; //Registro del puerto virtual cargado con 15 decimal..
Salida_PORT_VIRTUAL_8(RA0,RD1,RB5,RB6,RB7,RE1,RE2,RC4);
//Aqui se saca por este "puerto" lo que tiene cargado //su registro...
}
void Salida_PORT_VIRTUAL_8(int bit_0,int bit_1,...,int bit_7)
{
output_bit(bit_0,(00000001 & PORT_VIRTUAL_8));
output_bit(bit_1,(00000010 & PORT_VIRTUAL_8));
output_bit(bit_2,(00000100 & PORT_VIRTUAL_8));
output_bit(bit_3,(00001000 & PORT_VIRTUAL_8));
output_bit(bit_4,(00010000 & PORT_VIRTUAL_8));
output_bit(bit_5,(00100000 & PORT_VIRTUAL_8));
output_bit(bit_6,(01000000 & PORT_VIRTUAL_8));
output_bit(bit_7,(10000000 & PORT_VIRTUAL_8));
}
[/b]
Bueno espero mejoras..desde ya gracias espero se entienda..