Bueno, ya encontré donde estaba el problema para lo de HS, el dsPIC tiene varias opciones de Configuración, tal cual lo comento Nocturno, mirando CCS y comparando con los fusibles generados, encontré que se debía cambiar FCR_PLL por PR, tal cual lo habias visto amigo MGLSOFT.
El Programa ya funciona, pero, no va con el Baud Rate que se le selecciona. Va al Doble. 4800 realmente seria 9600..
#include <33FJ256MC710.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES ICS0
#FUSES NOJTAG
#FUSES NOCOE
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOPUT //No Power Up Timer
#FUSES WPOSTS1
#FUSES WPRES128
#FUSES NOWINDIS
#FUSES EC //High speed Osc (> 4mhz)
#FUSES NOOCSIO
#FUSES PR
#FUSES NOTEMP
#FUSES NOIESO //Internal External Switch Over mode disabled
#FUSES NOWRT //Program memory not write protected
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRTSS
#FUSES NOSSS
#FUSES NORSS
#FUSES NOWRTB //Boot block not write protected
#FUSES NOBSS
#FUSES NORBS
#use delay(clock=40000000)
#use rs232(baud=4800, BITS =8, PARITY=N , STOP=1, uart1)
int X=0,Y=0;
char comando='P';
int Barra=0, Valor=0;
void retardo(void){
delay_ms(400);
}
#use standard_io(A)
#use standard_io(B)
#use standard_io(C)
#use standard_io(D)
#use standard_io(E)
void main()
{
set_tris_b(0b00001111);
setup_adc_ports(NO_ANALOGS);
setup_spi(SPI_SS_DISABLED);
setup_uart(TRUE);
output_d(0);
retardo();
output_high(pin_D0);
retardo();
output_high(pin_D1);
retardo();
output_high(pin_D2);
retardo();
output_high(pin_D3);
retardo();
output_high(pin_D4);
retardo();
output_high(pin_D5);
retardo();
output_high(pin_D6);
retardo();
output_high(pin_D7);
retardo();
output_d(0);
while(1){
if(input(pin_b0)==1) output_high(pin_D0);
else output_low(pin_D0);
if(input(pin_b1)==1) output_high(pin_D1);
else output_low(pin_D1);
if(input(pin_b2)==1) output_high(pin_D2);
else output_low(pin_D2);
if(input(pin_b3)==1) output_high(pin_D3);
else output_low(pin_D3);
}
}
Pero ahora no me quiere leer los Pulsadores... RARO RARO.