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 [4] 5
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
Arun Kumar V
Tue Jun 03 2008, 06:47PM

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

Posts: 452
Thanked 190 times in 160 posts
Hello Priya,

i am sorry to say that this is one of the worst code i have seen so far, you ask why ?

1) what ever variables you have declared are not used anywhere in the program

2) what you want the code to perform is missing- objective is missing

3) you are simply loading some preset values into the display port

4) you are not comparing the ADC value to any known values

5) when you convert binary to Decimal you should first divide by 100D (64H) ,later by 10D
but you are dividing first by 10D and second also by 10D see here in your code 0ah i,e 10D:

CODE:
mov a,#33h
mov b,#0ah
div ab
mov r7,b
mov b,#0ah
div ab
mov r6,b
mov r5,a


6) and what are you doing with these registers : R7,R6,R5 ?

CODE:
seven segment_display: mov r1,#0
mov r2,#0c0
mov r1,#1
mov r2,#0f9
mov r1,#2
mov r2,#0a4
mov r1,#3
mov r2,#0b0
mov r1,#4
mov r2,#99
mov r1,#5
mov r2,#92
mov r1,#6
mov r2,#82
mov r1,#7
mov r2,#0f8
mov r1,#8
mov r2,#80
mov r1,#9
mov r2,#98
ret

 


7) what does this above Routine do ? - its rubbish

8) when a compiler compiles a code and outputs hex file, it doesn't mean that the code is error free - ever heard of "GIGO" term - "garbage In garbage Out"

9) provide a flowchart or block diagram of your logic so that we can help, forget " i have posted my logic in earlier posts" statement , nobody can track each and every thread in a forum,


Arun




Back to top



This post has been thanked 1 time
 priya123 
priya123
Tue Jun 03 2008, 07:15PM
 User Offline
Registered Member #7113
Joined: Wed Apr 09 2008, 02:39AM

Posts: 48
Thanked 0 times in 0 posts
thanx a lot arun sir for tracking my mistakes,I am trying to build a data-acquisition system by using adc and microcontroller. i have already developed a look-uptable for the adc. providing a variable voltage at pin6 of adc i have found out the adc values by connecting all the datapins of adc toleds on my trainer kit.i am trying to programmy microcontroller in such a way that when i apply say,1 volts to adc the output should be 033h(according to the look-up table of ADC). i have connected pins of port1 of microcontroller to data pins of ADC. I want to see the display through seven-segment display ,so i have connected a seven-segment display(common anode type)to port p3 of microcontroller.

p
Back to top


Arun Kumar V
Wed Jun 04 2008, 12:39PM

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

Posts: 452
Thanked 190 times in 160 posts
Hello priya123,

here is my code in two versions : ver A - displays 3 digit decimal on Common Anode
Ver B - displays 2 digit hex value on Common Anode

verA :

: code deleted by Arun

and here is want you desperately wanted

Ver B :

: code deleted by Arun

Hope this solves your long time problem !

Arun

[ Edited Tue Jul 15 2008, 01:39AM ]
Back to top

adc with seven segment display   seven segment programing   interfacing 7-seg display   7 segment display interfacing   7 segment display programming   



This post has been thanked 2 times
nischay kumar
Sat Jun 07 2008, 11:16AM
 User Offline
Registered Member #8311
Joined: Sat Jun 07 2008, 11:09AM

Posts: 31
Thanked 3 times in 3 posts

hello sir,

your program works perfectly, i have tried it and have learned new concepts in asm programming

nischay kumar
Back to top


priya123
Tue Jun 10 2008, 04:59PM
 User Offline
Registered Member #7113
Joined: Wed Apr 09 2008, 02:39AM

Posts: 48
Thanked 0 times in 0 posts
thanx arun sir,your program code really helped me a lot,but still there is one doubt which i want to make it clear . i am using ADC(0804) in free-running mode. I have connected it to microcontroller(89s52) in the following way:
ADC(0804)
pin no:1 -------- CS grounded
pin no:2---------rd connected to port pin 2.5
pin no:3---------wr and pin no:5--------------intr shorted together
pin no: 3 ---------------wr connected to port pin 2.6 of microcontroller
pin no :5----------------intr connected to port pin 2.7 of microcontroller
pin no:6 ------------- variable input ,voltage is varied here
pin o:7--------------- grounded
pin no:8-------------------- grounded
pin no:9------------------- vref (1.28v) ,i have left it open
pin no:10------------------grounded
pin no:11 to pin no:18 (data pins) connected to pins of port1 of microcontroller
pin no: 19 -------------- connected to external clock
pin no:20--------------+5 volts vcc.
sir please tell me whether this connection is correct? if incorrect,then what corrections should I make?
please help.

p
Back to top


Arun Kumar V
Tue Jun 10 2008, 07:25PM

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

Posts: 452
Thanked 190 times in 160 posts
Hello priya123,

very late reply, about the ADC in free running mode , your current setup is not Free running mode-

in the free running mode, the ADC constantly converts the analog voltage at its input without the micro sending control pulses. one conversion triggers another conversion without micro's interference.

i have already described the connections of ADC in my above code:

;***************************************************************************
; ADC 0804 IS CONNECTED IN FREE RUNNING MODE
; VREF IS CONNECTED TO +5VOLTS
;
; GROUND PINS CS,RD,Vin-,DGND,AGND ON THE ADC
; CONNECT WR PIN TO INTR PIN ON THE ADC
;****************************************************************************


you only need to connect ADC's (D0-D7) Data bus pins to the micro's port, in your case its Port1.

when ever you want to read the input voltage , you just Mov contents of Port1 to Accumulator or any other Register.

interval between two readings should be atleast 1 uSec, which is not a problem when using normal 8051 @ 12 Mhz clock rate

Arun
Back to top


priya123
Wed Jun 18 2008, 02:27AM
 User Offline
Registered Member #7113
Joined: Wed Apr 09 2008, 02:39AM

Posts: 48
Thanked 0 times in 0 posts
sir,please provide me the pin configuration of LM35 and LM34 sensors or sir,please give me any link from where I can get the pin configuration.

p
Back to top


sashijoseph
Wed Jun 18 2008, 10:35AM

 User Online
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 554
Thanked 124 times in 117 posts
Look here : http://www.facstaff.bucknell.edu/mastascu/elessonshtml/Sensors/TempLM35.html

Google will give you umpteen links...do use it.

Let there be music........
Back to top


priya123
Thu Jun 19 2008, 11:31PM
 User Offline
Registered Member #7113
Joined: Wed Apr 09 2008, 02:39AM

Posts: 48
Thanked 0 times in 0 posts
hello sir,
thanx for ur information on LM 35 sensors,could u provide me some more information about LM 34 sensor(fahrenheit sensor) ,its pin configuration and characteristics.

p
Back to top


Arun Kumar V
Fri Jun 20 2008, 04:54AM

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

Posts: 452
Thanked 190 times in 160 posts
hello priya 123,

use this forum for help when your preliminary search doesn't give you good results.

before posting your queries try googling, don't expect spoon feeding here. below are the results for what you asked








next time such queries will be deleted without explanation.



Arun
Back to top


Go to page  1 2 3 [4] 5  

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