Hi there again, I have another project and is your feedback is needed at this point. This is what I need to do: " Read the 4-bit Switch value and then multiply the switch value by the decimal number 100 ( D’100’). Display the results on the LEDs. Must use a loop counter (“Count”) to implement this Lab. Use the literal D’100’ to set the “Count” variable and each time thru the loop add the switch value to the accumulated “SUM”. Each time thru the loop the “Count” is decrement and when you reach 0, you are done. Use REG1 for the MS byte and REG0 for the LS byte of the SUM. When S17 is a logic “0”, display the LS byte on the LEDs and when S17 is a logic ‘1” display the MS byte.
This is what I have so far and I think it needs some debugging. I would appreciate your feedback.
Where do I begin? You should post the full circuit and program list if you want help.
Some obvious errors are the bottom 6 lines of code are never executed because of the GOTO DONE instruction and the W register is not set for the MOVWF TRISB instruction. The W register is not set for the MOVWF PORTB instruction (should it have been MOVF PORTB,W?), the register REG1 has not been defined or used etc. I have not checked the logic of the program as I do not see how it can work