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

Tue Jan 22 2019, 06:51 AM
chnlovelyo
writing
ExperimenterUK
Mon Jan 07 2019, 03:31 AM
@REVOCATUS please post in the AVR forum
Mon Dec 24 2018, 09:25 AM
REVOCATUS MATEMU
sorry I mean referee boards for player substitution
Mon Dec 24 2018, 09:24 AM
REVOCATUS MATEMU
hi am.looking how to build referee by using Atmega 328 and its codes
Sat Dec 15 2018, 01:45 PM
Arslan ayoub
Hii ,, can I get the simulation of numeric keypad lock on proteus
ExperimenterUK
Mon Dec 03 2018, 05:17 PM
Please post questions in the forum. The chat box is for chat
Mon Dec 03 2018, 06:43 AM
help!me!
help! I don't understand busy flag!
Sun Dec 02 2018, 08:01 PM
ile
hello
Mon Nov 12 2018, 05:58 AM
Pavan_user
i have seen your replica of I2C programming using AT89C51 but i am unable to understand the "ack_bit" variable usage ...looks like it is always 1...can you elaborate how acknowledgment is working....
bgk3678
Tue Nov 06 2018, 02:36 PM
kindly any one give solution for my problem

Downloads

Comments

garfield0929
Sun Jan 20 2019, 12:48 AM
servprov
Thu Jan 17 2019, 06:44 AM
marcomilazzo
Wed Jan 16 2019, 04:21 PM
sandhyashree
Wed Jan 16 2019, 04:04 PM
SONACHAI1234
Sun Jan 06 2019, 08:14 AM
manan.gulyaani
Tue Jan 01 2019, 07:58 AM
etech
Sun Dec 30 2018, 07:44 PM
NeilC
Sun Dec 23 2018, 07:39 PM

Online

Guests: 62, Members: 0 ...

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

Members: 38039
Newest member: garfield0929
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Jan 06 2019, 10:37 PM
Which 8051 chip are you using ?
SONACHAI1234 Avatar
Posted By SONACHAI1234
Sun Jan 06 2019, 08:21 AM
Hi,By mistakenly i burn rx program in my 8051 micr...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Dec 19 2018, 06:27 PM
Nobody knows?sifirsekizThe problem is that you are...
sifirsekiz Avatar
Posted By sifirsekiz
Wed Dec 19 2018, 12:15 PM
sifirsekiz Avatar
Posted By sifirsekiz
Sun Dec 16 2018, 11:13 PM
Guys pleaseeeee :((
sifirsekiz Avatar
Posted By sifirsekiz
Sat Dec 15 2018, 07:09 PM
HiThe pulse-sensor-amped has an analogue output.Th...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sat Dec 15 2018, 07:01 PM
HiThe pulse-sensor-amped has an analogue output.Th...
sifirsekiz Avatar
Posted By sifirsekiz
Sat Dec 15 2018, 09:02 AM
and ı have pulse sensor one out but anolog use 805...
sifirsekiz Avatar
Posted By sifirsekiz
Sat Dec 15 2018, 08:56 AM
HiMembers can supply code and diagrams if they wan...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Dec 14 2018, 11:54 PM
HiMembers can supply code and diagrams if they wan...