I was just trying to send continuous stream of letter 'G' from my PIC MCU (PIC18F452) to my laptop.
Here is my assembly code that i am using :
#include <p18f452.inc> CONFIG OSC=XT,WDT=OFF,PWRT=OFF ORG 0H MOVLW D'12' MOVWF SPBRG MOVLW B'00100000' MOVWF TXSTA BCF TRISC,TX BSF RCSTA,SPEN OVER MOVLW A'G' S1 BTFSS PIR1,TXIF BRA S1 MOVWF TXREG BRA OVER END
I design the circuit in proteus and simulate it with realterm and hyperterminal i get the desired output. But when i try to implement the hardware i face some problem. I do not get output at Realterm just when i connect my source. But at the instant i remove the source (unplug just ground or live wire) i get the output (G string). Can any one tell me what is the problem? Devices that i use: 01. PIC18F452 02. 8MHz Crystal Oscillator, 03. MAX232 with five 10uF capacitor 04. USB to RS232 cable. Here is my connection diagram: