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

Go to page  1 2 3 ... 17 [18] 19 ... 26 27 28
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
sks
Mon Nov 10 2008, 08:21PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hello Mr Arun,
good morning. i got the copy EFY. the project is really excellent. i will try to fabricate after reaching bhubaneswar. many many things are there to learn particularly for me. any way i hv written a small Timer Blinker. please check and comment.
thanks all
sks
;my 1st timer led blinker progam
org 0000h
led equ p2.0
main:
mov tmod,#01h ;timer0 in mode1
mov tl0,#0b0h ;lower byte fr 50msec delay
mov th0,#03ch ;upper byte
setb tr0 ;start timer0
clr led ;clear p2.0 led off

;timer0 isr
clr tr0 ;stop timer0
setb led ;make p2.0 high led on
continue:
mov tl0,#0b0h ;lower byte fr 50msec delay
mov th0,#03ch ;upper byte
setb tr0 ;start timer0 again
reti
sjmp main
end



Back to top


Arun Kumar V
Tue Nov 11 2008, 05:47AM

 User Offline
Registered Member #426
Joined: Sun Jan 28 2007, 11:50PM

Posts: 522
Thanked 219 times in 186 posts
Hello sahuji,

good to see your 1st timer interrupt code, theoretically 50msec will work but in real hardware simulation its too fast to notice the LED blink.

secondly, after enabling and loading timer your program should have a "resting" ground, take a look below :

org 0000h
led equ p2.0
main:
mov tmod,#01h ;timer0 in mode1
mov tl0,#0b0h ;lower byte fr 50msec delay
mov th0,#03ch ;upper byte
setb tr0 ;start timer0
clr led ;clear p2.0 led off

loop : sjmp loop ; "Resting" ground, be here until interrupted

;timer0 isr
clr tr0 ;stop timer0
setb led ;make p2.0 high led on
continue:
mov tl0,#0b0h ;lower byte fr 50msec delay
mov th0,#03ch ;upper byte
setb tr0 ;start timer0 again
reti
sjmp main ; this is not needed
end



Arun
Back to top



This post has been thanked 1 time
 sks 
sks
Tue Nov 11 2008, 09:11AM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
hi pdi,
i hv posted the code (hex keypad) written by me to help my nephew. pl comment o the code. "anyways , glad to see that the whole family is into embedded programming.I would like to give our best wishes to ur nephew and son." actually my nephew (my own sister's son) is taking a short trm course on embedded system at ISM in Bangalore after his BE in electronics & telecom. of course i hv advised im to do so. my son is a software engineer working, but my nephew is yet to get a job.
thanks
sks

Back to top


sks
Tue Nov 11 2008, 07:27PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hello Mr Arun,
thanks fr the reply. i don't understand this "theoretically 50msec will work but in real hardware simulation its too fast to notice the LED blink". ur 100 percent true but why its so. plzz help me clarify this. is it for crystal frequency?
thanks.
sks

Back to top


sks
Wed Nov 12 2008, 09:04AM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hello Mr Arun,
i hv checked the code modified by you. either i don't understand the code or may be sum bugs are there. i hv rewrite the blinker again using timer flag, please check and comment.
thanks all
sks
;my 1st timer led blinker progam

org 0000h
led equ p2.0
setb led
main:
mov tmod,#01h ;timer0 in mode1
mov tl0,#0b0h ;lower byte fr 50msec delay
mov th0,#03ch ;upper byte
setb tr0 ;start timer0
jnb tf0,$ ;wait here for tflag overflows
cpl led ;make p2.0 high led on
clr tr0 ;stop timer0
clr tf0
sjmp main
end

Back to top


ExperimenterUK
Wed Nov 12 2008, 09:36AM
 User Offline
Registered Member #9602
Joined: Tue Aug 05 2008, 04:15PM

Posts: 204
Thanked 38 times in 37 posts
sks wrote ...

Hello Mr Arun,
i hv checked the code modified by you. either i don't understand the code or may be sum bugs are there. i hv rewrite the blinker again using timer flag, please check and comment.
thanks all
sks

@sks
In your " Tue Nov 11 2008, 04:21AM" post, did you intend to use an interrupt to
service the timer overflow ?


Learning all the time
Back to top



This post has been thanked 1 time
 sks 
sks
Wed Nov 12 2008, 07:56PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hi ExperimenterUK,
Good morning. thanks fr the reply. in my previous code (1st timer code), i was trying to make led off fr 50msec & on for 50msec. i was nt using tflag to overflow. my algo was to make timer on and off fr 50msec. i m not much clear about timer right now. there was a previous post from Mr Ajay about Timer, i m following that, i think it will take a day or two to understand the Timer a little bit.
thanks
sks

Back to top


sks
Sun Nov 16 2008, 10:45PM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hi all,
good morning. can some body tell me why in Proteus i cant see my out put in LCD where as its possible to see in my kit using same code?
thanks
sks

Back to top


pdi33
Mon Nov 17 2008, 12:54AM

 User Offline
Registered Member #1329
Joined: Mon Jun 04 2007, 09:28AM

Posts: 770
Thanked 185 times in 180 posts
hi sks,
one problem in the LCD module of proteus is that if it is aligned at 90 degrees while simulation, the text is not presented clearly. hope ur LCD is horizontal in the schematic. Secondly, try outputting by removing the busy line checking if present temporarily in the code.
.


* inspired to develop,developing to inspire *
Back to top



This post has been thanked 1 time
 sks 
sks
Mon Nov 17 2008, 05:23AM
 User Offline
Registered Member #9477
Joined: Thu Jul 31 2008, 07:51AM

Posts: 160
Thanked 0 times in 0 posts
Hi pdi,
good morning. thanks fr the reply. i checked the wiring in proteus ,there was an error in lcd connection, VSS and VDD was wrongly connected. after correcting the error its working allright. sorry fr the trouble.
thanks again
sks

Back to top


Go to page  1 2 3 ... 17 [18] 19 ... 26 27 28  

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