free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
ENG\ AHMED
Thu May 08 2008, 10:53PM
 User Offline
Registered Member #7733
Joined: Thu May 08 2008, 10:36PM

Posts: 3
Thanked 0 times in 0 posts
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.........

CODE:
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 Fri May 09 2008, 02:50PM ]
Back to top


Ajay
Fri May 09 2008, 03:29PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 3753
Thanked 696 times in 655 posts
I think you cannot use this instruction
LPM R20,Z

coz you are using 8515 so only LPM is allowed without operands.



www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top


ENG\ AHMED
Fri May 09 2008, 10:39PM
 User Offline
Registered Member #7733
Joined: Thu May 08 2008, 10:36PM

Posts: 3
Thanked 0 times in 0 posts
great thx ........... AJAY
Back to top


 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems