Hola buenos días espero por favor me puedan ayudar amigos con un problema que tengo comunicando un pic 18f4550 mediante rs232 a traves de un puerto serial virtual. El problema es que si envio algo, en el hyperterminal se recibe otra cosa, soy nuevo en esto de los micros, y pues mi programa es algo basico, simplemente enviar algo un dato o cadena desde el pic, y que esta se visualice en el hyperterminal, para esto uso el Pic C Compiler, no se si me haya equivocado en el cableado o en el programa o algo se me este pasando, muchas gracias por su tiempo.
En el proteus he configurado el cristal a 8Mhz y en el microcontrolador tambien lo configure a 8Mhz (es la frecuancia que configuro en el programa), en el COMPIN configuro ambos BaudRates a 9600 ya que es lo que maneja mi programa y tambien en el hyperterminal configuro a 9600 de BaudRate y Sin control de flujo.
Les dejo el esquematico que estoy usando y el código por si es de ayuda.
Saludos.
comunicacion2.c
#include "C:\Users\Timh\Documents\RoboticaPic\comunicacion2.h"
#int_RDA
void RDA_isr(void)
{
}
void main()
{
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_psp(PSP_DISABLED);
//setup_spi(SPI_SS_DISABLED);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_RDA);
enable_interrupts(GLOBAL);
//Setup_Oscillator parameter not selected from Intr Oscillator Config tab
// TODO: USER CODE!!
while(1)
{
puts("Hola");
delay_ms(200);
}
}
comunicacion2.h
#FUSES NOPUT //No Power Up Timer
#FUSES NOCPD //No EE protection
#FUSES STVREN //Stack full/underflow will cause reset
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOWRT //Program memory not write protected
#FUSES NOWRTD //Data EEPROM not write protected
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES PBADEN //PORTB pins are configured as analog input channels on RESET
#FUSES NOWRTC //configuration not registers write protected
#FUSES NOWRTB //Boot block not write protected
#FUSES NOEBTR //Memory not protected from table reads
#FUSES NOEBTRB //Boot block not protected from table reads
#FUSES NOCPB //No Boot Block code protection
#FUSES MCLR //Master Clear pin enabled
#FUSES LPT1OSC //Timer1 configured for low-power operation
#FUSES NOXINST //Extended set extension and Indexed Addressing mode disabled (Legacy mode)
#FUSES PLL12 //Divide By 12(48MHz oscillator input)
#FUSES CPUDIV4 //System Clock by 4
#FUSES USBDIV //USB clock source comes from PLL divide by 2
#FUSES VREGEN //USB voltage regulator enabled
#FUSES ICPRT //ICPRT enabled
#use delay(clock=8000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)