Answered step by step
Verified Expert Solution
Link Copied!

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 7 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 7-segment code.3.1 Identify and decode input signals for decimal values.The PIC16F62X has two ports (PORT A and PORT B) where every bit can be configured for input oroutput through their corresponding TRIS register. However, RA5 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 8-bit registers the values decoded inbinary from RA0 to RA7 are in the range from 0 to 255, therefore the user can identify the binaryinput applied and decode its decimal value.The following example demonstrate how a three-bit input signal can be decoded andoutput in the figures below:32Design subroutine and familiarize with mnemonic instructions (CALL, RETLW).The entry point of a program is from Bank 0; 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 CALL)the 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), RETLW(for 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 8 levels 13-bit register hardware which cannot be addressed in software. Itworks as last-in-first-out 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 soon).Lookup 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 (i.e 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 0x04Here, 0x04 is the literal value placed inside the W register before returning. Since the opcodereturns to something, it is usually inside a subroutine.33Take note that RETLW reads the stack for the address to which to return. So a GOTO followed byRETLW will result in a stack underflow error.34In the lookup table addresses start at index 0 and the PC register will be pointing theaddress stored in the W register.Lookup table for appropriate BCD to 7-segment code.The seven segment display is a set of 7 LEDs (a, b, c, d, e, f, g) connected togetherand arranged in a socket to represent a number. These LEDs can be connected ascommon anode/cathode and therefore require to be connected to the PIC as currentsinking/sourcing for the LEDs to operate. A diagram of the 7-SEG display is givenbelow:35Table for a common cathode 7 segment display from 0 to 3.Decimal number Binary table value00111111100001102101101131001111ACTIVITY3.1 Write an assembly Program that switches ON and OFF a LED connected to the port A pin 2of a PIC16F627 when a switch connected to the port B pin 2 is HIGH. Otherwise the LED islow.3.2 Write an assembler program that converts the first four binary bits connected to port Aand store the converted number in the register 24 and converts the last four binary bitsconnected to port A and store the converted number in the register 22. Your application shouldperform the following:3.3 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 4 Hz. Predict the frequency of the MSBand measure it using the simulation clock. Run the applications in MPLAB with Proteus VSM36selected 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Online Market Research Cost Effective Searching Of The Internet And Online Databases

Authors: John F. Lescher

1st Edition

0201489295, 978-0201489293

More Books

Students also viewed these Databases questions

Question

Does it use a maximum of two typefaces or fonts?

Answered: 1 week ago