Hello,
I was wrote a simple program to test on the hyperterminal but it cannot function. I am using max232 to communicate the pic (16F877A)and pc. So, can somebody pls help me to check about it? I was try to figure out where is the problem for a few day already.
**remark: I'm not using the USART function is due to the pin was reserved for others function.
Source Code:
'################################################# #########
Define OSC 10
include "Modedefs.bas"
ADCON1 = 6
TRISA = %111000
TRISB = 0
B0 var byte
PORTB = 0
Main:
serin PORTA.3,T9600,B0
pause 1000
if (B0==1) then PORTB = %00010001
if (B0==2) then PORTB = %00100010
if (B0==3) then PORTB = %00110011
if (B0==4) THEN PORTB = %01000100
If (B0==5) THEN PORTB = %01010101
if (B0==6) then PORTB = %01100110
if (B0==7) then PORTB = %01110111
if (B0==8) then PORTB = %10001000
if (B0==9) THEN PORTB = %10011001
if (B0=="A") THEN PORTB = %10101010
if (B0=="B") then PORTB = %10111011
if (B0=="C") then PORTB = %11001100
if (B0=="D") then PORTB = %11011101
if (B0=="E") THEN PORTB = %11101110
if (B0=="F") THEN PORTB = %11111111
PAUSE 1000
GOTO MAIN
'################################################# #######
Thanks in advance
Bookmarks