AT90S8515 UART
Discussion in "AVR Discussion Forum" started by ENG\ AHMED May 9, 2008.
Fri May 09 2008, 11:23 am
HI ALL,
I work with MCU 1 st time and i have a problem in programming UART transmision
That my programe is to send 0xff and ON indication LED then OFF the LED for 1 sec
but i found that the LED ON forever ,pls check my programme.
i use at90s8515 with 8mhz crystal
and that my programme.........
I work with MCU 1 st time and i have a problem in programming UART transmision
That my programe is to send 0xff and ON indication LED then OFF the LED for 1 sec
but i found that the LED ON forever ,pls check my programme.
i use at90s8515 with 8mhz crystal
and that my programme.........
LDI R18,0X80 ;STACK POINTER OUT $3D,R18 SBI $11,4 ;O/P LED INDECATION LDI R16,51 ;9600 BOUD RATE @8MHZ OUT $09,R16 NEXT: SBI $12,4 ;LED ON LDI R31,HIGH(2*ASD) LDI R30,LOW(2*ASD) RCALL STRANSMIT RCALL DELAY1 CBI $12,4 ;LED OFF RCALL DELAY1 RJMP NEXT DELAY1: ;ONE SEC DELAY ldi r20, 20 ldi r21, 255 ldi r22, 255 DELAY: dec r22 brne DELAY dec r21 brne DELAY dec r20 brne DELAY ret STRANSMIT: SBI $0A,3 ;TXEN UCR(3)=1 AGAIN1: LPM R20,Z CPI R20,0 ;COMBAR WITH LAST ZERO BREQ QUIT OUT $0C,R20 ;DATA IN UDR W: SBIS $0B,5 ; ? RJMP W ADIW R31:R30,1 RJMP AGAIN1 QUIT: CBI $0A,3 RET ASD: .DB 0XFF .DB 0
[ Edited Sat May 10 2008, 03:20 am ]
Sat May 10 2008, 03:59 am
I think you cannot use this instruction
LPM R20,Z
coz you are using 8515 so only LPM is allowed without operands.
LPM R20,Z
coz you are using 8515 so only LPM is allowed without operands.
Powered by e107 Forum System