Discussion in "Project Doubts" started by    Chinmay Das    Mar 11, 2009.
Sun Mar 15 2009, 01:18 pm
#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, 04:11 pm
#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, 08:38 am ]
Sun Mar 15 2009, 04:12 pm
#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, 06:16 pm ]
Sun Mar 15 2009, 06:18 pm
#24
here is d acctuator disply

Mon Mar 16 2009, 12:34 am
#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, 02:43 pm
#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, 07:34 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, 08:43 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, 08:47 am ]
Wed Mar 18 2009, 10:10 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, 10:16 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

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am