Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] [MOVED] Assembler help needed

Status
Not open for further replies.

Genovator

Advanced Member level 2
Joined
Dec 19, 2011
Messages
550
Helped
87
Reputation
174
Reaction score
84
Trophy points
1,328
Location
India
Activity points
4,632
Here is a code for a modified sinewave inverter I found in a website. Since I am not so good in assembly, I don't understand one thing here. In the last portion this code, a label has been called- "ACALL PULSE_TRAIN" but I found no such label (PULSE_TRAIN) in the program. I only found a label "PULSE".
Then what exactly this "ACALL PULSE_TRAIN" works here??? Is this code is wrong or my concept is??? My code is below:

Code:
;===========================================
;P1=INPUT P3=OUTPUT
;P1.2=BUTTON START P1.7=BATTERY CHECK
;P3.5=DRIVER1 P3.7=DRIVER2
;P3.4=BUZZER P3.3=LED
;INITIALIZATION (BEEP SHORT + BEEP LONG)
ORG 00H
ON: MOV P3,#20H; DRIVER OFF, BUZZER OFF, LED OFF
ACALL DELAI; WAIT 1/4 SEC
SETB P3.4; BEEP ON
CLR P3.3; LED BLUE ON
ACALL DELAI; WAIT 1/4 SEC
CLR P3.4; BEEP OFF
SETB P3.3; LED BLUE OFF
ACALL DELAI; WAIT 1/4 SEC
SETB P3.4; BEEP ON
CLR P3.3; LED BLUE ON
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
CLR P3.4; BEEP OFF
SETB P3.3; LED BLUE OFF
;CHECK BATTERY CONDITION (LOW VOLTAGE = 2 X BEEP SHORT)
CEK: JNB P1.7,MULAI; CHECK BATTERY CONDITION (MULAI=START)
CLR P3.3; LED BLUE ON
SETB P3.4; BEEP ON
ACALL DELAI; WAIT 1/4 SEC
SETB P3.3; LED BLUE OFF
CLR P3.4; BEEP OFF
ACALL DELAI; WAIT 1/4 SEC
CLR P3.3; LED BLUE ON
SETB P3.4; BEEP ON
ACALL DELAI; WAIT 1/4 SEC
SETB P3.3; LED BLUE OFF
CLR P3.4; BEEP OFF
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
SJMP CEK
;INVERTER WAITING KEYSTROKES ON
MULAI: SETB P3.3; LED BLUE OFF
CLR P3.4; BEEP OFF
MULAI1: JNB P1.2,START; READ BUTTON START
CLR P3.3; LED BLUE ON
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
JNB P1.2,START; READ BUTTON START
SETB P3.3; LED BLUE OFF
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
AJMP CEK
;INVERTER ON
START: SETB P3.3; LED BLUE OFF
CLR P3.4; BEEP OFF
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
ACALL DELAI; WAIT 1/4 SEC
SETB P3.4; BEEP ON
CLR P3.3; LED BLUE ON
ACALL DELAI; WAIT 1/4 SEC
CLR P3.4; BEEP OFF
ACALL DELAI; WAIT 1/4 SEC
;PWM GENERATOR
PULSE: JNB P1.2,ON; IF STOP PRESS BACK TO START
JB P1.7,ON; CHECK BATTERY CONDITION
PWM: CLR P3.5;
CLR P3.7;
SETB P3.5;
ACALL PULSE_TRAIN;
CLR P3.5;
CLR P3.7;
ACALL PULSE_TRAIN;
CLR P3.5;
CLR P3.7;
AJMP PULSE
;ROUTINE DELAI1
DELAI: MOV R1,#2
L1: MOV R2,#250
L2: MOV R3,#250
L3: DJNZ R3,L3
DJNZ R2,L2
DJNZ R1,L1
RET
 

Re: Assembly help needed

may be the pulse train thingy is for the PWM generation call of the circuit. btw, which ic are you using? if its 8051, it may be purely software PWM, but in most pic s and AVRs got their own internal PWM modules ;-) refer the datasheets and you can learn a whole lot .
 

Yes, I am using 89s2051.
Is the PWM code is already included in the program, or it is missing???
 

if its a 2051, its purely a software based thingy. like
>>start
>>turn on
>>wait for some time use NOP here, you higher frequency will do good here, just a suggestion,
>>turn off
>>wait for some time (delay) use NOP here, you higher frequency will do good here jsut a suggestion,
>> go to start
so do a code like that. and add to it. i m not that much of an assembler guy, i know you can do it better than me :)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top