Hi there,
Just joined a moment. I'm doing some PIC projects for my college and I'm having trouble with this subtraction program I've written. Project works fine on the simulator, but when I load it on the PIC it behaves differently. I didn't think I had a hardware fault as other projects worked fine. The problem arises when a negative number is produced form the subtraction. I've dealt with a negative result by switching one of my inputs to output to display the 9 bit 2's complement negative number, then swapping it back again with a reset button. The program and hardware work fine with a positive number result and also on switch on when you do a calc with a negative result. If you try to do another negative result calc errors occur, but regular errors always the same. Is there any thing I have to consider when switching an input to an output then back again with the PIC16F84? Any help would be great. If additional info is needed let me know.
Thanks
Just joined a moment. I'm doing some PIC projects for my college and I'm having trouble with this subtraction program I've written. Project works fine on the simulator, but when I load it on the PIC it behaves differently. I didn't think I had a hardware fault as other projects worked fine. The problem arises when a negative number is produced form the subtraction. I've dealt with a negative result by switching one of my inputs to output to display the 9 bit 2's complement negative number, then swapping it back again with a reset button. The program and hardware work fine with a positive number result and also on switch on when you do a calc with a negative result. If you try to do another negative result calc errors occur, but regular errors always the same. Is there any thing I have to consider when switching an input to an output then back again with the PIC16F84? Any help would be great. If additional info is needed let me know.
Thanks