E11022
Junior Member level 2
i am connecting PIC16F877a to PC using MAX232 and Rs232, and i wanna view the output in Hyperterminal.
My project is like this, when sensor is triggered, buzzer sounds and Hyperterminal will show help.
Now i wanna figure out how to make my hyperterminal response and display the word. I researched online and found this code to be tested. But there is nothing show in my hyperterminal.
This is the code i used to test my PIC and Hyperterminal but it is not working (Got it online).I connected Pin 2 (RS232) - Pin 14 (MAx232)
Pin 3 (RS232) - Pin 13 (MAX232)
Pin 12 (MAX 232) - Pin 25 (PIC)
Pin 13 (Max232 - Pin 26(PIC)
#include <16F877A.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //Highspeed Osc > 4mhz
#FUSES PUT //Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#use delay(clock=20000000) // Sets crystal oscillator at 20 megahertz
#use rs232(baud=9600, xmit=PIN_C6, invert) //Sets up serial port output pin & baud rate
void main(){
int x = 0;
while(true){
x = x + 1;
//This is an ordinary C language printf statement that will display on the screen of your PC.
//But, you need to open a special program to read serial port input, like HyperTerminal.
//Make sure the baud rate of the program matches this code’s baud rate (9600 bits / second)
printf("hello, x=%d\r\n",x); //send this text to serial port
delay_ms(100); //wait 100 milliseconds
}
}
Can anyone give some advises on it? Thanks
My project is like this, when sensor is triggered, buzzer sounds and Hyperterminal will show help.
Now i wanna figure out how to make my hyperterminal response and display the word. I researched online and found this code to be tested. But there is nothing show in my hyperterminal.
This is the code i used to test my PIC and Hyperterminal but it is not working (Got it online).I connected Pin 2 (RS232) - Pin 14 (MAx232)
Pin 3 (RS232) - Pin 13 (MAX232)
Pin 12 (MAX 232) - Pin 25 (PIC)
Pin 13 (Max232 - Pin 26(PIC)
#include <16F877A.h>
#device adc=8
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //Highspeed Osc > 4mhz
#FUSES PUT //Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#use delay(clock=20000000) // Sets crystal oscillator at 20 megahertz
#use rs232(baud=9600, xmit=PIN_C6, invert) //Sets up serial port output pin & baud rate
void main(){
int x = 0;
while(true){
x = x + 1;
//This is an ordinary C language printf statement that will display on the screen of your PC.
//But, you need to open a special program to read serial port input, like HyperTerminal.
//Make sure the baud rate of the program matches this code’s baud rate (9600 bits / second)
printf("hello, x=%d\r\n",x); //send this text to serial port
delay_ms(100); //wait 100 milliseconds
}
}
Can anyone give some advises on it? Thanks