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

poojab51296
Sun Aug 20 2017, 10:23 AM
i am intending to interface sd card with STM32F4 and want to write a file in sd card using SPI protocol but using HAL only. Can anyone help me PLEASE!!!!
poojab51296
Sun Aug 20 2017, 10:22 AM
hello
rawat742
Fri Aug 18 2017, 11:37 AM
hi @ angel patel i will attach a file i hope it will be helpfull for you
ExperimenterUK
Mon Aug 14 2017, 09:57 PM
@ angel patel... just log in and post your problem
Mon Aug 14 2017, 01:45 PM
angel patel
hey any one help to make the led scrolling display
desuza6
Sat Jul 29 2017, 07:09 AM
I see the code for step motor h l 298 to rotate 45 degree, but all delay time, if I want to input sensor to h the pulses to stepmotor
rammichael
Thu Jul 27 2017, 12:05 PM
okay fine
ExperimenterUK
Wed Jul 26 2017, 07:51 PM
Please post questions in the forum, the chat box is for chat
msd007
Wed Jul 26 2017, 11:27 AM
i need code if any one have aduc706 interfacing lcd 16*2
msd007
Wed Jul 26 2017, 11:26 AM
pl help me how to write code of interfacing ADuc7026 controlleo lcd pl any one help me hoe to initializend configure the direction

Downloads

Comments

abdullah6484
Tue Aug 22 2017, 10:21 PM
crank.tp
Mon Aug 21 2017, 02:17 PM
poojab51296
Sun Aug 20 2017, 10:18 AM
kira113
Sat Aug 19 2017, 08:40 AM
Pirateak
Thu Aug 17 2017, 02:02 PM
sathishksk71
Wed Aug 16 2017, 04:47 AM
rawat742
Sun Aug 13 2017, 05:49 PM
alparslanbagriyanik
Fri Aug 11 2017, 08:10 AM

Online

Guests: 99, Members: 0 ...

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

Members: 37882
Newest member: abdullah6484
Forum Activity
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:30 PM
It will be easier to help if you can post the comp...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:24 PM
There is a company in china which makes 8051 micro...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:19 PM
Which library or driver are you using for SD card ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:05 PM
Thanks for Sharing.. I will post this in download ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:04 PM
This post looks more like a link posting than actu...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:01 PM
here is library reference link: https://github.com...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 01:00 PM
You can port an Arduino library to PIC. What kind ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Aug 23 2017, 11:40 AM
Most commonly 3D formats are SBS (Side by side) an...
rawat742 Avatar
Posted By rawat742
Mon Aug 21 2017, 09:13 PM
Dear sir, I want purchase a debugger for 8051 , p...
rawat742 Avatar
Posted By rawat742
Mon Aug 21 2017, 09:09 PM
Dear Sir, I want to programe for de...