Discussion in "Project Doubts" started by    Chinmay Das    Mar 10, 2009.
Sun Mar 15 2009, 07:48 AM
#21
Chinmay please go step by step. Do not be under the impression that you can assemble the circuits and download the code and everything will work fine. I do not wish to sound rude but there is a reason for it. Firstly, it beats the whole purpose of doing the project and secondly you will never be able to trace the errors! For eg. now you are unsure if the bug is in the hardware or the code and if in either of them you need to trace where! So the moral of the story is go step by step. It takes time but the probability of you getting it right is higher

How have you been testing your circuits without a breadboard? Doesnt your college lab have 1? (assuming you are doing in college, if not then wat about resources like CRO, etc?) Please test all the circuits, clock the ADC separately from a signal gen, give the control signals and check the o/p with multimeter for a range of i/ps

By Look up Table i mean the last 3 pages of the code with all those digits. That is what is being displayed on the LCD!

The cursor is moving, so that part of the code is right

Coming to the interrupt problem.
Why do you expect to see the actuator message when you press the RST switch?
I had connected the switch like how you did the 1st time. i.e. Vcc |--Switch--P3.2
In the photo of the uC circuit the yellow wires are connected to the switch (only the ends of the wires is seen the rest is hidden because it goes under the board). I think what Ajay says is a better way to do it.

Coming to the code of the interrupt. I hope you understood the logic. In the ISR, the LCD_INTR is set and the next time when the code reaches the label "display_data" it checks that flag bit and then displays the actuator data. If the bit is set, it is cleared for the next run and then the actuator data is shown else it jumps to the label where sensor data is shown. Again what Ajay has said is an alternate way, both are fine.

Probably the Interrupt is not occurring! First check if at P3.2 there is a change in voltage when you press the button. Then:
1. Please post the 1st few lines of your code starting from "org 00". probably there are too many lines before org 03h where the jump to the ISR is done! Try moving the org 03h, LJMP int_isr in the 1st few lines of the code.
2. Next, try to test of the interrupt is occurring. Do this by introducing some code within the ISR to do something eg. a long buzz on the buzzer or just display some dummy string. This is to just give you an indication that the ISR is being entered!
3. Before doing this please make a copy of your existing code! (Do make backups ALWAYS )

Hope this helps.

PS: Stick to one thread. It will help you, us who are trying to solve them and others who read your thread to solve their problems
 Chinmay Das like this.
Sun Mar 15 2009, 10:41 AM
#22
hey amit,
thanks 4 little boost up.......n i dnt think u r rude, u hv 6 stars n mine just 2 .
i know doing any project is nt an easy or cool work..i hv read almost all of ur post in sensor threads...dats why i know hw much u hv worked 4 dis project. The prob is dat, i m doing dis project outside of collg. yes my collg lab hs every thing breadboard ,CRO. bt itz nt possible 2 work der during off hours. so i hv set up small workshop in my house whr i m doing 9 other projects based on uC wid my frnds...so i dnt hv instrument lik breadboard, cro wid me now.and other prob is here v dnt hv any embeded expertiz hu will guide us little bit more physicaly. so v r doing every thing by ourselves. The only source is This Forume. As i m leading the projects i hv little bit pressure on me.....

now moving 2 the topic

after doing researches n discus 4 last 3 days......i m almost sure dat Interrupt is not occurring. as i hv very little experience abt assembly codings , itz nt dat much easy 2 rectify d logical errors in codings. bt yes i understood d logic completely.by deburging i hv an idea hw all d instructions r working.

oh yes tell me hw to test ACD at stand alone mode by using bread board....

now ur codes...




[ Edited Wed Mar 18 2009, 03:08 AM ]
Sun Mar 15 2009, 10:42 AM
#23
hey amit as u told i chked voltage at P3.2. n found dees 3 things noticeable

1.voltage b/w Vcc(pin 40) n P3.2 = 0.00v
2.Voltage b/w GND(pin 20) n P3.2= -5.09v i.e -ve voltage
3. n if i m connecting P3.2 to GND , instead of to Vcc den LCD mode is working..lik dis

GND|---Switch---P3.2


i hv also made some change in LCD_INTR, here it z
[NB:LCD mode is also working without changing in LCD_INTR]
 int_isr: 			;interrupt routine for LCD button
	MOV IE, #00h	;Disable interrupts	
	PUSH 0E0h		;Push A to stack
	PUSH 00h		;Push R0
	PUSH 03h		;Push R3
	PUSH 04h		;Push R4
	PUSH 07h		;Push R7
	PUSH 82h		;Push DPL
	PUSH 83h		;Push DPH
	
	SETB LCD_INTR		;Set flag to check interrupt;

;Added here  2 inst                  ; Which were commented before
	LCALL data_display	;Call LCD display routine (for actuator status)
	CLR LCD_INTR		;Clear interrupt check flag

	
	POP 83h		;Pop DPH
	POP 82h		;Pop DPL
	POP 07h		;Pop R7 from stack
	POP 04h		;Pop R4
	POP 03h		;Pop R3
	POP 00h		;Pop reg R0
	POP 0E0h	;Pop Accumulator
	
	MOV IE, #81h	;Enable INT0
	
	RETI
    	
		 
org 500h

init1: DB "Initialising the", 0
init2: DB "Sensors...", 0	; System initialisation message


it seems i got d solution 4 LCD mode...
Bt still uC is nt upating datas 4m sensors......


[ Edited Sun Mar 15 2009, 12:46 PM ]
Sun Mar 15 2009, 12:48 PM
#24
here is d acctuator disply

Sun Mar 15 2009, 07:04 PM
#25
hello ricky
i need u to check dis new codes , here Actuator status message is not showing the letter "C"





here are the new codes


org 00h
	
	CLR 0A0h 	;Clear Port 2 for the actuators to turn off
	CLR 0B0h 	;Clear port 3 for the buzzer to turn off
	SETB BUZZER
	LCALL DELAY
	CLR BUZZER 	;Turn off buzzer
	
	LJMP main

	org 03h
	
	LJMP int_isr	; Interrupt for the LCD switch

	org 07h

				
main:
	MOV 60h, #'C'	; Intitialising Actuator status message	
	MOV 61h, #':'
	MOV 62h, #' '
	MOV 63h, #'O'
	MOV 64h, #'F' 
	MOV 65h, #'F'

	MOV 66h, #' '
	MOV 67h, #' '

	MOV 68h, #'P'
	MOV 69h, #'U'
	MOV 6Ah, #':'
	MOV 6Bh, #'O'
	MOV 6Ch, #'F'
	MOV 6Dh, #'F'
	MOV 6Eh, #0

	MOV 70h, #'S'
	MOV 71h, #'P'
	MOV 72h, #':'
	MOV 73h, #'O'
	MOV 74h, #'F'
	MOV 75h, #'F'
	
	MOV 76h, #' '
	MOV 77h, #' '
	
	MOV 78h, #'L'
	MOV 79h, #'I'
	MOV 7Ah, #':'
	MOV 7Bh, #'O'
	MOV 7Ch, #'F'
	MOV 7Dh, #'F'
	MOV 7Eh, #0
Mon Mar 16 2009, 09:13 AM
#26
make sure 60H is not used by any other routine. and stack could also cause this problem. stick to one thread so we can better track problems. we are scattered here and there so its difficult to figure out what the exact problem is.
Mon Mar 16 2009, 02:04 PM
#27
hello ajay sir :-)

i hv posted new checked codes here
<http://www.8051projects.net/e107_files/public/1237143811_14263_FT19498_codes-checked.rar>

chek dis codes , i hv done little change in ISP part. i m also working on ADC. i hope u will reply me soon... thank you.
Wed Mar 18 2009, 03:13 AM
#28
Hello Moderators n amit

U r rite amit. i chk d ADC in stand alone mode, n found i dnnt get any dital o/p 4m adc. I hv chk it 4 all IN4,IN5,IN6,IN7.... use LDR ckt (light sensor)as input signal ,on every input i m getting only D0 n D6 as High. so i m sure dat adc is nt working perfectly......so need ur help sir.......

i will post more abt it .......later. thank u.


[ Edited Wed Mar 18 2009, 03:17 AM ]
Wed Mar 18 2009, 04:40 PM
#29
Hi chinmay,
Sorry if i am not regular, I am a bit busy these days. Can u post the circuit u used for clocking the ADC? you cannot use the regular circuit that is used with the uC. I had also tried it and never got the o/p! I bough 4 ADCs cos of that only to realise i was using the wrong ckt!!!
Please post ur circuit. I am unable to find the one i used :mad sorry. Il try searching again...
all the best.
Wed Mar 18 2009, 04:46 PM
#30
dis is d ckt....... bt i m sure dat ADC is nt getting clk perfectly......

Get Social

Information

Powered by e107 Forum System

Conversation

Mon Jan 16 2017, 03:15 PM
Rutuja
How can we read notepad file using random acess file
Fri Jan 06 2017, 06:18 AM
muhammad Umar
i need cd4047 library file for protious please help me i s
ExperimenterUK
Wed Jan 04 2017, 09:01 PM
@Emin what is your site user name ?
Tue Jan 03 2017, 11:16 PM
Emin
Emin: I'm already a member since 2012 and entered repeatedly during period. But now it is impossible and obtaining a new registration is also failed. The same error message specifying that two e-mails i entered are different!. In fact thaey are the same. Now, what will be happen, what is your solution? Thanks..
Tue Jan 03 2017, 11:15 PM
Emin
I'm already a member since 2012 and entered repeatedly during period. But now it is impossible and obtaining a new registration is also failed. The same error message specifying that two e-mails i entered are different!. In fact thaey are the same. Now, what will be happen, what is your solution? Thanks..
Sun Jan 01 2017, 03:14 PM
Manoranjana Chary
Write an embedded program of increment and decrement in LCD connected to two keys of int1 and int0. Can u please send me the code for this as fast as possible because i need to submit it in college kindly
ExperimenterUK
Sat Dec 31 2016, 06:28 PM
Happy New Year everyone
ExperimenterUK
Sat Dec 31 2016, 06:27 PM
Please post questions in the forum, the chat box is for chat
Thu Dec 29 2016, 07:47 AM
drashti ranolia
can anyone help me for the microcontroller 8051 programming code for street lights that glow on vehicle movement using IR sensors ?
Tue Dec 27 2016, 11:45 AM
Shubhangi
Do we have to write lookup table for d6t thermal sensor?

Downloads

Comments

sarfrosh92
Sun Jan 15 2017, 09:18 AM
Deepakvaishu
Wed Jan 11 2017, 10:25 AM
rana_jee773
Sat Dec 10 2016, 11:22 AM
[email protected]
Thu Dec 08 2016, 11:02 AM
Jonathan.kei
Mon Nov 21 2016, 04:30 PM
AVRuser1
Sun Nov 20 2016, 06:07 PM
JaguarPaw
Thu Nov 17 2016, 07:44 PM
PeterJohn
Mon Nov 14 2016, 05:54 PM

Online

Guests: 32, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37796
Newest member: sarfrosh92
Forum Activity
Deepakvaishu Avatar
Posted By Deepakvaishu
Mon Jan 16 2017, 08:31 AM
you are right ..I should not include '\' at t...
Deepakvaishu Avatar
Posted By Deepakvaishu
Mon Jan 16 2017, 06:07 AM
No ,its not the null character, its just the '...
sankalp_s Avatar
Posted By sankalp_s
Sun Jan 15 2017, 07:55 PM
There is a fault in your Proteus design.If you loo...
sarfrosh92 Avatar
Posted By sarfrosh92
Sun Jan 15 2017, 10:04 AM
The 8051 Microcontroller (3rd Edition) by I. Scott...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jan 14 2017, 11:59 PM
The site editor may have removed the 0 from \0.Actually it should not be needed, sochar *phone_no[3 ]={"1234567890" ," 9087654321" ,"76676667676"}; //array of pointers should work.
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jan 14 2017, 11:54 PM
There is a fault in your Proteus design.If you loo...
sankalp_s Avatar
Posted By sankalp_s
Fri Jan 13 2017, 06:52 PM
Hi phill sir.. testButton1: ...
Deepakvaishu Avatar
Posted By Deepakvaishu
Fri Jan 13 2017, 11:58 AM
suppose i have this arraychar *phone_no[3 ]={"1234...
ajay_bhargav Avatar
Posted By ajay_bhargav
Fri Jan 13 2017, 05:59 AM
You need to send AT command one by one to all the ...
Deepakvaishu Avatar
Posted By Deepakvaishu
Wed Jan 11 2017, 10:47 AM
How to send the same message to multiple contacts ...