Problem in serial communication with pc
2008-03-13 by rakesh modi
Hello,
I am trying to do serial communication with PC using STK500 & AVRSTUDIO4. I have written a complete code. and I think now there is no change can b done in code. But my code is not working good. Is there any setting or wire connection i have to do on STK500?
I m giving my code below.
Plz reply me.
.include "m32def.inc"
LDI R16, 0X5F
OUT SPL, R16
LDI R16, 0X08
OUT SPH, R16
rjmp main
Init_Uart:
ldi R16,0x00
out ucsra,R16
ldi R16,0x98
out ucsrb,R16
ldi R16,0x00
out ubrrh,R16
ldi R16,0x47
out ubrrl,R16
ldi R16,0x86
out ucsrc,R16
ldi R16,0x80
out acsr,R16
ret
main:
sbi ddra,0
call Init_Uart
again:
ldi r16,'R'
out udr,r16
wait:
sbic ucsra,udre
rjmp again
sbi porta,0
rjmp wait
R.P.Modi
Now you can chat without downloading messenger. Go to http://in.messenger.yahoo.com/webmessengerpromo.php
[Non-text portions of this message have been removed]