Lab
HJ24-09 Input-Signal Stabilizer
Unloading System
30 points
OEES 215
| For this project, you'll be writing a program to match the flowchart below. For the Unloading System, we'll be having one microcontroller dedicated to filtering input signals. For this project, you'll be writing a program to process two input signals. The multsamp( ) function will be used to filter out intermittent fluxuations of the input signals, and only allow through input signals that have been steady for a specified length of time. Click here to get a reference page explaining multsamp( ). To use multsamp, you'll need to download S215XC_Std_func_4.bas and put it into the xcsb-2.0.1-pic-lite-win folder on the C: drive. Right-click here to get this file. Also, right-click here to get a template that is compatible with S215XC_Std_func_4.bas. In the flowchart below, the first few blocks accomplish the task of getting values for the desired delay between samples and for the number of samples to be taken. The values for both of these come from the DIP switches. At the very top of the flowchart, Initp(1, 1) specifies that Port A will be for inputs, Port B will be for outputs, and that inverted I/O will be used (as usual). Glossary
Four arguments are sent to Multsamp( ).
sbin is used to contain the number sent back by Multsamp( ). The acronym stands for "stabilized bit input." out0 and will function as a flip-flop. Two if statements are used to determine whether out0 is to be "set" or "reset," to use flip-flop terminology. Specifically, if sbin is a 1, we put a 1 into out0. If sbin is a 0, we put a 0 into out0. If sbin is a 2, Multsamp( ) is telling us that the input wasn't stable. In this case, we leave out0 unchanged. For input 1, we repeat the same code that was used to stabilize input 0. The only difference is that we're using input 1 instead of input 0. |
![]() |
Input Switches (Port B) 0 = input 0 1 = input 1 2, 3, 4, & 5 = sampling delay 6 & 7 = number of samples Output LEDs (Port A) 0 = stabilized input 0 1 = stabilized input 1 2 = input 0 is being filtered 3 = input 1 is being filtered |
![]() |