[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]
¿Te funciona el paso de pines por parámetros a una función?
Internal Error - Contact CCS
This error indicates the compiler detected an internal inconsistency. This is not an error with the source code; although, something in the source code has triggered the internal error. This problem can usually be quickly corrected by sending the source files to CCS so the problem can be re-created and corrected.
[b]
#include <16f877a.h>
#fuses HS,PUT,NOPROTECT,NOWDT,BROWNOUT,NOLVP
#use delay(clock=20M)
#byte porta=5
#byte portb=6
#byte portc=7
#byte portd=8
#byte porte=9
void Salida_PORT_VIRTUAL_8 (int bit_0,int bit_1,int bit_2,int bit_3,int bit_4,int bit_5,int bit_6,int bit_7);
int PORT_VIRTUAL_8;
main()
{
while (1)
{
PORT_VIRTUAL_8=15; //Registro del puerto virtual cargado con 15 decimal..
Salida_PORT_VIRTUAL_8(PIN_A0,PIN_D1,PIN_B5,PIN_B6,PIN_B7,PIN_E1,PIN_E2,PIN_C4);
//Aqui se saca por este "puerto" lo que tiene cargado
}
}
void Salida_PORT_VIRTUAL_8(int bit_0,int bit_1,int bit_2,int bit_3,int bit_4,int bit_5,int bit_6,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]