Re: AVR and 8051
Hi and good day,
Special thanks to silvio for your tips and reply. I am very confident you can help me but it just couldn't work...
This time i can even receive any input from the microcontroller. I try to edit the code to the one as below. since i afraid my microcontroller couldn't receive data from my data, i just try to send data to the computer. however, i couldn't receive any input from the microcontroller.
rs_rec: sbi ucr,rxen ;set reciver bit...
sbis usr,rxc ;wait for a value
rjmp rs_rec
in temp,udr ;read value
cbi ucr,rxen ;clear register
ret ;go back
rs_send:
sbi ucr,txen ;set sender bit
sbis usr,udre ;wait till register is cleared
rjmp rs_send
out udr,temp ;send the recived value
cbi ucr,txen ;clear sender bit
ret ;go back
loop:
;rcall rs_rec ;read from comX
ldi temp, 'A'
rcall rs_send ;send to comX
rjmp loop ;repeat
---------------------
I just couldn't solve where is the problem. I had try using new microcontroller and new RS232. it seem like that is not the source of the problem. i had also try taking out all the component and putting it back.
Does anyone know where is my problem? Can anyone help me to solve this problem? I just can't proceed without solving this problem and i had been trying this for weeks now...
thanks
regards