Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to write a report on the below and I am not sure where to start. Kindly assist with report that has aim, procedure,
I need to write a report on the below and I am not sure where to start. Kindly assist with report that has aim, procedure, discussion and comparison and conclusion:BCD TO SEGMENT LOOKUP TABLEObjectives Identify and decode input signals to its corresponding decimal value. Design subroutine and familiarize with mnemonic instruction CALL RETLW Design a lookup table for appropriate BCD to segment code Identify and decode input signals for decimal values.The PICFX has two ports PORT A and PORT B where every bit can be configured for input oroutput through their corresponding TRIS register. However, RA is a Schmitt Trigger input onlyand has no output drivers therefore cannot be set as an output pin, students should be mindfulwhen configuring their ports. Since PORT A and PORT B are bit registers the values decoded inbinary from RA to RA are in the range from to therefore the user can identify the binaryinput applied and decode its decimal value.The following example demonstrate how a threebit input signal can be decoded andoutput in the figures below:Design subroutine and familiarize with mnemonic instructions CALL RETLWThe entry point of a program is from Bank ; the PIC executes a program line by line following theset of the instructions. However, mnemonics instructions such as CALL, GOTO or interrupts canaffect the normal execution of the program and instruct the PC register to execute differentprocedures in your program which are CALL subroutines. When a subroutine is called using CALLthe PC register is loaded with the address of the next instruction to be executed which is pushedinto the STACK, then the subroutine starts its execution. A subroutine must always return to theprogram where it was called by using mnemonic instructions such as RETURN for delays RETLWfor lookup table or RETFIE for interrupts this will cause the top of the STACK to pop out the lastaddress entered, into the PC register to continue its execution for the rest of the program.NB: The STACK is an levels bit register hardware which cannot be addressed in software. Itworks as lastinfirstout register when addresses are popped out. The stack operates as a circularbuffer. This means that after the stack has been PUSHed eight times, the ninth push overwritesthe value that was stored from the first push. The tenth push overwrites the second push and soonLookup tableDesigning a lookup table is basically dressing a table of alias for specific addresses. Since thelookup table arranges its alias in an order of addresses, when the PC is loaded with an address itwill check the corresponding address in the lookup table and execute the mnemonic instructionRETLW ie RETLW Opcode The sequence of number alias usually expressed in binary is set tothe table which will be assigned to the output port for any given input value. The instructionRETLW means return with a literal in w which will load the alias into the W register. It is usedas this:RETLW xHere, x is the literal value placed inside the W register before returning. Since the opcodereturns to something, it is usually inside a subroutineTake note that RETLW reads the stack for the address to which to return. So a GOTO followed byRETLW will result in a stack underflow errorIn the lookup table addresses start at index and the PC register will be pointing theaddress stored in the W register.Lookup table for appropriate BCD to segment code.The seven segment display is a set of LEDs a b c d e f g connected togetherand arranged in a socket to represent a number. These LEDs can be connected ascommon anodecathode and therefore require to be connected to the PIC as currentsinkingsourcing for the LEDs to operate. A diagram of the SEG display is givenbelow:Table for a common cathode segment display from to Decimal number Binary table valueACTIVITY Write an assembly Program that switches ON and OFF a LED connected to the port A pin of a PICF when a switch connected to the port B pin is HIGH. Otherwise the LED islow Write an assembler program that converts the first four binary bits connected to port Aand store the converted number in the register and converts the last four binary bitsconnected to port A and store the converted number in the register Your application shouldperform the following: Download the OUTBYTE.DSN file and attach ENDLESS.COF. Check that it works correctly.Modify the program so that the LED output LSB flashes at Hz Predict the frequency of the MSBand measure it using the simulation clock. Run the applications in MPLAB with Proteus VSMselected as the debug tool. Display the animated schematic in VSM viewer, with the applicationCOF file attached to the MCU.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started