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 Jun 12 2017, 07:36 PM
madhusoodanan
how to receive string using 8051
ajay_bhargav
Thu Jun 08 2017, 05:48 PM
@Vinoth post in forum.
Wed Jun 07 2017, 06:40 AM
vinothkannan
how interface eprom in this code
Thu May 25 2017, 05:25 AM
Monir Hossain
Can i change the 7-Segment are common pin ? And how to?
Mon May 08 2017, 12:45 PM
ivan muvunyi
please can you send me wiring diagram for automatic control of 3 phase induction motor for production of maize flour
Wed May 03 2017, 08:39 PM
imran qureshi
hello friend
Sun Apr 30 2017, 05:49 AM
Lijin G Varghese
Can u send me the circuit diagram for Program to interface GSM Module with 8051 microcontroller (AT89C51) using PC and LCD
Fri Apr 28 2017, 03:47 PM
SANDEEP T S
I need pcb wizard 3.5 version kindly send valid link of yours
ExperimenterUK
Mon Apr 17 2017, 11:56 PM
Sorry..We had a problem with registration.Confirmation emails were not sent.Please re-register
Thu Apr 13 2017, 07:29 PM
Piyush Aughad
I want circuit & program for radar detection using Microcontroller 8051

Downloads

Comments

richard1976
Sat Jun 24 2017, 05:48 PM
DruvaN
Wed Jun 21 2017, 11:44 AM
lalala
Tue Jun 20 2017, 11:05 PM
Siddh@
Tue Jun 20 2017, 07:47 AM
firdaus0hsem
Sat Jun 17 2017, 04:53 PM
amir9297
Fri Jun 16 2017, 05:44 AM
madhusoodhanan
Mon Jun 12 2017, 07:31 PM
Aminookano
Sun Jun 11 2017, 05:50 AM

Online

Guests: 57, Members: 0 ...

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

Members: 37847
Newest member: richard1976
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Jun 26 2017, 08:42 PM
I have attached a demonstration file.It will echo ...
richard1976 Avatar
Posted By richard1976
Sat Jun 24 2017, 08:47 PM
Hi can you tell me how to send and recieve usart d...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Jun 24 2017, 08:24 PM
HiUnfortunately there is too much code here to wor...
richard1976 Avatar
Posted By richard1976
Sat Jun 24 2017, 06:01 PM
hi i have written this programme and can send data...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jun 23 2017, 08:19 PM
>Should I need to check PWR_VLD bits every time on...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Jun 23 2017, 07:42 PM
I would say yes, but data transfer will be slower ...
Utsavi Avatar
Posted By Utsavi
Thu Jun 22 2017, 12:14 PM
Hello ExperimenterUK, Thanks for your support. Fro...
DruvaN Avatar
Posted By DruvaN
Wed Jun 21 2017, 11:51 AM
Is it possible to Use 8051 bit-banging method to p...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 20 2017, 06:27 PM
You could start by looking at this tutorial on ke...
firdaus0hsem Avatar
Posted By firdaus0hsem
Sat Jun 17 2017, 04:58 PM
I have an issue regarding how to use 4x3 keypad to...