i just copy/paste your code and, yes indeed there's few mistake.
first..
	Code:
	DEFINE HSER_RCSTA 90h ;Set receive register to receiver enabled
DEFINE HSER_TXSTA 20h ;Set transmit regester to transmitter enabled
DEFINE HSER_BAUD 2400 ;Set baud rate
DEFINE HSER_SPBRG 25 ;Set spbrg regester
 In red, you overwrite PBP calcs.  This result of a bad SPBRG setting for a TXSTA=20.  Also, as you're using HSERIN, i would suggest you to use HSER_CLROERR feature to clear all possible overflow error.  The correct declaration should be 
	Code:
	DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 25  ' 9600 Baud @ 4MHz, 0.16%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
 Even with this, you have configure the RX pin as output  so change TRISB to
  so change TRISB to
	Code:
	TRISB = %00000010 ' RB1(RX) as input, others to Output
 that sort few error, but unless you want to have a full-filled of "Value of I:" screen, i'll suggest you to remove the timeout delay and it's jump label
This way, the program will sit there and wait for a user entry.
EVEN with the above correction done, you may have some problem if you're using the internal OSC, if your "Value of I" message is messy, use an external one OR try with a lower baudrate.  Here, it doesn't work @9600 baud with the internal OSC.  The output looks like
i don't know for others... but i can't understand what the above ask me 
the full corrected code, with config fuse setting for MPASM and a external 4MHz crystal, but without the ANSI feature looks like 
	Code:
	    ;INCLUDE "ANSI.INC"
    @ __CONFIG _XT_OSC  & _MCLRE_ON  &  _LVP_OFF & _WDT_OFF & _PWRTE_ON  & _BODEN_ON  
    CMCON = %00000111 ;Disable Comparator module's
    OPTION_REG = %11010111 ;Set PIC options
    INTCON = 0 ;Disable interrupts
    TRISB = %00000010 ' RB1(RX) as input, others to Output
    TRISA = 255 ;SET PORTA AS INPUTS
    
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
    DEFINE HSER_SPBRG 25  ' 9600 Baud @ 4MHz, 0.16%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically
    
    
    I VAR BYTE
    I = 20
loop:
    ;@ ClearScr ; Clear Screen
    HSEROUT ["Value of I:",I,10,13]
    HSERIN [I]
    GOTO loop
    END
 More information on config fuse and possible compilation warning messages at the following link
http://www.picbasic.co.uk/forum/showthread.php?t=543
hth
				
			
Bookmarks