- What is the difference between
assembly language and machine language?
Language that microcontroller and man use
to communicate is called "assembly language".
A program that is translated into
"zeros" and "ones" is also called "machine
language" and it is understood by the machine.
- After the assembly language is translated,
what kind of file will be produced?
Execution file or also named as Hex
file.
- .200 is representing 200 in assembly
language MPLAB, write the equivalent value of it in hex and binary format
in assembly language representation.
C8 (hexadecimal) and 11001000
(binary).
- What are the three steps in preparing
the program for loading into microcontroller using MPLAB?
Preparing
the program for loading into microcontroller can boil down to few basic steps:
1.
Designing a project
2. Writing the program
3. Converting to zero-one code comprehensible by microcontroller, i.e. compiling.
2. Writing the program
3. Converting to zero-one code comprehensible by microcontroller, i.e. compiling.
- If the program is written in assembly
language, what kind of toolsuit is suitable as compiler in MPLAB?
Microchip MPASM
- If the program is written in C
programming language, suggest a 3rd party compiler development
tool. What is the outcome file format of the compilation?
Hi-Tech PICC is a toolsuit can be
used in compilation. The outcome of the complication will be executing file or .hex.
- What are the five basic elements of
assembly language? Write a short program and label those elements.
Basic
elements of assembly language are:
·
Labels
·
Instructions
·
Operands
·
Directives
·
Comments
- As a result of the process
of translating a program written in assembler language we get files like:
- Executing file (Program_Name.HEX)
- Program errors file (Program_Name.ERR)
- List file (Program_Name.LST)
Give
a brief description for each of it.
The
first file contains translated program which was read in microcontroller by
programming. Its contents can not give any information to programmer, so it
will not be considered any further.
The second file contains possible errors that were made in the process of writing, and which were noticed by assembly translator during translation process. Errors can be discovered in a "list" file as well. This file is more suitable though when program is big and viewing the 'list' file takes longer.
The third file is the most useful to programmer. Much information is contained in it, like information about positioning instructions and variables in memory, or error signalization.
The second file contains possible errors that were made in the process of writing, and which were noticed by assembly translator during translation process. Errors can be discovered in a "list" file as well. This file is more suitable though when program is big and viewing the 'list' file takes longer.
The third file is the most useful to programmer. Much information is contained in it, like information about positioning instructions and variables in memory, or error signalization.
- What
is MPLAB? How does it help in embedded system design?
MPLAB is a Windows program package that
makes writing and developing a program easier. It could best be described as
developing environment for a standard program language that is intended for
programming a PC
- What are the advantages of using Macro
in programming? Give an example to explain it.
Macro is reusable short program. It
can be called or shared by others program. It will minimize the error and
reduce the redundancy of the program.
bank0 macro ; Macro bank0
bcf STATUS, RP0 ; Reset RP0 bit = Bank0
endm ; End of macro
- What are the differences between Macro
and Subprogram?
With
macros, use of input and output parameters is very significant. With
subprograms, it is not possible to define parameters within the subprogram as
can be done with macros. Still, subprogram can use predefined variables
from the main program as its parameters.
- Among these
three instructions, RETURN, RETLW and RETFIE, which one is the best
instruction used in return from ISR? Why?
It is
recommended that instruction RETFIE be used because that instruction is the
only one which automatically sets the GIE bit which allows new interrupts
to occur.
- Refer to interrupt register shown at below, what are the function of TOIE and TOIF? Give one short program to show the application of it.
bit 2 T0IF (TMR0 Overflow
Interrupt Flag bit)
bit
5 T0IE
(TMR0 Overflow Interrupt Enable bit) Bit which enables interrupts during
counter TMR0 overflow.
- EEIE stands for EEPROM Write Complete
Interrupt Enable bit, explain
why it is necessary to have this kind of interrupt?
This interrupt is of practical nature only.
Since writing to one EEPROM location takes about 10ms (which is a long time in
the notion of a microcontroller), it doesn't pay off to a microcontroller to
wait for writing to end. Thus interrupt mechanism is added which allows the
microcontroller to continue executing the main program, while writing in EEPROM
is being done in the background. When writing is completed, interrupt informs
the microcontroller that writing has ended. EEIF bit, through which this
informing is done, is found in EECON1 register. Occurrence of an interrupt can
be disabled by resetting the EEIE bit in INTCON register.
- Refer to attached INTPORTB.ASM file, draw a flow chart and explain how the program works.


No comments:
Post a Comment