Assembly programming need help ?

Status
Not open for further replies.

Thread Starter

saha

Joined Jun 1, 2006
53
hi vikram_n_99,
i feel that you might have misunderstood the concept of "INTERRUPT", b'coz you said that "main program checks for interrupt from serial port for a period of 3seconds" This is a small example. if i've enabled the serial receive, timer 0 , intr0, intr1 and the maiin routine will do some operation. so alltogether i would have written four separate programs (3 interrupt service routines and 1 main program). I've mentioned as interrupt service routines it means that those routines/ programs will be executed only upon the specified interrupts only (preferably terminated by "RETI meaning Return from Interrupt") and i feel that you need not wait for an interrupt and continue with your task in the main program.if you've enabled the Interrupt then once it comes the MCU will automatically execute the program written in the location for ISR.for instance 0023h is the location where the program jumps if you'd enabled serial receive and will execute the instruction written in the location 0023h.

i would better suggest that for every ISR you make it a habit to write a subroutine, like this. open the ".lst" file of your program and check the location of the start of your code.

0003h

lcall timer_0_ISR
reti

000bh

lcall intr_0_ISR
reti

0013h

lcall timer_1_ISR
reti

001bh

lcall intr_1_ISR
reti

Coming to the next problem, you mentioned MAX220. i feel that you are going for RS-422 communication which is two wire, but the 89c52 supports only RS-232 Communication (which needs three wire). i haven't connected like this before. will it work . i guess it will not. if its a typing mistake then leave it, if you've misplaced then try MAX232.

regards,
saha
 

nsafadi

Joined Oct 18, 2006
1
Hello everybody ..

i am trying to programming AT89C51 for UART using .. i.e i want to send a control data ( 4 bits for 2 DC motors & 2 bits for stepper motor and 1 it for isd1420 chip and 1 bit for fan motor ) to a robot through serial port of a pc .. and i will receive these data to a microcontroller ( AT89C51 ) and then make ( Serial to parallel conversion for the data ) and although i have a tempreture sensor ( LM35 ) wana to send it's 5 bits data back to the computer ..

can anybody help me with an assembly code for the microcontroller .. and if there any suggestion circuits ..


bye
 

th0rnbird

Joined Nov 10, 2006
3
Hi all
I have done a simple project with 89c51 " transmiting 2 bytes ((that read from 2 adc's )) to pc through RS232 and simple monitoring of these 2 bytes "

Now I want to transmit data to pc through the telephone line , I know that the input of modem is RS232 but I dont have any information about handshaking of an external modem
can u help me?

89C51 TXD-->(MAX232)-->PC (I HAVE DONE)
89c51 TXD--> (MAX232) --> MODEM -->TEL LIN --> MODEM-->PC (I WANT TO DO)
 
dear saha,
how r u?u r doin a great job man,by helping needies kike us.we are doin work on project which is 4degree freedom of a robot.in this we have to interface 2lione 20 char lcd,keyboard with 10 keys numeric and dc motor to control its speed.
can u help us in providing thge software or programming for this project.can u tell us how we can control speed of 12v dc motor using 8051.how can we move it bidirectional using 8051..programming for that..plz help us dear its very urgent as we have to submit the project in next 3 coming days...
mayank goel
 

Thread Starter

saha

Joined Jun 1, 2006
53
Hi vikram_n_99,

THIS PROGRAM WILL WORK, JUST ASSEMBLE IT USING THE METALINK ASSEMBLER GIVEN FREE OF COST BY www.iguanalabs.com.

;********************************************
; START OF THE PROGRAM
;********************************************

$MOD51

ORG 0000h
SJMP START

Hi vikram_n_99,

THIS PROGRAM WILL WORK, JUST ASSEMBLE IT USING THE METALINK ASSEMBLER GIVEN FREE OF COST BY www.iguanalabs.com.

;********************************************
; START OF THE PROGRAM
;********************************************

$MOD51

ORG 0000h

SJMP START


org 0003h


reti



org 000bh


reti




org 0013h


reti




org 001bh


reti



ORG 0030h

START:
LCALL init_ser
MOV DPTR,#4300h ; STARTING ADDRESS OF EEPROM
MOV R3,#32h ; COUNTER HERE I'VE CONSIDERED
; TRANSMISSION OF 50 BYTES OF DATA FROM ;
; THE LOCATION 4300h TO 4332h

NEXT_BYTE:
MOVX A,@A+DPTR
MOV R7,A
LCALL transmit
INC DPTR
DJNZ R3,NEXT_BYTE
JMP $ ; STAY


;********************************************
; ROUTINE TO TRANSMIT THROUGH SERIAL PORT
;********************************************

transmit:
mov a,r7
mov sbuf,a
tx: jnb ti,tx
clr ti
ret
;********************************************
; ROUTINE TO INITIALIZE SERIAL PORT
;********************************************
init_ser:
orl ie,#90h
anl tmod,#00h
orl tmod,#20h
mov th1,#98h ; 300bps
mov scon,#58h
setb tr1
ret


END
 

Thread Starter

saha

Joined Jun 1, 2006
53
HI th0rnbird,
I REMEMBER SOME THREE YEARS BACK I'D DONE A SIMPLE APPLICATION WHICH TRANSMITS DATA THROUGH TELEPHONE LINE. BUT MY APPLICATION SENDS DATA TO CONTROL A SET OF RELAYS CONNECTED IN THE OTHER END. YOU NEED TO BUILD A DTMF ENCODING AND DECCODING CIRCUIT AT THE TRANSMITTING END AND RECEIVING END RESPECTIVELY. YOU CAN GOOGLE IT T0 GET INFO REGARDING DTMF DECODERS.

I'D GOOGLED AND FOUND THIS LINK IT'LL DECODE THE SIGNALS.

http://www.bobblick.com/techref/projects/tonedec/tonesch.gif

HOPE IT'LL BE USEFUL FOR YOU.


NOTE:
IF YOU ARE STUCK WITH A PROBLEM. JUST GOOGLE WITH AS MUCH KEYWORDS AS POSSIBLE. I AM SURE THAT 99.99 % YOU'LL GET EXACTLY WHAT YOU NEED. PERHAPS YOU SHOULD NOT START SEARCHING FOR SOMETHING OF BUILDING A TIME MACHINE.


REGARDS,
SAHA
 

Thread Starter

saha

Joined Jun 1, 2006
53
Hi mayankgoel,

SURELY I CAN HELP YOU. YOU CAN DO IT.IF THE CHOSEN DC MOTOR HAVE THE PROVISION OF REVERSAL OF ROTATION UPON REVERSING THE TERMINALS THEN SIMPLY CONNECT THE PORT PIN OF THE MCU TO THE DC MOTOR THRU ULN 2003/ULN2803/ TIP122. GOOGLE FOR GETTING THE SCHEMATIC OF THE CIRCUIT. FOR FEED BACK PURPOSE YOU CAN BUILD A SIMPLE ENCODER WHICH DETECTS THE ROTATION AND GIVES OUT A SERIES OF PULSES. THE FREQUENCY OF THE PULSES WILL DIRECTLY GIVE THE ROTATION OF MOTOR IN SECOND (ROTATIONS PER SECOND- RPS). I CAN GUIDE YOU THAT'S IT.BUT YOU MUST GET ME A CLEAR PICTURE OF WHICH PROCESSOR YOU ARE USING, HOW THE LCD IS CONNECTED..ETC.BY THE WAY I DON'T THINK THAT YOU NEED THE SOURCE CODE , CIRCUIT SCHEMATIC IMMEDIATELY. Visit this link for 20X2 CHARACTER LCD DISPLAY
http://www.hantronix.com/down/20216l1.pdf


REGARDS,
SAHA
 
THANKS SAHA FOR UR KIND HELP.
but dear it very urgent for us.we want the source code and schematic diagram very early as soon as possible.if u can help us then help us very soon.our final date for submission of minor project is on 15nov.plz help us brother plz help us...
if u can then provide us with your contact no.so that we can contact u directly
 

vedant

Joined Feb 23, 2007
2
i have a iBOARD(8051 based robot control board)[RSB04] i have to program it to follow a 3cm wide line v will be using a differintial drive of d.c motors to move the robo (one motor spins faster to turn in the respective way i m using IR based Line Detecting Module please give me the program and also tell me how to upload the program in to the microcontroller .i m doing this for the first time plz help me.plz also mail me the programs.if u want more info i can give ti.
 

ersss1907

Joined Feb 23, 2007
1
hi saha,
im a electri-electronic engineering last class student. i have a project. Servo motor controller with 89c52 microcontroller(software and hardware) i have 2weeks pls help me, SAHA here is my mail:deuand2007@yahoo.com.tr u can give some extra schematics for hardware if isi ti posiible
thanksssss
 

G-Unit

Joined Jan 16, 2007
3
hi saha !
thanks for taking the time to answer!
im Alex an electronics student and im asked to do this project with 89c51 mcu
this is the project i was given but i need to do this with a 89c51 and a couple changes.

basicly i need to do this with a 3 on 4 keyborad ,i need to enter a code and a led lights up,triggers some thing to work like a buzzer that doesn't matter. also theres 2 switches one to programe a new code and another to disable the keyborad.
i really hope you can help me!
many thanks!!!
 

Thread Starter

saha

Joined Jun 1, 2006
53
HI VEDANT,

I need to know the schematic of that and more details like what's the MCU number, it can be a 8051 famili processor,but what actually is written over the IC. Any regarding progamming if its a ordinary MCU then u need a universal programemr or some kits which can prgram your IC. There are some special IC with whic YOU can program without removing from the kit. but atleast 2 or 3 pins will be provided for serially programmming it.got to the IC manufacturer site AND download the free software and refer to the data sheet for connecting. hOPe this will help for now. If you have a camera on your mobile dotake so sanp shots and post it. not onyme but others can also help you. don't try to explain in 2 or 3 lines.

Do write about for 10 lines as you have a big problem in frontof you. See nobody out in the net is having the same robot controller as you have. BE specific, descriptive . add hand drawn drawings. You know some one like you had sent me a Power point of what's their problem and what's that they need from me. and iam simply amazed at the dedication they had towards their work. You may be sitting somewhere alone in this big world and if you expect someone out in the net to help you. tell more about where you stand.

Note for all:

Iam not the advt manager for google inc. but i say it as the one who had experienced the power of Google. when you need something just

Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,
Google,Google,Google,Google,Google,Google,Google,Google,



Hi ersss1907,

FOLLOW THIS LINK and the above note is for you . I ..think. come back to me if you still have problem.

http://forum.allaboutcircuits.com/showthread.php?t=3100&page=2

:)


Hi G-unit,
I had seen the circuit what you can do is replace the Pic with AT89C1051 microcontroller. I hope this is for password based electronic licking system. make the circuit . The MCU has 2 ports, ie 16 general purpose pins. tp one port connect the keypad to the oher connect one LED istaed of the illumination coil and replace the 4400 WITH BC 547. SEND IT TO ME ONCE AGAIN I'll gve the code for you.

bye
saha
 
Hi saha,

I am doing a project using 89c52 mc. The project is basically divided into the following modules:

1. rs-232 connection for transmission and receiving data
2. infra red sensor interfacing for obstacle detection
3. stepper motor controller

I am creating a robot that traverses unchartered territory and sends data to a computer. Kindly provide me the code and schematics for the above three modules of my project. I have googled and googled but am unable to find the code that meets my exact specifications.
I need to use stepper motors for precision motion.

My emailid : mubashir_kapadia@hotmail.com

Kindly provide me with the code and circuit diagrams so that i can proceed with the other aspects of my project.
 
I think u r the right person to solve my problem.
I have two microcontroller cards connected through RS-485. Both cards have RJ-45 connectors. The RS-485 is connected through serial port of my PC. Now what i want to do is that, both the microcontrollers have there own seperate codes (e.g. microcontroller-1 has 0001 and microcontroller-2 has 0010), now i want to transfer a code through PC (one of microcontroller's code) to RS-485, the main job is that i should make the controller capable of recognizing its code.

E.g. If i will transmit "0001" microcontroller-1 will turn ON, and if i will transmit "0010" then microcontroller-2 will turn ON.

Please send me a program for that, i will be very thankful to you. Actually i need it in only a single day as i have to submit my assignment on saturday 3rd March. Plz plz plz help me. Send the program on e_sajid@hotmail.com

Regards
Sajid H. Qasmi
 

edgehead

Joined Feb 15, 2007
6
hi saha!!
Could you please tell me what is the meaning of this command :
__BADRAM H'07', H'50'-H'7F, H'87'
I am using a PIC16f84a MCU. Thanks in advance!!!
 

edgehead

Joined Feb 15, 2007
6
Helllo there!

Can you convert this hex file into asm file?

:020000040000FA
:10420000000000000C008000000000001800050005
:104210000200040057002D00300030003E00320044
:104220003400200050002D003000350040003200E6
:1042300068002000580020002000300030003A00C4
:10424000300030003F002D00530045005400200096
:104250002000200020002000500052004F004700A6
:1042600020002000200020004F00500045004E009C
:10427000200020003F002D0053004800550054004E
:00000001FF

I am using a PIC16f84a MCU.Thanks!!!
 
Status
Not open for further replies.
Top