AUTOMATIC FEEDER AND INVERTER FOR FABRIC WORKPIECES

Abstract: The present invention relates to a fabric handling device. Conventionally, fabric workpieces are manually lifted, visually inspected for proper orientation, and then manually flipped as necessary. The present invention takes the workpieces from a stack in which the sides facing up alternate, and automatically places them in the same orientation prior to arrival at a sewing station. A computer controlled picker (10) is used to separate the top workpiece (11) from the remaining workpieces in the stack (12), and for depositing the workpiece on a downstream conveyor (14). An ultrasonic face detector (16) is mounted above the conveyor for determining whether the side of the workpiece facing the face detector is relatively rough or smooth. A pivoting feeder/inverter (20) is provided at the end of the conveyor. If the workpiece is correctly oriented, the inverter/conveyor is placed in a first position so that the workpiece will not change orientation. If the workpiece is incorrectly orientated, the feeder/inverter is pivoted to a second position to enable the workpiece to enter an inverter conveyor, which will rotate the workpiece 180 degrees.

Description: AUTOMATIC FEEDER AND INVERTER FOR FABRIC WORKPIECES FIELD OF THE INVENTION The present invention relates to fabric handling devices. In particular, the present invention relates to devices for picking a fabric workpiece from the top of a stack of like workpieces. determining the side-up or side-down orientation of the workpiece, and feeding the workpiece through a feeder which will invert the workpieces which are not oriented as desired so that all workpieces leaving the feeder will be oriented in the same way. BACKGROUND OF THE INVENTION In the manufacture of clothing it is often necessary to feed small sections or pieces of fabric, called fabric workpieces, into processing machines which edge, sew, and the like. For example, in making dungarees or jeans, the rear seat patch pockets will first be cut as rectangles or polygons of denim, and then singly fed to a machine for hemming the top edge (prior to sewing the patch onto the pants to form the pocket). Or, one leg piece will be fed to a machine for sewing on a fly zipper tape. Typically fabric pieces will be simultaneously cut from multiple layers on a conventional cutting table, and arrive at the processing machine stacked. The stacks of fabric pieces cut in this manner typically have individual pieces which alternate side up and side down in the stack. Jeans fabric, for example, usually has a rough, dark side and a smooth, light side, and ajl the pieces must arrive at a sewing station with a proper side up if the assembled jeans are not to be defective. In the manufacture of jeans, pieces like pocket patches, belt loops and fly material have traditionally been picked off from the stack manually and hand fed into the sewing or processing machine, because existing devices were unable to reliably perform the necessary operations, which are: first, picking up from the stack only the single top piece of fabric (to avoid feeding double pieces to the processing machinery); next, inspecting the pieces to determine which side is facing up; third, flipping those pieces which have the wrong side facing up; and. fourth feeding the individual pieces into the processing machine. Thus, the need exists for an automated device which can automatically remove fabric parts one at a time from a stack of like parts which alternate side up and side down, determine which side is up. and direct each part through a feeding path or an inverting path so that when all parts arrive at a sewing station they have the desired side up. SUMMARY OF THE INVENTION Accordingly, the present invention comprises, in combination, a conventional picker, a face detector for detecting which side of the fabric workpiece is up, and a dual path feeding mechanism which will invert those workpieces in which the desired side is down. The conventional picker is mounted on hydraulic or pneumatic cylinders, and capable of lateral, vertical, and tilting motions to enable the picker head to engage the leading edge of a workpiece and remove it from a stack of like workpieces. A means for clamping the remaining pieces in the stack, and directing a stream of air between the top and second piece in the stack as the top piece is being removed is provided to reduce the frictional resistance between the top and second piece and to prevent the trailing edge of the second piece from "following" as the top piece is removed. During operation, the top piece is moved away from the stack and deposited on a moving conveyor. The lace detector is located along the conveyor downstream from the picker. The face detector includes a dedicated controller, an ultrasonic transmitter and an ultrasonic detector. The face detector is used to determine whether the side of the fabric facing the ultrasonic detector is relatively smooth or relatively rough. Tne face detector controller is programmed to use initial calibration readings for calculating a threshold value for determining smooth or rough, and thereafter continuously readjusts the threshold value as workpieces are sensed, whereby differences in fabric surfaces from workpiece to workpiece are compensated for. The face detector controller interfaces with the machine controller which operates the picker, conveyors, and feeder/inverter. The dual path feeder/inverter includes a twisted-belt inverting conveyor mounted above a conventional conveyor in a housing which pivots about an axis. The housing pivots back and forth to pick up the fabric workpieces from a vacuum conveyor after they have passed under the ultrasonic detector. The housing pivots in one direction if a workpiece has the desired side up, so that the workpiece is directed through the conventional conveyor. The housing pivots in the opposite direction if a workpiece does not have the desired side up, so that the workpiece is directed through the inverting conveyor, or inverter, which rotates the fabric workpiece 180 degrees about an axis along the direction of travel on a twisted interior portion of the belt, so that the fabric workpiece exits the housing with the desired side up. BRIEF DESCRIPTION OF THE DRAWINGS The objects, features and advantages of the present invention will become apparent to one skilled in the art from reading the following detailed description in which: Fig. 1 is a side view showing an automatic feeder of the present invention; Fig. 2 shows a diagram of an ultrasonic face detector of the present invention; Fig. 3 shows a graph illustrating the calibration and self-teaching facility of an ultrasonic face detector of the present invention; Fig 4-6 are circuit diagrams illustrating electronic circuits used in conjunction with a face detector controller used for controlling the ultrasonic face detector; Fig. 7 is an exploded perspective view of a pivoting dual path feeding mechanism of the present invention: Fig. 8 is a top view of a strip of belting material used to construct the inverting belt; Fig. 9 is a top view of a strip of belting material used to construct the inverting belt which has been given two full (360 degree) twists; and, Fig. 10 is a side view of a completed inverting belt, showing its orientation when placed on the rollers of the dual path feeding mechanism. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT As shown in Fig. 1. the general components of the preferred embodiment of the present invention include an operator control panel 8 which allows the operator to interface with a machine controller, as well as the preferred face detector which has its own dedicated controller. The machine includes a picker 10 for removing a fabric workpiece 1 1 from the top of a stack 12 of like workpieces, and for transporting the workpiece to an input end 13 of a conveyor 14. The stack of fabric workpieces used for constructing denim garments is typically composed of pieces which have alternating dark/rough and light/smooth sides up. Thus, if a top workpiece has its dark/rough side up, the next piece in the stack will typically have its light/smooth side up. The stack rests upon a table 36 which may be provided with a conveying means (not shown) for moving a plurality of stacks in a direction perpendicular to the direction of feeding shown in Figure 1, to place them in a position for engagement by the picker 10. Conveyor 14 is preferably provided with a vacuum portion or zone 18 so that as fabric workpiece 1 1 is deposited on conveyor 14, the leading edge portion is held securely against the top surface of conveyor 14. Moving downstream, workpiece 1 1 passes under a face detector 16. Conveyor 14 is preferably constructed with a vacuum source 18 over a central portion of the conveyor belt 14 to securely hold the fabric workpiece flat against the conveyor belt surface. With the fabric workpiece 1 1 held securely against the top surface of the conveyor belt 14, fabric workpiece 1 1 is passed under a face detector 16 which determines whether the fabric side facing the detector is smooth or rough. A signal representative of the fabric side facing the detector 16 is transmitted to the machine controller I not shown]. If the expected side is detected, the fabric workpiece is advanced away from the vacuum zone 1 8 where it can be easily fed into the pivoting feeder/inverter 20. The pivoting feeder/inverter has a first end 22 for the entry of the fabric workpieces and a second end 24 for the exit of the fabric workpieces. If the fabric workpiece has the desired side up. the first end 22 will be pivoted up so that the leading edge of the fabric workpiece can enter the straight-line conveyor unit 26. If the fabric workpiece has the desired side down, the first end 22 will be pivoted down, as depicted in Figure 1. so that the leading edge of the fabric workpiece can enter the inverting conveyor 28, which will invert the fabric workpiece 1 80 degrees about an axis along the direction of travel so that the fabric workpiece exits with the desired side up. Upon exiting the second end 24. the fabric workpiece is taken up by a take-off conveyor 30. which can include a vacuum portion for initially securing the leading edge of the fabric workpiece, and a wiper arm 32 for completely removing the trailing edge of the exiting fabric workpiece to a hanging position until conveyor 30 moves sufficiently to support the entire workpiece. By using a wiper arm 32, any interference between the trailing edge of a long fabric workpiece and the feeder/inverter 20 as it pivots is avoided. The Picker Assembly Any conventional picker head can be used with a feeder of the present invention. A variety of different picker heads which are suitable for use in this invention are disclosed in U.S. Patent 5,039,078, which is incorporated herein by reference. The preferred picker head is disclosed in U.S. Patent 5.1 14, 132, which is incorporated herein by reference. A number of sensors are preferably used in conjunction with the picker assembly 10 to allow control of the operation of the picker 10 by the machine controller. Optical sensors 34. 34' are preferably used to detect the presence of a stack 12 of fabric workpieces in position for feeding. If the stack 12 is carried on a platform or tray which rides on a conveyor which may provided in table 36, the sensors 34, 34' will detect the presence of the platform or tray, and a further sensor can be provided to check for the presence of fabric workpieces on the platform or tray. If no fabric workpieces are detected, the machine controller will signal the conveyor in table 36 to advance the next stack, platform or tray into position for feeding, or signal an operator to place a stack in position for feeding. An optical sensor (or sensors) is preferably provided for checking the path of the picker to make certain there are no obstacles. If an obstacle is detected, a fault signal is sent to the operator, who will clear the obstacle. If no obstacle is detected, the picker 10 advances and is lowered onto the top of the stack 12 adjacent to the leading edge. The picker 10 is moved laterally and vertically using conventional pneumatic or hydraulic cylinders. A sensor is also preferably provided on the picker 10 to provide a control signal to indicate contact with the top workpiece 1 1 . The machine controller directs the picker 10 to secure the top piece: in the preferred embodiment this is done by extending needles into the fabric, and slightly tilting the pickhead. A sensor can, likewise, be provided to furnish a control signal when the pickhead is tilted. A clamp is preferably extended to hold the leading edge of the next piece in the stack, a blast of air is blown to separate the top workpiece from the rest of the stack, and the picker 10 moves up, away from the stack, and towards conveyor 14. Sensors may be provided to insure that the clamp is in a proper position, and not in a position to block movement of the picker. A sensor, such as. for example, a proximity sensor, can be provided so that, when the end of the stack is reached, and the clamp extends over the tray or platform surface, a control signal is sent to the machine controller, which can then advance the next stack into position Sensors are preferably provided for signaling the position of the pick head when it reaches the top of its normal position, and when it reaches a predetermined position for depositing the leading edge of fabric workpiece 1 1 onto conveyor 14. When the predetermined position over conveyor 14 is reached, the machine controller directs the picker 10 to contract the needles and a short blast of air is released to drop the fabric workpiece onto the conveyor 14. The picker 10 is then moved back to a position over the stack in preparation for picking the next workpiece. First Conveyor Conveyor 14 is preferably provided with slight suction to help hold the fabric workpiece flat. This can be provided, for example, by a vacuum plenum 18 disposed under a perforated (or air permeable) conveyor belt. A proximity sensor can be provided upstream of the face detector 16 to make certain that only one workpiece was pulled by the picker 10. If a workpiece having double thickness or greater is sensed, a fault can be signalled and the machine stopped to permit the operator to clear the defect. Face Detector As shown in more detail in Figure 2, the preferred face detector of the present invention includes an ultrasonic transmitter 36. an ultrasonic receiver 38. and a detector controller 40. The preferred transmitter and receiver are manufactured by Baumer Electric, Ltd. (Switzerland), as part number USDK 30D9001 (transmitter) and UEDK 30U9198 (receiver). Baumer's USDK 30D9001 transmitter provides a sonic beam having a frequency of 220 kHz at a sonic beam angle of about 10 degrees, and operates on a supply voltage of about 12-30 volts direct current (D.C.). Baumer's UEDK 30U9198 receiver provides an operating range of 20 to 200 mm for receiving a sonic beam having a frequency of about 220 kHz and a sonic beam angle of about 10 degrees. Powered by 12 to 30 volts DC. this receiver provides an analog signal of from 0 to 5 volts D.C. The ultrasonic transmitter continuously generates an ultrasonic beam which is reflected off the surface beneath the transmitter; the reflected beam is detected by the receiver which generates a voltage which is proportional to the strength of the reflected signal. If the transmitted beam reflects off a perfectly smooth surface which reflects virtually all of the transmitted beam, the receiver should generate about a 10 volt signal. If the surface is so rough that the transmitted beam is substantially absorbed or scattered by the surface beneath, the receiver will generate low to no volts. Thus, a relatively high voltage signal from the ultrasonic receiver represents a facing surface 42 which is smooth, while a relatively low voltage signal from the ultrasonic receiver represents a facing surface 42 which is rough. When the face detector 16 is initially placed into operation, it is necessary to calibrate it so that the detector controller can create a threshold value for comparison with any given measured signal to determine whether the side 42 of the fabric workpiece which sides the transmitter 36 and receiver 38 is smooth or rough. The "rough" and "smooth" characteristics will vary from one fabric to another, and, with the same kind of fabric, from one lot to another. Accordingly, the detector controller has been provided with instructions which will enable it to learn the difference, and to self-adjust a threshold value which it creates during calibration. The preferred source code for performing this task is attached at the end of this specification. One or more calibration switches, shown in Figure 4 as SW3 and SW4, are provided to enable the operator to calibrate the face detector 16. The operator places a fabric workpiece beneath the detector 16. and then both switches are pressed and held to provide a signal to the detector controller that calibration will commence. The detector 16 will take a few seconds to find the proper calibrate level of the material. A bar graph can indicate the approximate calibration level found. Both switches are released. The material is turned over and again placed under the detector. Both switches are depressed, and the detector 16 takes a few seconds to find the proper calibrate level of the material on the second side. Using these two measurements, the detector controller generates an average value which it uses to set a threshold. Once this has been done, production can begin. As pieces are passed under the face detector, differences between the smooth surfaces and rough surfaces will cause fluctuations of the voltages generated by the receiver 38. However, the detector controller will continuously recalculate the threshold value, thus enabling the invention to accurately detect which side is up regardless of the minor differences between the individual workpieces. This process is illustrated by Figure 3, which shows smooth side data points at line 44, rough side data points at line 46. and the calculated threshold used to determine the condition of the next piece at line 48. In the preferred embodiment, when a bundle of workpieces has been completed, and a new bundle is about to be fed through the face detector, the controller will average the starting threshold value and the ending threshold value of the finished bundle to calculate a new starting threshold value for the next bundle. As shown in Figure 2. communications with the machine controller is established by a detector controller input 50 and a detector controller output 52. For each fabric workpiece which passes under face detector 16, a signal is generated by detector controller 40 which designates whether the rough side is up or the smooth side is up. If the machine controller expects the rough side to be up, and the detector controller confirms this state, then the fabric workpiece continues downstream. If the machine controller expects the rough side to be up, and the detector controller 40 determines that the smooth side is up, then one of several actions can be taken. The machine controller can stop the machine, and alert the operator to the fault. The operator can then remove the workpiece and restart the machine. Alternatively, the machine can compensate by manipulation of the downstream feeder/inverter 20. If the smooth side of the fabric workpiece contains a slight flaw, it is possible that the beam will reflect off that flaw and produce a "rough" signal. To limit the possibility of such an erroneous signal, and to improve accuracy, it is most preferred to connect two separated transmitter/receiver pairs to the detector controller 40. The signals from each pair can be compared by the detector controller. If a smooth side is expected, and at least one detector provides a smooth signal, then the side up is substantially likely to be smooth. As shown in Figures 3-5. the heart of the control electronics for the face detector 16 is preferably a P1C 16C73 niicrocontroUer from Microchip Technology. Inc. The controller 40 is a RISC-like CPU with 22 input/output pins (5 capable of Analog-to-Digital conversion). The controller 40 will interface with the I/O's, bargraph, dipswitch etc. by serial shift registers due to pinout limitations. A serial EEPROM will also be available for saving parameters during power downs. The electronics provide the control needed to adjust the face detector 16 for calibration as well as real-time fine tuning. While the power requirements are 24 Volt DC @ 100mA (max), a 5 volt DC regulator provides all voltage for internal circuits. Two 16 pin connectors are provided for all signals, each pin assigned as follows: Connector Connector 2 1 - 24 VDC Power 1 - 24 VDC Power (Isolated) 2 - Ground Power 2 - Ground Power (Isolated) 3 - 24 VDC to Ultrasonic Sensor 1 3 - 24 VDC to Sensor 2 4 - Output from Sensor 1 4 - Output from Sensor 2 5 - Control to Sensor 1 5 - Control to Sensor 2 6 - Ground to Sensor 1 6 - GND to Sensor 2 7 - 24 VDC (Isolated) 7 - 24 VDC (Isolated) 8 - Input - Material Present 1 8 - Input - Material Present 2 9 - Input - New Bundle 1 9 - Input - New Bundle 2 10- Input - Not Defined 10- Input - Not Defined 1 1 - Input - Not Defined 1 1 - Input - Not Defined 12- Output - Face 1 12- Output - Face 2 13- Output - Face 1 inverted 13- Output - Face 2 Inverted 14- Output - Not Defined 14- Output - Not Defined 15- Output - Not defined 15- Output - Not Defined 16- Ground (Isolated) 16- Ground (Isolated) For normal operation: 1. The New Bundle input is set to O VDC and then released to 24 VDC (minimum pulse width > 50mSec) to indicate the start of a new bundle. 2. When the material is under the face detector, a Material Present input is set to 0 VDC. The detector will sample the sensor at a 5 mS rate and build up an average signal for the material. The detector controller will set the Face Output as soon as enough samples have been taken. The Fide Output may change several times as the detector continues to sample the material and update the output. 3. Before the material is no longer under the detector, the Material Present Input (24 VDC) is released. This will prevent misreads from the detector. The detector will freeze the Face Output at this time and wait for the next Material Present Input. 4. Steps 2 and 3 are automatically repeated for each fabric workpiece in the bundle. 5. Step 2-4 are automatically repeated at the start of a new bundle. The presence of material under the detector (step 3 above) and the approaching passage of the trailing end of a workpiece under the detector (step 4 above) can be determined by optical sensors positioned slightly downstream (step 3) and slightly upstream (step 4) of the face detector, and operatively linked to the face detector controller 40 either directly or through the machine controller. The Feeder/Inverter The feeder/inverter 20 is shown in detail in Figures 7-10. As shown in Figure 7, the feeder/inverter 20 includes a straight line conveyor 26 which is preferably formed from a pair of sandwich belts comprising a first driven belt 54 which passes over and is driven by roller 55 and 55". and a second driven belt 56 which passes over and is driven by rollers 55' and 55" " . The rollers 55. 55 ' and belts 54, 56 form an entry nip at end 22 of the straight line conveyor 26. and the rollers 55", 55"' and belts 54, 56 form an exit nip at end 24 of the straight line conveyor 26. Thus, an object being conveyed on straight line conveyor 26 enters the nip between the rollers 55, 55' at end 58, is transported between the two belts 54 and 56, and exits the conveyor 26 at end 60. The rollers 55, 55', 55", 55"' of the straight line conveyor can be driven by any conventional drive mechanism, such as, for example, a motor-driven belt or chain drive 60. It should be understood that the belts and roller surfaces used in this invention may be complementarily ribbed in the manner of auto engine drive shaft belts, or have other means for preventing slipping, should the application demand this. Likewise, the outer surfaces of the belts may be textured with ribs, nubs, waves, fingers, etc., or, these surfaces may have complementary mating patterns such as gear-like teeth for driving and/or meshing the belts together. The feeder/inverter 20 also includes an inverting conveyor 28. Inverting conveyor 28 can be produced as described in U.S. Patent 5.039.078. However, inverting conveyor 28 is most preferably produced using a single driven belt 58 which is formed and mounted on the rollers 59. 59'. 59". and 59"' as shown in Figures 8-10. As shown in Figure 8, belt 58 is formed from a strip of belting material having a first side 64 and a second side (not shown). As shown in Figure 9, one end of belt 58 is held stationary and the other end is twisted through 360 degrees twice, to place two full twists into the belt 58. This exposes both the first side 64 and the second side 66 of the belt. As shown in Figure 10. the two ends of the belt 58 are fused together to form a single, endless belt, and the belt is oriented on the rollers 59. 59 " , 59". and 59'" as shown to form two twisted belt segments which form an entry nip between rollers 59, 59' and an exit nip between rollers 59" and 59'", and which rotate 180 degrees between end 22 and end 24. Referring again to Figure 7. the leading edge of a fabric workpiece enters the nip between rollers 59 and 59' at end 22 with a first side up. and. held between the two twisted belt segments 76. 76 " . is rotated 180 degrees about an axis along the direction of travel, exiting through the nip formed between rollers 59" and 59'" at end 24 with the first side down. The straight line conveyer 26 and inverting conveyor 28 can be conveniently mounted for operation on plate 68, which is, in turn, mounted on a bracket 70. A rotatable axle 72 can be operatively joined to bracket 70 to enable the entire feeder/inverter 20 to rotate in either direction around a central longitudinal axis passing through axle 72. An arm 74 which can be driven to provide linear motion is attached to an end of the feeder/inverter 20 to effect a limited rotation of the feeder/inverter about the axle 72 by pushing end 24 up and pulling end 24 down. A pneumatic cylinder rod provides the preferred arm 74; however, other conventional means can be used, such as, for example, a hydraulic cylinder, a machine driven piston, or the like. Alternatively, conventional means for directly rotating the axle, such as a chain or cable drive, can be used to effect the rotation of the feeder/inverter. Sensors can be used to provide control signals for feedback to the machine controller to indicate the position of rod of drive cylinder 74 and/or end 24. Second Conveyor Conveyor 30 is preferably provided with a slight, partial vacuum to help hold the fabric workpiece in position on the conveyor and to assist in completely removing the workpiece from the output end 24 of the feeder/inverter 20. A clamp or picker head may be used, if desired, to secure the leading edge of a fabric workpiece in position on the conveyor 30 when the wiper 32. shown in Figure 1 , is activated to clear the trailing end from the feeder/inverter 20. Operation of the Preferred Embodiment Assume it is desired for a particular operation that all workpieces should be delivered to a downstream sewing station with the dark (rough) side up. A stack of workpieces is delivered to the input end of the present invention by a conveyor. When the stack is in the proper position for feeding, the picker head 10 advances, drops, extends its needles and tilts to secure the top workpiece in the stack. The picker head raises the leading edge of the workpiece. a holddown clamp comes down on the leading edge of the remaining pieces in the stack, and a blast of air directed between the bottom surface of the top workpiece and the top surface of the second workpiece in the stack separates the top workpiece from the stack, enabling the top workpiece to be removed. The picker head moves back towards conveyor 14 until it reaches a predetermined position, when it lowers, untilts and disengages its needles to drop the leading edge of the workpiece onto the conveyor 14. As conveyor 14 moves the workpiece over the vacuum plenum 1 8, the vacuum draws the workpiece against the surface of conveyor 14. The leading edge of the workpiece moves with the conveyor 14 until it is sensed by a sensor slightly downstream of face detector 16, at which time the beam from the ultrasonic transmitter 36 is reflected off the facing side of the workpiece and the reflected beam is measured by ultrasonic receiver 38. The ultrasonic receiver 38 generates a voltage which is proportional to the reflectivity of the side of the workpiece facing the face detector 16. The face detector controller 40 compares the voltage to a predetermined threshold value, and sends a signal to the machine controller (not shown) indicating which side is up. As the trailing edge of the workpiece passes a sensor slightly upstream from the face detector 16. a signal is sent to the face detector to stop measuring the reflected ultrasonic beam. Assuming the face detector senses that the rough (dark) side is up. when the leading edge of the workpiece reaches a predetermined position on the conveyor 14. the rod in drive cylinder 74 is retracted to position the nip between belts 54, 56 off the end of conveyor 14, whereby the leading edge of the workpiece will enter and be drawn into the straight line conveyor unit 26. As the leading edge of the workpiece approaches the output end 24 of the straight line conveyor, the rod in drive cylinder 74 is extended to place the nip between belts 54. 56 in position whereby the leading edge of the workpiece will exit and be deposited on takeaway conveyor 30. As the first workpiece was entering the straight line conveyor 26. a second workpiece was approaching the face detector 16. In the manner described above, the face detector determines that the second workpiece has the smooth side up. Accordingly, as end 24 of the feeder/inverter is pushed up to place the exit end of the straight line conveyor 26 in position to deposit the leading edge of the first workpiece onto conveyor 30, the nip between rollers 59. 59 " of the inverter 28 are simultaneously positioned to receive the leading edge of the second workpiece. The leading edge of the second workpiece enters the inverter 28, and, as it travels between the two belt segments, the workpiece is rotated 180 degrees about an axis which lies along its direction of travel. The end 24 of the feeder/inverter 20 is moved down to place the exit end 24 of the inverter 28 in position to deposit the leading edge of the second workpiece, now dark (rough) side up, onto the conveyor 30. At the same time, the nip between belts 54, 56 at end 22 of the straight line conveyor is positioned to receive the expected dark (rough) side up third workpiece. For elongated workpieces, such as those used for making belt loops, it is possible for a trailing edge portion of the workpiece to still be in the feeder/inverter at the time the feeder/inverter rotates. If this occurs, the workpiece may be dislodged from its position on conveyor 30. To prevent this from occurring, a wiper blade 32, shown in Figure 1, can be provided and used to remove the tail end of the workpiece from the feeder/inverter 20 and push it to a down-hanging position until the conveyor 30 moves sufficiently to support the entire workpiece. The invention has been described in terms of the preferred embodiment. One skilled in the art will recognize that it would be possible to construct the elements of the present invention from a variety of materials and to modify the placement of the components in a variety of ways. While the preferred embodiments have been described in detail and shown in the accompanying drawings, it will be evident that various further modifications are possible without departing from the scope of the invention as set forth in the following claims. ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 1 ■C OBJECT CODE LIME SOURCE TEXT VALUE 00001 LIST C-120 00002 LIST P-16C73 00003 TITLE 'Denim Face Sensor II PIC16C73 Control Code' 00004 , ************************* *** 00005 00006 * Project: Denim Face Sensor II 00007 * 00008 * Tor: Levi Strauss t Co. 00009 Technology Center 00010 900 N. Dorothy Drive 00011 Richardson, Texas 75081 00012 (214) 234-2030 00013 Attn: Vincent Lin 00014 0001S ;* Contractor: lαusmann Associates, Inc. 00016 1726 Trowbridge 00017 Garland, Texas 75044 00018 (972) 495-6458 00019 Attn: Donald L Klusmann 00020 00021 ;* UP Used: Microchip PIC16C73 00022 ;* 00023 ;* Dates: Sept 20, 1996 Code Started 00024 0002S ; * SM Changes: 00026 00027 ;* HW Changes: SW1 pins 123456 - 8x41C2 (not 8x42Cl) 00028 ;* Add 2 Pull-ups for S 1 and SW2 00029 ;* R4,R5 - 100K (not 10K) 00030 . * 00031 00000064 00032 VER equ 100 ;Version 00033 00034 00035 SOBTITL 'Internal Register Ecpiates' -1997 14 : 41 : 42 PAGE ? < AS M 01.30.01 Intermediate __ ^ 5°"^° - . ' 1_20 -ni F ace S ensor II - PIC16C73 Contro. Code iitteerrnnaall Register Equates 3 XC OOBBJECT CODE LINE SOURCE TEXT VALUE 00036 PAGE ******* ********* 00037 . ********************* ******* ********** * **** 00038 .« 00039 ;* Internal Registers 00040 00041 ; * Register Page 0 00000000 00042 INDF equ 000H .•Indirect Addressing Register bit 00000001 00043 TMR0 equ 001H ; Real Time Clock Counter 8 00000002 00044 PCL equ 002H ;Low Order 8-bit of PC 00045 00000003 00046 STATUS equ 003H Status Register 00000007 00047 IRP equ 7 Register Page Select Bit (Indirect ) 0-OOOH-OFFH 1-lOOH-lFFH 00048 r Page Select Bits ( Direct ) 00049 RP1 equ 6 Registe 00000006 00000005 00050 RP0 equ 5 00-000H-07FH 01-080H-0FFH 10-100H-17FH 11-180H-1FFH 00051 00000004 00052 TO equ 4 1 - Time-OUt Bit Power Down Bit 00000003 00053 PD equ 3 1 - 00000002 00054 Z equ 2 1 - Zero Bit 00000001 00055 DC equ 1 1 - Digit Carry Bit Bit 00000000 00056 C equ 0 1 - Carry 00057 ; Destination - File Register 00000001 00058 d equ 00059 00000004 00060 FSR equ 004H ;File Select Register 00061 ooooooos 00062 PortA equ 005H .-Port A 72/73/74 ;Port 00000006 00063 PortB equ 006H B 72/73/74 00000007 00064 PortC equ 007H ;Port C 72/73/74 oooooooβ 00065 PortD equ 008H ;Port D 73/74 00000009 00066 PortE equ 009H ;Port E 73/74 00067 ,-PC Latch for MSB of PC ( S bits ) O0OOOOOA 00068 PCLATH equ 00AH 00069 0000000B 00070 INTCON equ 00BH Interrupt Control Register 1 - Global Interrupt Enable 00000007 00071 GIE equ 7 pt Enable 00072 PEIE equ 6 1 - Peripheral Interru 00000006 00000005 00073 T0IE equ 5 1 - TMR0 interrupt Enable 00000004 00074 IHTE equ 4 1 - RBO/INT Interrupt Enable 00000003 00075 RBIE equ 3 1 - RBIF Interrupt Enable 00000002 00076 T0IF equ 2 1 - TMR0 Overflow Interrupt 00000001 00077 IKTF equ 1 1 - RB0/IOT Interrupt 1 - Port B Input Change Interrupt 00000000 00078 RBIF equ 0 00079 0000000C 00080 PIR1 equ OOCH ; eripheral Interrupt Register ; 1 - R/V» has taken place 00000007 00081 PSPIF equ 7 ; 1 - A/D Conversion complete 00000006 00082 ADIF equ 6 ; 1 - USART Receive buffer full 00000005 00083 RCIF equ 5 ; 1 - US A RT Transmit buffer empty 00000004 00084 TXIF equ 4 ; 1 - S ync Serial Port transfer complete 00000003 00085 SSPIF equ 3 ; 1 - TMR1 Capture/Compare complete 00000002 00086 CCP1IF equ 2 ; 1 - TMR2 to PR2 match occured 00000001 00087 TMR2IF equ 1 ; 1 - TMR1 overflow occured 00000000 00088 TMR1IF equ 0 PASM 01.30.01 Intermediate SONIC 1 1-20-1997 14:41:42 PAGE enlm Face Sensor II - PIC16C73 Contro * Code nternal Register Equates OC OBJECT CODE LINE SOURCE TEXT VALUE 00089 O0OOO0OD 00090 PIR2 equ 00DH peripheral Interrupt Register 00000002 00091 CCP2IF equ 2 ; 1 - TMR2 Capture/Compare complete 00092 00000O0E 00093 TMR1L equ 00EH ;TMR1 LSB OOO0O00F 00094 TMR1H equ OOFH ;TMR1 MSB 00095 00000010 00096 T1CON equ 010H ;Timer 1 Control Register 00000005 00097 T1CKPS1 equ 5 Timer 1 Prescale values: 00000004 00098 T1C PS0 equ 4 00-1:1 01-1:2 10-1:4 11-1:8 00000003 00099 TIOSCEN equ 3 0/1 - ShutOff/Enable Oscillator 00000002 00100 T1SYNC equ 2 0/1 - Sync/HoSync external clock input 00000001 00101 TMR1CS equ 1 0/1 - Internal/External clock 00000000 00102 TMRION equ 0 0/1 - Stop/Enable Timer 1 00103 00000011 00104 TMR2 equ 011H .•Timer 2 (8 bit) 00105 00000012 00106 T2CON equ 012H Timer 2 Control Register 00000006 00107 TOUTPS3 equ 6 Timer 2 Output Postscale values: 00000005 00108 TO0TPS2 equ 5 0000-1:1 00000004 00109 TOUTPS1 equ 4 00000003 00110 TOOTPS0 equ 3 1111-1:16 00000002 00111 TMR20N equ 2 ; 0/1 - Stop/Enable Timer 2 00000001 00112 T2CKPS1 equ 1 ; Timer 2 Prescale values: 00000000 00113 T2CKPS0 equ 0 00-1:1 01-1:4 UC-1.16 00114 00000013 00115 SSPBUF equ 013H Synchronous Serial Port Buffer 00000014 00116 SSPCON equ 014H SS Control register 00000007 00117 HCOL equ 7 1 - Write Collision Detected 00000006 00118 SSPOV equ 6 1 - Receive Overflow Detected 00000005 00119 SSPEN equ 5 1 - SS Port Enable 00000004 00120 CKP equ 4 0/1 - Rising/Falling Edge Clock SPI 00121 0/1 - Enable/Stretch Clock I2C 00000003 00122 SSPM3 equ 3 0000/0001/0010/0011 - SPI Master Clk -= 00000002 00123 SSPM2 equ 2 Fosc/4 / Fosc/16 / Fosc/64 / TMR2 Output/2 00000001 00124 SSPM1 equ 1 0100/0101 - SPI Slave SS Enabled/Disabled 00000000 00125 SSPMO equ 0 0110/01117/10 bit address 00126 IXXX - start and stop bit interrupts enabled 00127 00000015 00128 CCPRIL equ 015H ;Compare/Capture/PWM register 1 LSB 00000016 00129 CCPR1H equ 016H ;Compare/Capture/PWM register 1 MSB 00000017 00130 CCP1CON equ 017H ;Compare/Capture/P M control register 00000005 00131 CCP1X equ 5 ; 2 low order bits for 10 bit res (PWM) 00000004 00132 CCP1Y equ 4 ; 00000003 00133 CCP1M3 equ 3 Mode Select bits 00000002 00134 CCP1M2 equ 2 0000-Compare/Capture/PWM disabled 00000001 00135 CCP1M1 equ 1 0100/0101/0110/0111-Capture falling/rising rising/16th rising edge 00000000 00136 CCP1M0 equ 0 1000/1001/1010/1011-Compare set/clear/interrupt/trigger 00137 11XX-PM Mode 00138 00000018 00139 RCSTA equ 018H ;Receive Status and Control register 00000007 00140 SPEN equ 7 ; 1 - Serial port Enabled \SM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 4 «iι» Face Sensor II - PIC16C73 Contro. _ode ternal Register Equates C OBJECT CODE LINE SOURCE TEXT VALUE 00000006 00141 RX9 equ 6 0/1 - 8/9 bit receive 00000005 00142 SREN equ 5 0/1 - Disable/Enable Sync single receive 00000004 00143 CREN equ 4 0/1 - Disable/Enable Continuous receive 00000002 00144 FERR equ 2 1 - Framing Error 00000001 00145 OERR equ 1 1 - Overrun Error 00000000 00146 RX9D equ 0 9th bit of received data (Parity?) 00147 00000019 00148 TXREG equ 019H ;USART Transmit Data Register 0000001A 00149 RCREG equ 01AH ;USART Receive Data Register 00150 0000001B 00151 CCPR2L equ 01BH Compare/Capture/PWM register 2 LSB 0000001C 00152 CCPR2H equ 01CH Corapare/Capture/PWM register 2 MSB 0000001D 00153 CCP2CON equ 01DH Compare/Capture/PWM control register 00000005 00154 CCP2X equ 5 2 low order bits for 10 bit res (PWM) 00000004 00155 CCP2Y equ 4 00000003 00156 CCP2M3 equ 3 Mode Select bits 00000002 00157 CCP2M2 equ 2 0000-Compare/Capture/PWM disabled 00000001 00158 CCP2M1 equ 1 0100/0101/0110/0111-Capture falling/rising/4tb rising/16th rising edge 00000000 00159 CCP2M0 equ 1000/1001/1010/1011-Compare set/clear/interrupt/trigger 00160 11XX-PWM Mode 00161 0000001E 00162 ADRES equ 01EH A/D Result Register 0000001F 00163 ADCONO equ 01FH A/D Control and Status Register 0 00000007 00164 ADCS1 equ 7 A/D Clock Select: 00000006 00165 ADCSO equ 6 OO-Fosc/2 Ol-Fosc/8 10-Fosc/32 11-Frc ooooooos 00166 CHS2 equ S Analog Channel Select 00000004 00167 CHS1 equ 4 000-ANO 001-AN1 010-AN2 011-AN3 00000003 00168 CRSO equ 3 100-AN4 101-AN5 110-AN6 111-AN7 00000002 00169 GODONE equ 2 0/1 - A/D Not/In Progress 00000000 00170 ADON equ 0 0/1 - A/D Converter Off/On 00171 00172 00173 ;* Register Page 1 00000081 00174 OPT equ 081H Option Register (OPTION is a reserved word) 00000007 00175 RBPU equ 7 0/1 - Enabled/Disabled PortB Pullups 00000006 00176 INTEDG equ 6 0/1 - Falling/Rising INT Edge 00000005 00177 TOCS equ 5 0/1 - CLKOUT/TOCKI TMR0 Source 00000004 00178 TOSE equ 4 0/1 - Rising/Falling (TOCKI) TMR0 Edge 00000003 00179 PSA equ 3 0/1 - TMRO/WDT - Prescaler Assignment Bit 00000002 00180 PS2 equ 2 PreScaler Value (TMR0) (1/2 for HDT) 00000001 00181 PS1 equ 1 000-X2 001-X4 010-X8 011-X16 00000000 00182 PSO equ 0 100-X32 101-X64 110-X128 111-X256 00183 00000085 00184 TRISA equ 085H ;Port A Data Direction Register (1-Input) 00000086 00185 TRISB equ 086H ;Port B Data Direction Register (1-Input) 00000087 00186 TRISC equ 087H ;Port C Data Direction Register (1-Input) 00000086 00187 TRISD equ 088H Port D Data Direction Register (1-Input) 00000089 00188 TRISE equ 089H Port E Data Direction Register (1-Input) 00000007 00189 IBF equ 7 1 - Parallel Port D Input Buffer Full 00000006 00190 OBF equ 6 1 - Parallel port D Output Buffer Full 00000005 00191 IBOV equ 5 1 - Parallel Port D Input Buffer Overflow 00000004 00192 PSPMODE equ 4 0/1 - General Purpose/Parallel slave Port D PAGE IP ASH 01.30.01 Intermediate SONIC 1 1-20-1997 1 4 :41:42 >eni» F ace Sensor II - PIC16C73 Controx Code ( nternal Register Equates ' oC OBJECT CODE LINE SOURCE TEXT VALUE 0/1 - R E2/CS/AN7 Output/Input 00000002 00193 TRISE2 equ 2 0/1 - RE1/WR/AN6 Output/Input 00000001 00194 TRISE1 equ 1 0/1 - RE0/RD/AN5 Output/Input 00000000 00195 TRISEO equ 0 00196 Peripheral Interrupt Control Register 1 0000008C 00197 PIEl 08CH 0/1 - Disable/Enable PSP Read/Write Int 00000007 00198 PSPIE equ 7 0/1 - Disable/Enable A/D Int 00000006 00199 ADIE equ 6 0/1 - Disable/Enable USART Receive Int ooooooos 00200 RCIE equ 5 0/1 - Disable/Enable USART Transmit Int 00000004 00201 TXIE equ 4 0/1 - Disable/Enable SSP Int 00000003 00202 SSPIE equ 3 0/1 - Disable/Enable CCP1 Int 00000002 00203 CCP1IE equ 2 0/1 - Disable/Enable TMR2 Int 00000001 00204 TMR2IE equ 1 0/1 - Disable/Enable TMR1 Int 00000000 00205 TMR1IE equ 0 00206 ;Peripheral Interrupt Control Register 2 0000008D 00207 PIE2 equ 08DH ; 0/1 - Disable/Enable CCP2 Int 00000000 00208 CCP2IE equ 0 00209 ; ower Control Register 0000008E 00210 PCON equ 08EH ; 0 - power-On Reset occured 00000001 00211 POR equ 1 ; 0 - Brown-Out Reset occured 00000000 00212 BOR equ 0 00213 ;Timer2 Period Register 00000092 00214 PR2 equ 092H ; SSP Address Register 00000093 00215 SSPADD equ 093H SS Status Register 00000094 00216 SSPSTAT equ 094H 0/1 - Last byte received Address/Data 00000005 00217 DA equ 5 0/1 - Stop Bit Not-Detected/Detected 00000004 00218 P equ 4 0/1 - Start Bit Not-Detected/Detected 00000003 00219 S equ 3 0/1 - Write/Read 00000002 00220 RW equ 2 1 - User needs to update Address in SSPADD 00000001 00221 UA equ 1 0/1 - SSPBUF Empty/Full 00000000 00222 BF equ 0 00223 USART Transmit Status and Control Register 00000098 00224 TXSTA equ 098H 0/1 - Slave/Master Mode 00000007 00225 CSRC equ 7 0/1 - 8/9 bit Transmit 00000006 00226 TX9 equ 6 0/1 - Enable/Disable transmit 00000005 00227 TXEN equ 5 0/1 - Async/Sync Mode 00000004 00228 SYNC equ 4 0/1 - Low/High Speed Baud Rate ( Async ) 00000002 00229 BRGH equ 2 ; 0/1 - TSR Empty/Full 00000001 00230 TRMT equ 1 ; 9th bit of transmit data 00000000 00231 TX9C equ 0 00232 ; Baud Rate Generator 00000099 00233 SPBRG equ 099H 00234 A/D Port Configuration Control 0000009F 00235 ADCON1 equ 09FH RAO RA1 RA2 RA5 RA3 RE0 RE1 RE2 Vref 00000002 00236 PCFG2 equ 2 000 - A A A A A A A Vdd 00000001 00237 PCFG1 equ 1 001 - A A A A Vref A A RA3 00000000 00238 PCFG0 equ 0 010 - A A A A A D D Vdd 00239 011 - A A A A Vref D D RA3 00240 100 - A A D D A D D Vdd 00241 101 - A A D D Vref D D D RA3 00242 11X - D D D D D D D D 00243 00244 00245 ;* 'AS 01.30.01 intermediate SONIC 1-20-1997 14:41:42 PAGE snim Face Sensor II - PIC16C73 Contro* Code iternal Register Equates OBJECT CODE LINE SOURCE TEXT VALUE 00246 ,....*.**♦****** ♦ ****** ♦♦« *********************************** 00247 SUBTITL 'PORT Equates' •ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 7 •nlm Face Sensor II - PIC16C73 Control -ode )RT Equates )C OBJECT CODE LINE SOURCE TEXT VALUE 00248 PAGE 00249 **************************** ********* ******************* ** 00250 ;* 00251 ;* PORT Equates 00252 ;* 00253 ;PortA equ 005H • Port A ooooooos 00254 BSW2 equ 5 Input - 0 - Switch 1 pressed 00000004 00255 BSW1 equ 4 ; Input - 0 - Switch 1 pressed 00000003 00256 BPA3 equ 3 ; A/D - Not Used 00000002 00257 BTEST equ 2 ; Input - 0/1 - Normal/Test Mode 00000001 00258 BPA1 equ 1 A/D - Sonic Analog Input 2 00000000 00259 BPA0 equ 0 ; A/D - Sonic Analog Input 1 0000003F 00260 TRISAC equ 03FH ; I/O Mask B4-0 - 00261 00262 ;PortB equ 06H .-Port B 00000007 00263 BFLGI equ 7 ; Output - Interrupt Flag 00000006 00264 BPB6 equ 6 ; Output - Not Used 00000005 00265 BPBS equ 5 ; Output - Not Used 00000004 00266 BPB4 equ 4 ,- Output - Not Used 00000008 00267 EDAT equ 008H ; In/Out - Data FromTo 24LC01B EEPROM 00000003 00268 BEDAT equ 3 00000004 00269 SSPL equ 004H ; Output - Serial Shift / Parallel Load 00000002 00270 BSSPL equ 2 00000002 00271 LED9 equ 002H ; Output - 0/1 - ON/OFF Bar Graph 9 LED 00000001 00272 BLED9 equ 1 00000001 00273 LED8 equ 001H Output - 0/1 - ON/OFF Bar Graph 8 LED 00000000 00274 BLED8 equ 0 00000008 00275 TRISBCI equ 008H ; I/O Mask B7-B0 - 00001000 00000000 00276 TRISBCO equ 000H ; I/O Mask B7-B0 •= 00000000 00277 00278 ; ortC equ 07 .-Port C 00000080 00279 RX equ 080H ,- Input - RS232 Receive 00000007 00280 BRX equ 7 00000040 00281 TX equ 040H Output - RS23 2 Transmit 00000006 00282 BTX equ 6 00000020 00283 SOUT equ 020H ; Output - Serial Data OUT 00000005 00284 BSOUT equ 5 00000010 00285 SIN equ 010H ,- Input - Serial Data IN 00000004 00286 BSIN equ 4 00000008 00287 SCLK equ 008H ; Output - Serial Clock 00000003 00288 BSCL equ 3 00000004 00289 PWM1 equ 004H ; Output - PWM1 - Sonic 1 Analog Output 00000002 00290 BPWM1 equ 2 00000002 00291 PWM2 equ 002H ; O utput - PWM2 - Sonic 2 Analog Output 00000001 00292 BPWM2 equ 1 00000001 00293 LCLK equ 001H ; Output - Load Clock 00000000 00294 BLCLK equ 0 00000090 00295 TRISCC equ 090H ; I/O Mask B7-B0 - lOOIOOOO 00296 00297 ;* 00298 . *************** * * ** * * * ** 00299 SUBTITL 'Internal RAM Register Equates' ASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 8 nlm Face Sensor II - PIC16C73 Contro l Code .ternal RAM Register Equates C OBJEC T CODE LINE SOURCE TEXT VALUE 00300 PAGE 00301 ************ ** * *********** **************** * * ***** »« * « **** ** 00302 00303 ; * Internal RAM Registers 00304 ;* 00000020 00305 Temp equ 020H ;Delay Register 00000021 00306 Tempi equ 021H .•Delay Register 00307 00000022 00308 Stat equ 022H System Status 00000080 00309 TmrlOF equ 080H 1 - 10 ms Timer occured 00000007 00310 BTmrlOF equ 7 00000040 00311 BlnkF equ 040H 0/1 - Display On/Blank 00000006 00312 BBlnkF equ 6 tatus 00000020 00313 StLED9 equ 020H 0/1 - LED9 S 00000005 00314 BStLED9 equ 5 Status OOO00010 00315 StLEDβ equ 010H 0/1 - LED8 00000004 00316 BStLEDβ equ 4 00000008 00317 SW12 equ 008H 0/1 - SW1/SW2 Last Pressed 00000003 00318 BSW12 equ 3 00319 00000023 00320 CStat equ 023H ;Calibration Status 00000080 00321 CSclb equ 080H < • 0/1 - Normal/Calibrating Mode 00000007 00322 BCSclb equ 7 00000040 00323 CSclbC equ 040H ; 0/1 - Calibrating/Calibration-Complete 00000006 00324 BCSclbC equ 6 00000007 00325 CSdly equ 007H Calibration Sub Delay 00000004 00326 CSdlyC equ 004H i Calibration Sub Delay Max 00327 00000024 00328 BlkTmr equ 024H ; Blink Timer eset 00000032 00329 BlkT rC equ 50 ; 0.5 sec R 00330 00000025 00331 T rlOms equ 025H ;10 MSec Counter 00332 00000026 00333 SApat equ 026H ; Switch Array Pattern 00000007 00334 BSAbcdO equ 7 ; 0 - BCD SW bit 0 00000006 00335 BSAbcdl equ 6 ; 0 - BCD SW bit 1 OO0OO00S 00336 BSAbcd2 equ S ; 0 - BCD SW bit 2 00000004 00337 BSAbcd3 equ 4 ; 0 - BCD SW bit 3 ; 0 - DIP 00000003 00338 BSAdipO equ 3 SW bit 0 00000002 00339 BSAdipl equ 2 ; 0 - DIP SW bit 1 bit 2 00000001 00340 BSAdipΣ equ 1 ; 0 - DIP SW 00000000 00341 BSAdip3 equ 0 ; 0 - DIP SW bit 3 00342 00000027 00343 SApatSV equ 027H ; Switch Array Pattern -9) 00000028 00344 SAbcd equ 028H ; Converted BCD (0 0034S 00000029 00346 INpat equ 029H ; Input Pattern 00000020 00347 INbnd2 equ 020H ; 0 - End of Bundle 2 00000005 00348 BINbnd2 equ 5 - Material present 2 00000010 00349 INmtr2 equ 010H ; 0 00000004 00350 BINmtr2 equ 4 00000002 00351 INbndl equ 002H ; 0 - End of Bundle 1 00000001 00352 BINbndl equ 1 ».SM 01.30.01 Intermediate SONIC. 1-20-199 7 14:41:42 PAGE nim F ace S ensor II - PIC16C73 Control Code t ernal RAM Register Equates C OBJECT CODE LINE SOURCE TEXT VALUE i 00000001 00353 INmtrl equ 001H 0 - Material present 1 00000000 00354 BINmtrl equ 0 00355 0000002A 00356 INpatSV equ 02AH ; Input Pattern 00357 0000002B 00358 LEDpat equ 02BH ;LED Pattern 00359 0000002C 00360 OUTpat equ 02CH Output Pattern 00000004 00361 BFace2 equ 4 0/1 - Rough/Smooth - Face 2 e 1 00000000 00362 BFacel equ 0 0/1 - Rough/Smooth - Fac 00363 0000002D 00364 VCntrlT equ 02DH ;Control Voltage Temp 0000002E 00365 VCntrlL equ 02EH ,-Control Voltage Last 00366 00367 ;* Sonic 1 Par s 00000030 00368 VSonicl equ 030H ;Sonic 1 Voltage Read 1 Voltage Sent 00000031 00369 VCntrll equ 031H / Control ;Material 1 Count 00000032 00370 Mcntl equ 032H 00000033 00371 Msuml equ 033H ;Material 1 Sum (2 Byte ) Ave (2 Byte ) 00000035 00372 Mavel equ 035H .-Material 1 00000037 00373 MavelSV equ 037H / Material 1 Ave Saved 00000038 00374 Bcntl equ 038H / Bundle 1 Count 00000039 00375 Bavel equ 039H / Bundle 1 Ave 0000003A 00376 Bsuml equ 03AH / Bundle 1 Sum (2 Byte ) 0000003C 00377 MBarGrl equ 03CH / Material 1 Bar Graph Value ay 0000003D 00378 MLEdlyl equ 03DH / Material 1 Leading Edge Del 00379 00380 ;* Sonic 2 Parms 00000040 00381 VSonic2 equ 040H / Sonic 2 Voltage Read 00000041 00382 VCntrl2 equ 041H / Control 2 Voltage Sent 00000042 00383 Mcnt2 equ 042H Material 2 Count 00000043 00384 Msum2 equ 043H / Material 2 Sum (2 Byte ) (2 Byte ) 00000045 00385 Mave2 equ 045H / Material 2 Ave 00000047 00386 Mave2SV equ 047H / Material 1 Ave Saved 00000048 00387 Bcnt2 equ 048H / Bundle 2 Count 00000049 00388 Bave2 equ 049H / Bundle 2 Ave 0000004A 00389 Bsum2 equ 04AH / Bundle 2 Sum (2 Byte ) 0000004C 00390 MBarGr2 equ 04CH / Material 2 Bar Graph Value / Material 1 Leading Edge Delay 0000004D 00391 MLEdly2 equ 04DH 00392 / Math Parms (5 Bytes ) 00000050 00393 MPARM equ 050H 00394 zComm Transmit Buffer 00000055 00395 CMTstat equ 0S5H 00396 O00000SE 00397 S_TEMP equ 05EH / Restore STATUS W 0000005F 00398 W_TEMP equ 05FH / Restore 00399 Z Comm Buffer (16 Bytes ) 00000060 00400 CMTbuf equ 060H 00401 00402 ;* 00403 ;* Constants 00404 * 0000007D 00405 TMRC equ 125 / 0.5 ms Timer Reset (4 MHz XTAL ) ASM 01.30.01 interme d iate SONIC. 1-20-1997 14:41:42 PAGE 10 nim Face Sensor II - PIC16C73 Control Code ternal RAM Register Equates C OBJECT CODE LINE SOURCE TEXT VALUE 00000014 00406 TmrlOC equ 20 /Reset for 10 ms Timeout 00407 ,-VSonicC equ 128 ,-2.5 VDC 00000066 00408 VSonicC equ 102 /2.0 VDC 00409 00410 /* 00411 .A**************************************************************** 00412 SUBTITL 'Start of Code' 'ASM 01 30.01 intermediate SONIC. 1-20-1997 14:41:42 PAGE 11 -nim Face Sensor II - PIC16C73 Control Code tart of Code 3C OBJECT CODE LINE SOURCE TEXT VALUE 0 000441133 P PAAGGEE *«********* ♦ **************** 0 000441144 / . ************ *** * ***** .«*.*..*. 0 000441155 / . * 0 000441166 org 0 0 00000 2 . B7_1. ™ 0n0n!4-1ιt7-;i I T T HN H TI„TT " grron?tt-on„ MM H AA Λ IIX N N N ; /-JMP T ™O r ^MAIN βEtupt „ anαle r >0 -0-4 n, nn-tlfi orα * * ' 0 000441290 ;/************************************************************ 00421 SUBTITL 'INT - Interrupt Handler' PASf! 01.30.01 Intermediate SONIC 1 1-20-1997 14:41:42 AGE ι; enim Face Sensor II - PIC16C73 Control Code NT - Interrupt Handler ΛC OBJECT CODE LINE SOURCE TEXT VALUE 00422 PAGE 00423 /*********************************************************** 00424 /* 00425 /* Procedure: INT - Interrupt Handler 00426 /* 00427 /* Purpose: Process Port B and Timer Interrupts 00428 /* 00429 /* Algorithm: 00430 /* RETURN 00431 /* 00432 ************************************************************ 0004 00DF 00433 INT movwf W TEMP /Save W 0005 OE03 00434 swapf STATUS, /Save STATUS 000600DE 00435 movwf S_TEMP 00436 0007 1386 00437 bcf PortB.BFLGI /Turn Int Flag ON 00438 0008 3079 00439 ovlw TMRC-4 /Update TMRO for Next Loop 00090201 00440 subwf TMR0,W OOOλ 0081 00441 movwf TMRO O00B HOB 00442 bcf INTCON,T0IF /Clear Timer 0 Interrupt 00443 000C 201E 00444 call GETAD /Get Next A/D Message[305] : Using default destination of 1 (file) . O00D 0BA5 00445 decfsz TmrlOms /Dec 10 ms Timer OOOE 2818 00446 goto INT1 000F 3014 00447 movlw TmrlOC /Reset for next 10 ms Timeout 0010 00A5 00448 movwf TmrlOms 0011 17A2 00449 bsf Stat,BTmrl0F /Set 10ms Timer Flag Message(305) . Using default destination of 1 (file) . 00120BA4 00450 decfsz BlkTmr /Dec Blink Timer 00132818 • 00451 goto INT1 0014 3032 00452 movlw BlkTmrC /Reset for Blink Cycle 0015 00A4 00453 movwf BlkTmr 00163040 00454 movlw BlnkF /Toggle Display Blink Flag Message(305] Using default destination of 1 (file) . 001706A2 00455 xorwf Stat 00456 0018 1786 00457 INT1 bsf PortB.BFLGI /Turn Int Flag OFF 00458 00190E5E 00459 swapf S__TEMP,W /Restore STATUS 001A 0083 00460 movwf STATUS Message(305] : Using default destination of 1 (file) . 001B OEDF 00461 swapf W TEMP / Restore W 001C OE5F 00462 swapf W TEMP.W 001D 0009 00463 retfie 00464 /* 00465 ************************************************************ 00466 SUBTITL 'GETAD - Get A/D values' PASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 13 enim Face Sensor II - PIC16C73 Control Code ETAD - Get A/D values OC OBJECT CODE LINE SOURCE TEXT VALUE 00467 PAGE 00468 ; *********************************************************** 00469 . * 00470 ; * Procedure: GETAD - Get A/D values 00471 , * 00472 , * Purpose: Get the Sonic A/D values. 00473 , * 00474 . * Algorithm: 00475 * IF A/D complete THEN 00476 * IF Channel 0 THEN 00477 '* VSonic2 - ADRES 00478 * Restart A/D for Channel 1 00479 * ELSE 00480 * VSonicl - ADRES 00481 * Restart A/D for Channel 0 00482 * ENDIF 00483 * endif 00484 * RETURN 0048S * 00486 ************* *** *** * *** * ******* * * * *** * * * **** * ***** * ***** * * * 001E 191F 00487 GETAD btfsc ADCONO.GODONE / Skip if A/D complete 001F 282D 00488 goto GETAD3 / Exit 00489 0020 199F 00490 btfsc ADCON0.CHS0 / Skip if Channel 0021 2827 00491 goto GETAD1 / Process Channel 00492 00493 Process channel 0 0022081E 00494 movf ADRES,W / VSonicl - VSonicl + ADRES Message(305) Using default destination of 1 ( ile) . 0023 07B0 00495 addwf VSonicl Messaget305] Using default destination of 1 (file) . 0024 0CB0 00496 rrf VSonicl 0025 30C9 00497 movlw 0C9H / Select Channel 1 0026282B 00498 goto GEAD2 00499 00500 Process Channel 1 002708IE 00501 GETAD1 movf ADRES, / VSonic2 - VSonic2 + ADRES Message1305) Using default destination of 1 (file) . 002807C0 00502 addwf VSonic2 Message(305) Using default destination of 1 (file) . 0029 0CC0 00503 rrf VSonic2 002A 30C1 00504 movlw 0C1H / Select Channel 0 00505 002B 009F 00506 GETAD2 movwf ADCON0 / Select Channel 002C 151F 00507 bsf ADCONO.GODONE / Start conversion 00S08 002D 141F 00509 GETAD3 bsf ADCON0.ADON / Make sure the A/D is ON 002E 0008 00510 return 00511 /* 00512 ***** * ****************************************************** 00513 SUBTITL 'GLEDPAT - Convert Value to LED Bar Graph Pattern' 'ASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 14 ;nim Face Sensor II - PIC16C73 Control Code -EDPAT - Convert Value to LED Bar Graph Pattern X OBJECT CODE LINE SOURCE TEXT VALUE 00514 PAGE 00515 / *********************************************************** 00516 /* 00517 /* PROCEDURE: GLEDPAT - Convert Value to LED Bar Graph Pattern 00518 /* 00519 /* INPUT: W - Value to Convert 00520 /* 00521 ;* OUTPUT: LEDpat.StLEDβ, StLED9 00522 /* 00523 /* ALGORITHM: 00524 /* RETURN 00S25 /* 00526 ************************************************************ 002F 00A0 00527 GLEDPAT movwf Temp /Temp - Value to Convert 003016A2 00528 bsf Stat,BStLED9 zlnit LED Patterns 0031 1622 00S29 bsf Stat,BStLEDβ 003230FF 00530 movlw 0FFH 0033 00AB 00531 movwf LEDpat Message.305]: Using default destination of 1 (file) . 003408A0 00532 movf Temp /Test Input 0035 1903 00533 btfsc STATUS, Z /Skip if <> 0 00362845 00534 goto GLEDP3 Message[30S] : Using default destination of 1 (file) . 0037 03AB 00535 decf LEDpat 00536 00383019 00537 GLEDP movlw 25 /Temp — Temp - 25 Message(305) : Using default destination of 1 (file) . 0039 02A0 00538 subwf Temp 003A 1C03 00539 btfss STATUS,C /Skip if Temp >- 0 003B 2845 00540 goto GLEDP3 003C 1003 00541 bcf STATUS,C /Shift Pattern Left Message1305) : : Using default destination of 1 (file) . 003D 0DAB 00542 rlf LEDpat 003E 1803 00543 btfsc STATUS,C /Skip if Carry - 0 003F 2843 00544 goto GLEDP1 00401E22 00545 btfss Stat,BStLEDβ /Skip if StLEDβ - 1 00412844 00546 goto GLEDP2 00421222 00547 bcf Stat,BStLED8 zStLEDβ - 0 00432838 00548 GLEDP1 goto GLEDP 00549 0044 12A2 00550 GLEDP2 bcf Stat,BStLED9 /StLED9 - 0 00450008 00551 GLEDP3 return 00552 00553 /* 00554 ************************************************************ 00555 SUBTITL 'GSMPPAT - Convert Value to Bar Graph Pattern' ASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 15 nim Face Sensor II - PIC16C73 Control v-ode MPPAT - Convert alue to Bar Graph Pattern •C OBJECT CODE LINE SOURCE TEXT VALUE 00556 PAGE 00557 ************************************************************ 00558 '** 00559 /* PROCEDURE: GSMPPAT - Convert Value to Bar Graph Pattern 00560 /* 00561 ;* INPUT: W - Value to Convert 00562 /* 00563 /* ALGORITHM: 00564 /* RETURN 00565 /* 00566 ************************************************************ 046 < 00A0 00567 GSMPPAT mmoovvwwff Temp /Temp - Value to Convert 047 1622 00568 bsf Stat.BStLEDβ /Init LED Patterns •048 16A2 00569 bsf Stat,BStLED9 )049 30CF 00570 movlw 0CFH (04A 00AB 00571 movwf LEDpat )04B 0A20 00572 incf Temp.W /Test Temp for End of Bundle )04C 1903 00573 btfsc STATUS. Z /Skip if <> EOB -04D 2866 00S74 goto GSMPP5 304E 30FE 00575 movlw 0FEH 004F 00AB 00S76 movwf LEDpat 00S77 0050 3019 00578 GSMPP movlw 25 /Temp - Temp - 25 Message(305) Using default destination of 1 (file) . 0051 02A0 00579 subwf Temp 0052 1C03 00580 btfss STATUS, C /Skip if Temp >"- 0 0053 285E 00581 goto GSMPP3 0054 1E22 00582 btfss Stat,BStLED8 /Skip if LED8 - 1 0055 285C 00583 goto GSMPP2 0056 1403 00584 bsf STATUS,C /Shift Pattern Left Message(305) Using default destination of 1 (file) . 0057 0DAB 00585 rlf LEDpat 00S8 1803 00586 btfsc STATUS,C /Skip if Carry - 0 0059 285B 00587 goto GSMPP1 005A 1222 00588 bcf Stat.BStLEDβ ZLED8 - 0 00SB 2850 00589 GSMPP1 goto GSMPP 005C 1622 00590 GSMPP2 bsf Stat.BStLEDβ 005D 12A2 00591 bcf Stat,BStLED9 00592 00SE 082B 00593 GSMPP3 movf LEDpat, /Test LEDpat 005F 37-FF 00594 xorlw 0FFH 0060 391F 00595 andlw 01FH 0061 1D03 00596 btfss STATUS. Z /Skip if Smooth 0062 2865 00597 goto GSMPP4 0063i 12A2 00598 bcf Stat,BStLED9 /Turn Smooth Bit ON 0064 , 2866 00S99 goto GSMPPS 006S . 102B 00600 GSMPP4 bcf LEDpat,0 / Turn Rough Bit ON 00660008 00601 GSMPP5 return 00602 00603 /* 00604 ;*****« ************ 00605 SUBTITL 'CNVBCDV - Convert Value to BCD Voltage' •ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 16 •nim Face Sensor II - PIC16C73 Control Oode IVBCDV - Convert Value to BCD Voltage K. OBJECT CODE LINE SOURCE TEXT VALUE 00606 PAGE 00607 ************************************************************ 00608 /* 00609 /* PROCEDURE: CNVBCDV - Convert W to BCD Voltage 00610 /* 00611 /* INPUT: W Value to Convert 00612 /* 00613 /* OUTPUT: CMTbufO.1,2 W*5/256*100 (BCD Result) 00614 z* CMTbufO.1,2 W*250/128 (BCD Result) 00615 /* 00616 /* ALGORITHM: 00617 /* RETURN 00618 /* 00619 / *****«***< ************************************ 3067 OODO 00620 CNVBCDV movwf MPARM / MPARM - W * 250 0068 30FA 00621 movlw 250 006900D1 00622 movwf MPARM+1 006A 2223 00623 call MUL Message(305] : Using default destination of 1 ( ile) . 006B 0DD1 00624 rlf MPARM+1 / MPARM - MPARM / 128 006C 0D50 00625 rlf MPARM,W 006D 00D1 00626 movwf MPARM+1 006E 01D0 00627 clrf MPARM Message(305) : Using default destination of 1 (file) . 006F 0DD0 00628 rlf MPARM 00629 0070 3030 00630 movlw *0' zlnit 0071 00E0 00631 movwf CMTbuf 0072 00E2 00632 movwf CMTbuf+2 007300E3 00633 movwf CMTbuf+3 0074 302E 00634 movlw ' . ' 007500E1 00635 movwf CMTbuf+1 00636 0076 3064 00637 CBCDV1 movlw 100 / MPARM - MPARM 100 Message [305] : Using default destination of 1 (file) . 007702D1 00638 CBCDV11 subwf MPARM+1 0078 1C03 00639 btfss STATUS,C Message[305] : Using default destination of 1 (file) . 007903D0 00640 decf MPARM 007A 1BD0 00641 btfsc MPARM,7 /Skip if MPARM >- 0 007B 287E 00642 goto CBCDV2 Message(305] Using default destination of 1 (file) . 007C OAEO 00643 incf CMTbuf zinc 100's Digit 007D 2877 00644 goto CBCDV11 00645 ,* 00646 zTest this conversion routine! ! 00647 / 00648 007E 3064 00649 CBCDV2 movlw 100 / MPARM - MPARM + 100 Message1305] : Using default destination of 1 (file) . 007F 07D1 00650 addwf MPARM+1 0080 300A 00651 CBCDV21 movlw 10 /MPARM - MPARM 10 Message(305] : Using default destination of 1 (file) . PAGE 17 4 PASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 D enim Face Sensor II - PIC16C73 Control Code -NVBCD V _ convert Value to BCD Voltage LOC OBJECT CODE LINE SOURCE TEXT VALUE 0081 02D1 00652 subwf MPARM+1 00653 btfss STATUS,C / Skip if MPARM >- 0 0082 1C03 0083 2886 00654 goto CBCDV3 Message [305] : Using default destination of 1 (file) . 0084 0AE2 00655 i'ncf" CMT.bu--f-+..2. zinc 10 's Digit 0085 2880 00656 goto CBCDV21 00657 + 10 0086 300A 00658 CBCDV3 movlw 10 / CMbuf+3 MPARM 0087 0751 00659 addwf MPARM+l.W Message (305) Using default destination of 1 ( file ) 0088 07E3 00660 addwf CMTbuf+3 00661 / Return to caller 0089 0008 00662 return 00663 ********* «- 00664 . ******* * ******* * * * ********* - * - * . * -***** *** * * * * * * * ******** ****** 00665 SUBTITL •LEDIO - Update LEDs if Display I/O Selected* E If 1PASM 01. 30. T1 Intermediate SONIC . 1 -20-1997 14:41:42 PAG >enim Face Sensor I I - PIC16C73 Control Code -.EDIO - Update LEDs if Display I/O Selected OC OBJECT CODE L INE SOURC "E -T-E"X-T VALUE 00666 PAGE 00667 / ******************************* ** * ************ * * ************ * Mrø f* PROCEDU RE : LEDIO - Update LEDs if Display I/O Selected 00670 z* 00671 z* ALGORITHM: 00672 / * RETURN 00673 . * 00674 . ********** * ******* * **** * ** * **** * **** * **** ****************** Stat.BStLEDβ zlnit LED Patterns 008A 1622 00675 LEDIO bsf 008B 16A2 00676 bsf Stat,BStLED9 008C 30FF 00677 movlw 0FFH 008D 00AB 00678 movwf LEDpat 00679 00680 00681 Display Running Graph Patterns 00682 008E 0828 00683 LEDIOl movf SAbcd.W / Test SW BCD .-Skip if Display Running Graph Mode 008F 1D03 00684 btfss STATUS, Z 00902896 00685 goto LEDIOll 0091083C 00686 movf MBarGrl.W / Get Material Bar Graph 1? 0092 19A2 00687 btfsc Stat,BSW12 / Skip if SW1 Last Pressed / Get Material Bar Graph 2 00688 movf M B arGr2,W Bar Graph 1 0093083C 00689 movf MBarGrl.W / Get Material / Convert to Material Bar Graph Pattern 0094 2046 00690 call GSMPPAT 0095 2917 00691 goto LEDIOX 00692 00693 00694 Display Vsonic? 00695 00960828 00696 LEDIOll movf SAbcd.W / Test SW BCD 0097 3A01 00697 xorlw 001H / Skip if Display I/O Mode 0098 1D03 00698 btfss STATUS, Z 0099289F 00699 goto LEDI02 ovf VSonicl, / Display Vsonicl? 009A 0830 00700 m btfsc Stat,BSW12 / Skip if SW1 Last Pressed 009B 19A2 00701 / Display Vsonic2 009C 0840 00702 movf VSonic2,W 009D 202F 00703 call GLEDPAT 009E 2917 00704 goto LEDIOX 00705 00706 00707 z* Display I/O Patterns 00708 z* 009F 0828 00709 LEDI02 movf SAbcd,W / Test SW BCD 00A0 3A02 00710 xorlw 002H / Skip if Display I/O Mode 00A1 1D03 00711 btfss STATUS, Z 00A2 28C7 00712 goto LEDI03 00A3 19A2 00713 btfsc Stat,BSW12 / Skip if SW1 Last Pressed 00A4 28B6 00714 goto LEDI021 00A5 1C29 00715 btfss INpat.O / Skip if INpat (0) - 1 00A613AB 00716 bcf LEDpat, 7 / Turn ON LEDpat (7) LED 00A7 1CA9 00717 btfss INpat, 1 / Skip if INpat(l) - 1 00A8 132B 00718 bcf LEDpat, 6 / Turn ON LEDpat (6) LED 41:42 PAGE 19 •4PASM 01.30.01 Intermediate SONIC < 1-20 14: O enim F ace S ensor II - P IC16C73 Control C o d e LE D IO - Up d ate L ED s if Display I/O Selecte d LOC OBJECT CODE LINE SOURCE TEX T VALUE /Skip if INpat (2) - 1 00A9 1D29 00719 btfss INpat, 2 / Turn ON LEDpat (5) LED 00AA 12AB 00720 bcf LEDpat, 5 /Skip if INpat (3) - 1 00AB 1DA9 00721 btfss INpat, 3 / Turn ON LEDpat (4) LED 00AC 122B 00722 bcf LEDpat, /Skip if OUTpat (0) - 0 OOAD 182C 00723 btfsc OUTpat,0 / Turn ON LEDpat(3) LED 00AE 11AB 00724 bcf LEDpat, 3 / Skip if OUTpat (1) - 0 OOAF 18AC 00725 btfsc OUTpat.l bcf LEDpat, 2 / Turn ON LEDpat(2) LED OOBO 112B 00726 /Skip if OUTpat (2) - 0 00B1 192C 00727 btfsc OUTpat, 2 / Turn ON LEDpat (1) LED 00B2 10AB 00728 bcf LEDpat, 1 /Skip if OUTpat (3) - 0 00B3 19AC 00729 btfsc OUTpat, 3 / Turn ON LEDpat (0) LED 00B4 102B 00730 bcf LEDpat, 0 00B5 2917 00731 goto LEDIOX btfss INpat, 4 /Skip if INpat (4) 00B6 1E29 00732 LEDI021 / Turn ON LEDpat (7) LED 00B7 13AB 00733 bcf LLEEDDppaatt,, 7/ /Skip if INpat (5) 00B8 1EA9 00734 btfss IINNppaatt,, 55 EDDppaatt,, / Turn ON LEDpat (6) LED 00B9 132B 00735 bcf LLE OOBA 1F29 00736 btfss IINNppaatt,, 66 / Skip if INpat(6) » - 1 LEDpat, 5 / Turn ON LEDpat (5) LED OOBB 12AB 00737 b cf LEDpat, 5 OOBC 1FA9 00738 btfss IINNppaatt,, 77 /Skip if INpat (7) - - 1 LEDpat, 4 / Turn ON LEDpat(4) LED OOBD 122B 00739 bcf LEDpat, 4 OUTpat, 4 /Skip if OUTpat (4) - 0 OOBE 1A2C 00740 btfsc OUTpat,4 OOBF 11AB 00741 bcf LLEEDDppaatt,, 33 / Turn ON LEDpat(3) LED OUTpat, 5 /Skip if OUTpat (5) - 0 00C0 1AAC 00742 btfsc OUTpat, 5 D 00C1112B 00743 bcf LLEEDDppaatt,, 22 / Turn ON LEDpat (2) LE OUTpat, 6 /Skip if OUTpat (6) - 0 O0C2 1B2C 00744 btfsc OUTpat, € LEDpat, 1 / Turn ON LEDpat(1) LED O0C3 10AB 00745 bcf LEDpat, - 00C4 lBAC 00746 btfsc OOUUTTppaatt.,17 / Skip if OUTpat (7) - 0 LEDpat, 0 / Turn ON LEDpat (0) LED 00C5 102B 00747 bcf LEDpat, ( 00748 goto LLEEDDIIO 00C62917 OXX 00749 00750 . * 00751 z* D Diissppllaayy MMaavveeSSVV?? 00752 . * / Test SW BCD 00C7 0828 00753 LEDI03 movf SAbcd.W O0C8 3A03 n 0m07*5;-4 xxoorrllww O O0033HH / Skip if Display MaveSV Mode 00C9 1D03 00755 btfss STATUS, Z LEDI04 OOCA 28CF 00756 goto movf lSV.W / Display Material Ave 1 OOCB 0837 00757 Mave / Skip if SW1 Last Pressed OOCC 19A2 00758 btfsc Stat,BSW12 z Display Material Ave 2 OOCD 0847 00759 movf Mave2SV,W OOCE 28E6 00760 goto LEDI061 00761 00762 z* 00763 zz** DDiissipsllaayy BBaavviee?? 00764 ,-* OOCF 0828 00765 LEDI04 movf SAbcd.W .-Test SW BCD 00D0 3A04 00766 xorlw 004H .-Skip if Display Bave Mode 00D1 1D03 00767 btfss STATUS, Z 00D2 28D7 00768 goto LEDI05 / Display Bundle 1 Ave 00D3 0839 00769 movf Bavel.W .-Skip if SW1 Last Pressed 00D4 19A2 00770 btfsc Stat,BSW12 z Display Bundle 2 Ave OODS 0849 00771 movf Bave2,W PASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 20 • enim Face Sensor I I - PIC16C73 Contro-. Code .EDIO - U pdate L E Ds if Display I/O Selected OC OBJECT CODE LINE SOURCE TEXT VALUE )0D628E6 00772 goto LEDI061 00773 00774 00775 / * Display Bent? 00776 .« .-Test SW BCD D0D7 0828 00777 LEDI05 movf SAbcd.W 0OD8 3A05 00778 xorlw 005H .-Skip if Display Bent Mode 00D9 1D03 00779 btfss STATUS, Z 00DA 28DF 00780 goto LEDI06 z D isplay Bundle 1 Count 00DB 0838 00781 movf Bcntl.W / Skip if SW1 Last Pressed OODC 19A2 00782 btfsc Stat,BSW12 / Display Bundle 2 Count 00DD 0848 00783 movf Bcnt2,W OODE 28E6 00784 goto LEDI061 00785 00786 00787 Display VCntrll? 00788 . / Test SW BCD OODF 0828 00789 LEDI06 movf SAbcd.W O0E0 3A06 00790 xorlw 006H STATUS, Z / Skip if Display VCntrll Mode 00E1 1D03 00791 btfss 00792 goto LEDI07 00E228E9 VCntrll,W / Display Control 1 Voltage 00E3 0831 00793 movf Stat,BSW12 / Skip if SW1 Last Pressed 00E4 19A2 00794 btfsc VCntrl2,W / Display Control 2 Voltage O0E5 0841 00795 movf OFFH / Display Binary Value 00E63AFF 00796 LEDI061 xorlw 97 movwf LEDpat 00E7 OOAB 007 00798 goto LEDIOX O0E8 2917 00799 00800 00801 D isplay Sonic 1 Calibrate/Test 00802 z* 00E9 0828 00803 LEDI07 movf SAbcd.W / Test SW BCD OOEA 3A08 00804 xorlw 008H OOEB 1D03 00805 btfss STATUS, Z / Skip if Display Sonic 1 Mode OOEC 2900 00806 goto LEDI08 if <> Calibration OOED 1BA3 00807 btfsc CStat,BCSclb / Skip OOEE 28F2 00808 goto LEDI071 OOEF 083C 00809 movf MBarGrl.W / Get Material Bar Graph 1 00F02046 00810 call GSMPPAT / Convert to Material Bar Graph Pattern 00F12917 00811 goto LEDIOX O0F2082D 00812 LEDI071 movf VCntrlT.W / Get Calibrate Voltage O0F3202F 00813 call GLEDPAT O0F4 1F23 00814 btfss CStat.BCSclbC / Skip if Calibration Complete 00F52917 00815 goto LEDIOX 00F60831 00816 movf VCntrll,W / Get Calibrate Voltage 00F7 202F 00817 call GLEDPAT 00F8082D 00818 movf VCnt lT,W / Test Calibrate Voltage / Skip if ERROR 00F9 1D03 00819 btfss STATUS, Z OOFA 2917 00820 goto LEDIOX OOFB 3000 00821 movlw 0 /B link LED Bar Graph OFF? OOFC 1F22 00822 btfss S tat.BBlnkF / Skip if BlnkF - 1 OOFD 30FF 00823 movlw OFFH / Blink LED Bar Graph ON OOFE 202F 00624 call GLEDPAT 1PASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 21 Jenim Face Sensor II - PIC16C73 Control Code '-EDIO - Update LEDs if Display I/O Selected IΛC OBJECT CODE LINE SOURCE TEXT VALUE 00FF 2917 00825 goto LEDIOX 00826 zkai 00827 00828 00829 Display Sonic 2 Calibrate/Test 00830 01000828 00831 LEDI08 movf SAbcd.W /Test SW BCD 0101 3A09 00832 xorlw 009H 0102 1D03 00833 btfss STATUS, Z / Skip if Display Sonic 2 Mode 0103 2917 00834 goto LEDIOX 0104 1BA3 00835 btfsc CStat.BCSclb / Skip if <> Calibration 01052909 00836 goto LEDIOβl 0106084C 00837 movf MBarGr2,W /Get Material Bar Graph 2 01072046 00838 call GSMPPAT / Convert to Material Bar Graph Pattern 01082917 00839 goto LEDIOX 0109082D 00840 LEDI081 movf VCntrlT,W /Get Calibrate Voltage 010A 202F 00841 call GLEDPAT 010B 1F23 00842 btfss CStat.BCSclbC /Skip if Calibration Complete 010C 2917 00843 goto LEDIOX 010D 0841 00844 movf VCntrl2,W /Get Calibrate Voltage 010E 202F 0084S call GLEDPAT 010F 082D 00846 movf VCntrlT.W /Test Calibrate Voltage 01101D03 00847 btfss STATUS, Z /Skip if ERROR 0111 2917 00848 goto LEDIOX 01123000 00849 movlw 0 / Blink LED Bar Graph OFF? 0113 1F22 00850 btfss Stat.BBlnkF /Skip if BlnkF - 1 0114 30FF 00851 movlw OFFH / Blink LED Bar Graph ON 0115 202F 008S2 call GLEDPAT 01162917 00853 goto LEDIOX 00854 0117 0008 00855 LEDIOX return /Return to Caller 00856 00857 /* 00858 ************************************************************ 00859 SUBTITL 'SNDOUT - Send Output Patterns' "ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 22 -nim Face Sensor II - PIC16C73 Control Code ΛDOUT - Send Output Patterns OC OBJECT CODE LINE SOURCE TEXT VALUE 00860 PAGE 00861 ********** ******************************** ************* 00862 00863 PROCEDURE: SNDOUT - Send output Patterns 00864 00865 ALGORITHM: 00866 RETURN 00867 /« 00868 / ***** ********************* ******************************* Jllβ 1007 00869 SNDOUT bcf PortC, BLCLK ZLCLK - 0 3119 1187 00870 bcf PortC,BSCLK ZSCLK - 0 00871 00872 Send Output Pattern 011A 082C 00873 movf OUTpat,W zLoad Output Pattern 011B 00A1 00874 movwf Tempi OHC 3008 •O0875 movlw 08H /Shift 8 bits 011D 00A0 00876 movwf Temp 00877 Message(305] : Using default destination of 1 (file) 011E 0DA1 00878 SNDOUT1 rlf Tempi /Rotate Pattern Left OUF 1803 00879 btfsc STATUS,C /Skip if Carry - 0 01202923 00880 goto SNDOUT2 0121 1287 00881 bcf PortC, BSOUT zSOUT - 0 01222924 00882 goto SNDOUT3 0123 1687 00883 SNDOUT2 bsf PortC, BSOUT ,-SOUT - 1 0124 1587 00884 SNDOUT3 bsf PortC, BSCLK ,-SCLK - 1 0125 1187 00885 bcf PortC, BSCLK ZSCLK - 0 Message[305] Using default destination of 1 ( ile) . 0126 OBAO 00886 decfsz Temp .•Dec and Skip if - 0 0127 291E 00887 goto SNDOUT1 00888 00889 Send LED Pattern 0128082B 00890 movf LEDpat,w /Load LED Pattern 0129 00A1 00891 movwf Tempi 012A 3008 00892 movlw 08H /Shift 8 bits 012B 00A0 00893 movwf Temp 00894 Message(305] : Using default destination of 1 (file) . 012C 0DA1 O0895 SNDOUT4 rlf Tempi /Rotate Pattern Left 012D 1803 00896 btfsc STATUS,C /Skip if Carry - 0 012E 2931 00897 goto SNDOUTS 012F 1287 00898 bcf PortC,BSOUT zSOUT - 0 0130 2932 00899 goto SNDOUT6 0131 1687 00900 SNDOUTS bsf PortC,BSOUT /SOOT - 1 01321587 00901 SNDOUT6 bsf PortC,BSCLK ZSCLK - 1 0133 1187 00902 bcf PortC, BSCLK ZSCLK - 0 Message[305] Using default destination of 1 (file) . 0134 OBAO 00903 decfsz Temp /Dec and Skip if - 0 0135 292C 00904 goto SNDOUT4 00905 01361407 00906 bsf PortC,BLCLK zLCLK - 1 (Latch in Pattern) 0137 1007 00907 bcf PortC, BLCLK zLCLK - 0 0138 1287 00908 bcf PortC, BSOUT SOUT « 0 ΦASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 23 enlm Face Sensor II - PIC16C73 Control Code ;NDOUT - Send Output Patterns ΛC OBJECT CODE LINE SOURCE TEXT VALUE 00909 31391E22 00910 btfss Stat.BStLEDβ /Set/Reset LED8 313A 293D 00911 goto SND0UT7 313B 1406 00912 bsf PortB, BLEDβ 013C 293E 00913 goto SND0UT8 013D 1006 00914 SNDOUT7 bcf PortB,BLED8 013E 1EA2 00915 SND0UT8 btfss Stat,BStLED9 /Set/Reset LED9 013F 2942 00916 goto SNDOUT9 0140 1486 00917 bsf PortB,BLED9 0141 2943 00918 goto SNDOUTA 0142 1086 00919 SND0UT9 bcf PortB,BLED9 00920 01430008 00921 SNDOUTA return ; Return to caller 00922 • * 00923 ************************************************** 00924 SUBTITL 'GETIN - Get Input Patterns' \SM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 24 lim Face Sensor II - PIC16C73 Control Code TIN - Get Input Patterns ; OBJECT CODE LINE SOURCE TEXT /ALUE 00925 PAGE 00926 ; *********** * ****************** ******************* ■ * ********* 00927 /* 00928 /* PROCEDURE: GETIN - Get Input Patterns 00929 /* 00930 /* OUTPUT: SApat, INpat 00931 /* 00932 /* ALGORITHM: 00933 /* RETURN 00934 /* 00935 /*********************************************************** 144 0826 00936 I GETIN movf SApat, / SAptaSV - SApat 145 00A7 00937 movwf SApatSV 1460829 00938 movf INpat, / INpatSV - INpat 147 00AA 00939 movwf INpatSV 00940 148 1187 00941 bcf PortC,BSCLK zSCLK - 0 (Load Patterns) 149 1106 00942 bcf PortB,BSSPL ZSSPL - 0 14A 1587 00943 bsf PortC,BSCLK ZSCLK - 1 14B 1187 00944 bcf PortC,BSCLK ZSCLK - 0 ■14C 1506 0094S bsf PortB,BSSPL ,- SSPL - 1 (Shift Patterns) 00946 00947 Z* Get Switch Array Pattern )14D 3008 00948 movlw 08H /Shift 8 bits )14E OOA0 00949 movwf Temp 314F 1003 00950 GETIN1 bcf STATUS,C /Carry - 0? 3150 1A07 00951 btfsc PortC, BSIN /Skip if SIN - 0 3151 1403 00952 bsf STATUS,C /Carry - 1 Message(3051 : Using default destination of 1 (file) . 01520CA1 00953 rrf Tempi /Rotate Pattern Left 01531S87 00954 bsf PortC,BSCLK zSCLK - 1 0154 1187 00955 bcf PortC,BSCLK SCLK - 0 Message(305) : Using default destination of 1 (file) . 0155 OBAO 00956 decfsz Temp z ec and Skip if - 0 0156294F 00957 goto GETIN1 00958 0157 0821 00959 movf Tempi, zSApat - Tempi 0158393F 00960 andlw 03FH / <- Correct for SWl miss-wire 01591B21 00961 btfsc Tempi, 6 z<- 015A 3880 00962 iorlw 080H /<- 015B 1BA1 00963 btfsc Tempi,7 /<- 015C 3840 00964 iorlw 040H /<- 015D 00A6 00965 movwf SApat 00966 015E Olλβ 00967 clrf SAbcd / Update SAbcd 015F 1FA6 00968 btfss SApat, 7 0160 1428 00969 bsf SAbcd, 0 0161 1F26 00970 btfss SApat, 6 0162 14A8 00971 bsf SAbcd, 1 0163 1EA6 00972 btfss SApat, 5 0164 1528 00973 bsf SAbcd, 2 0165 1E26 00974 btfss SApat, 4 016615A8 00975 bsf SAbcd, 3 1PASM 01.30.01 Intermediate SONIC Λ 1-20-1997 14:41:42 PAGE 2! >enim Face Sensor II - PIC16C73 Control C o d e JETIN - Get Input Patterns ΛC OBJECT CODE LINE SOURCE TEXT VALUE 00976 00977 /* Get Input Pattern 3167 3008 00978 movlw 08H /Shift 8 bits 0168 00A0 00979 movwf Temp 01691003 00980 GETIN2 bcf STATUS,C /Carry - 0? 016A 1A07 00981 btfsc PortC,BSIN /Skip if SIN - 0 016B 1403 00982 bsf STATUS,C /Carry - 1 Message[305] : Using default destination of 1 (file) . 016C 0DA1 00983 rlf Tempi /Rotate Pattern Left 016D 1587 00984 bsf PortC, BSCLK zSCLK - 1 016E 1187 00985 bcf PortC,BSCLK ,-SCLK - 0 Message[305] : Using default destination of 1 (file) . 016F OBAO 00986 decfsz Temp /Dec and Skip if - 0 01702969 00987 goto GETIN2 00988 01710821 00989 movf Tempi,W /INpat - Tempi 0172 00A9 00990 movwf INpat 00991 01730828 00992 movf SAbcd.W /Test SAbcd 0174 3A08 00993 xorlw 8 01751D03 00994 btfss STATUS, Z /Skip if SAbcd - 8 01762993 00995 goto GETIN3 0177 1E05 00996 btfss PortA,BSWl /Skip SWl - Not Pressed 0178 1029 00997 bcf INpat,BIN trl /INmtrl - 0 0179 1A05 00998 btfsc PortA,BSWl /Skip SWl - Pressed 017A 1429 00399 bsf INpat, BINmtrl z INmtrl - 1 017B 1E85 01000 btfss PortA, BSW2 Skip SW2 - Not Pressed 017C 10A9 01001 bcf INpat,BINbndl ZlNbndl - 0 017D 1A85 01002 btfsc PortA,BSW2 zSkip SW2 «= Pressed 017E 14A9 01003 bsf INpat,BINbndl ZlNbndl - 1 01004 / * KAI 017F 1BA3 01005 btfsc CStat,BCSclb zSkip if <> Calibration 0180298A 01006 goto GETIN21 0181 1A05 01007 btfsc PortA,BSW1 ZSkip SWl - Pressed 018229A4 01008 goto GETINS 0183 lλβS 01009 btfsc PortA,BSW2 / Skip SW2 - Pressed 018429A4 01010 goto GETINS 01853084 01011 movlw CSclb+CSdlyC / Set Calibrate Mode 018600A3 01012 movwf CStat 0187 01AD 01013 clrf VCntrlT / VCntrlT - 0 0188 0195 01014 clrf CCPR1L 018929A4 01015 goto GETIN5 018A 1F23 01016 GETIN21 btfss CStat,BCSclbC / Skip if Calibration Coi 018B 29A4 01017 goto GETINS 018C 1E05 01018 btfss PortA,BSW1 / Skip SWl <> Pressed 018D 29A4 01019 goto GETIN5 018E 1A85 01020 btfsc PortA,BSW2 zSkip SW2 Pressed 018F 01A3 01021 clrf CStat zClear Calibration Mode 0190 142A 01022 bsf INpatSV,BINmtrl /INmtrl - 1 0191 162A 01023 bsf INpatSV, BINratr2 ,-INmtr2 - 1 019229A4 01024 goto GETIN5 01025 01930828 01026 GETIN3 movf SAbcd.W Test SAbcd PASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 26 eni Face Sensor II - PIC16C73 Control Code ETIN - Get Input Patterns OC OBJECT CODE LINE SOURCE TEXT VALUE 194 3A09 01027 xorlw 9 1951D03 01028 btfss STATUS,Z /Skip if SAbcd - 9 19629A0 01029 goto GETIN4 1197 1E05 01030 btfss PortA, BSW1 /Skip SWl - Not ressed 1198 1229 01031 bcf INpat, BINmtr2 /INmtr2 - 0 11991A05 01032 btfsc PortA.BSWl /Skip SWl - Pressed )19A 1629 01033 bsf INpat,BINmtr2 /INmtr2 - 1 )19B 1E85 01034 btfss PortA, BSW2 /Skip SW2 - Not Pressed 319C 12A9 01035 bcf INpat,BINbnd2 /INbnd2 - 0 319D 1A85 01036 btfsc PortA,BSW2 /Skip SW2 - Pressed 019E 16A9 01037 bsf INpat,BlNbnd2 ,-INbnd2 - 1 019F 29A4 01038 goto GETIN5 01039 01A0 1E05 01040 GETIN4 btfss PortA,BSW1 /Skip SWl - Not Pressed 01A1 11A2 01041 bcf Stat,BSW12 /Set SWl Last Pressed 01A2 1E85 01042 btfss PortA,BSW2 /Skip SW2 - Not Pressed 01A3 1SA2 01043 bsf Stat,BSW12 /Set SW2 Last Pressed 01044 ' 01A4 0008 01045 GETINS return /Return to caller 01046 ;* 01047 :* ** ******* * ****** * * * **** * * * ***** * ********** * ********** 01048 SUBTITL 'SAVE - Save Parameters to EPROM' VPASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 27 ■enira Face Sensor II - PIC16C73 Control Code iAVE - Save Parameters to EPROM ΛC OBJECT CODE LINE SOURCE TEXT VALUE 01049 PAGE 01050 . * ** *** ** * * * * * « * * * ********** * ** ** ******* **** * ***** * **** 01051 01052 PROCEDURE: SAVE - Save Parameters to EPROM 010S3 01054 INPUT: VCntrll, Bavel,VCntrl2, Bave2 01055 01056 ALGORITHM: 01057 RETURN 01058 /* 01059 ************************************************************ 01AS 1683 01060 SAVE bsf STATUS,RPO /Select Register Page 1 01A63000 01061 movlw TRISBCO /Set Output Mask for Port B Message(302) Argument out of range. Least significant bits used. 01A7 0086 01062 movwf TRISB 01A8 1283 01063 bcf STATUS, RPO /Select Register Page 1 01064 01A921C0 01065 call SSTART /Send START Condition 01066 01AA 3OA0 01067 movlw 0A0H /Send Write opcode 01AB 2210 01068 call CLOCK8 01AC 21CC 01069 call ACK /Get Acknowledge 01070 01AD 3000 01071 movlw 000H zSend Address opcode 01AE 2210 01072 call CLOCK8 01AF 21CC 01073 call ACK zGet Acknowledge 01074 01B00831 01075 movf VCntrll,W zSend VCntrll Code 01B12210 01076 call CLOCK8 01B221CC 01077 call ACK zGet Acknowledge 01078 01B3 0839 01079 movf Bavel,W zSend Bavel Code 01B4 2210 01080 call CLOCK8 01BS 21CC 01081 call ACK zGet Acknowledge 01082 01B60841 01083 movf VCnt l2,W Send VCntrl2 Code 01B730AA 01084 movlw 0AAH 01B82210 01085 call CLOCK8 01B921CC 01086 call ACK zGet Acknowledge 01087 01BA 0849 01088 movf Bave2,W zSend Bave2 Code 01BB 3055 01089 movlw 055H 01BC 2210 01090 call CLOCKβ 01BD 21CC 01091 call ACK zGet Acknowledge 01092 01BE 21C6 01093 call SSTOP ZSend STOP Condition 01094 01BF 0008 01095 return zReturn to Caller 01096 01097 01098 * Send START Condition 01099 /* * 01C0 1187 01100 SSTART bcf PortC, BSCLK /Send Start Condition ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 28 nim Face Sensor II - PIC16C73 Control Code VE - Save Parameters to EPROM C OBJECT CODE LINE SOURCE TEXT VALUE Cl 1586 01101 bsf PortB, BEDAT C2 1587 01102 bsf PortC, BSCLK C3 1186 01103 bcf PortB, BEDAT C4 1187 01104 bcf PortC, BSCLK ,C50008 01105 return zReturn to Caller 01106 01107 . * 01108 . * Send STOP Condition 01109 . * 1C6 1186 OHIO SSTOP bcf PortB, BEDAT zSend Stop Condition 1C7 1587 01111 bsf PortC,BSCLK 1C8 1586 01112 bsf PortB, BEDAT 1C91187 01113 bcf PortC, BSCLK 1CA 1186 01114 bcf PortB,BEDAT 1CB 0008 01115 return ZReturn to Caller 01116 01117 z* 01118 z* Get Acknowledge from 24LC01B 01119 z* )1CC 1683 01120 ACK bsf STATUS,RPO /Select Register Page 1 31CD 3008 01121 movlw TRISBCI /Set Input Mask for Port B 4essage(302] : Argument out of range. Least significant bits used. 31CE 0086 01122 movwf TRISB 01CF 1283 01123 bcf STATUS,RPO /Select Register Page 0 01D0 1587 01124 bsf PortC,BSCLK /Wait for Acknowledge 01D1 1187 01125 bcf PortC, BSCLK 01D2 1683 01126 bsf STATUS,RPO /Select Register Page 1 01D3 3000 01127 movlw TRISBCO /Set Output Mask for Port B Message[302] Argument out of range. Least significant bits used. 01D40086 01128 movwf TRISB 01DS 1283 01129 bcf STATUS, PO /Select Register Page 0 01D60008 01130 return /Return to caller 01131 01132 01133 Send Acknowledge to 24LC01B 01134 01D7 1683 01135 ACKS bsf STATUS,RPO /Select Register Page 1 01D83000 01136 movlw TRISBCO /Set Output Mask for Port B Message[302] : Argument out of range. Least significant bits used. 01D90086 01137 movwf TRISB 01DA 1283 01138 bcf STATUS, PO /Select Register Page 0 01DB 1186 01139 bcf PortB,BEDAT 01DC 1587 01140 bsf PortC, BSCLK /Send Acknowledge 01DD 1187 01141 bcf PortC,BSCLK 01DE 1683 01142 bsf STATUS,RPO / Select Register Page 1 01DF 3008 01143 movlw TRISBCI zSet Input Mask for Port B Message[302) : Argument out of range. Least significant bits used. 01E00086 01144 movwf TRISB 01E11283 01145 bcf STATUS,RPO /Select Register Page 0 01E2 0008 01146 return zReturn to caller 01147 01148 ************************* ****************** ******* 01149 SUBTITL 'GET - Get Parameters from EEPROM' • ASM 01.30.01 Intermediate SONIC.. 1-20-1997 14:41:42 PAGE 29 : nim Face Sensor II - PIC16C73 Control Code :τ - Get Parameters from EEPROM X. OBJECT CODE LINE SOURCE TEXT VALUE 01150 PAGE 01151 ************************************************************ 01152 /* 01153 /* PROCEDURE: GET - Get Parameters from EEPROM 01154 / ♦ 01155 /* OUTPUT: VCntrll, Bavel,VCntrl2,Bave2 01156 z* 01157 z* ALGORITHM: 01158 z* RETURN 01159 /* 01160 / *********************************************************** )1E3 1683 01161 GET bsf STATUS, RPO /Select Register Page 1 )1E4 3000 01162 movlw TRISBCO /Set Output Mask for Poπ 4essage[302] : Argument out of range. Least significant bits used. 31E5 0086 01163 movwf TRISB 01E61283 01164 bcf STATUS, RPO /Select Register Page 1 01165 01E721C0 01166 call SSTART /Send START Condition 01167 01E8 30A0 01168 movlw 0A0H / Send Write opcode 01E92210 01169 call CLOCK8 01EA 2ICC 01170 call ACK / Get Acknowledge 01171 01EB 3000 01172 movlw 000H /Send Address opcode 01EC 2210 01173 call CLOCK8 01ED 21CC 01174 call ACK / Get Acknowledge 01175 01EE 21C0 01176 call SSTART / Send START Condition 01177 01EF 30A1 01178 movlw 0A1H /Send Read opcode 01F02210 01179 call CLOCK8 01F121CC 01180 call ACK /Get Acknowledge 01181 01F21683 01182 bsf STATUS,RPO / Select Register page 1 01F33008 01183 movlw TRISBCI ZSet Input Mask for Port Message[302] : Argument out of range. Least significant bits used. 01F40086 01184 movwf TRISB 01F5 1283 01185 bcf STATUS,RPO zSelect Register Page 0 01186 01F63000 01187 movlw 000H /Get VCntrll 01F72210 01188 call CLOCK8 01F80820 01189 movf τemp,w 01F9 O0B1 01190 movwf VCntrll 01FA 21D7 01191 call ACKS / Send Acknowledge 01192 01FB 3000 01193 movlw O0OH / Get Bavel Code 01FC 2210 01194 call CLOCK8 01FD 0820 01195 movf Temp.W OlFE 00B9 01196 movwf Bavel 01FF 21D7 01197 call ACKS /Send Acknowledge 01198 0200 3000 01199 movlw 000H /Get VCntrl2 0201 2210 01200 call CLOCK8 PASM 01.30.01 Intermediate SONIC. 1-20-1997 14 : 41 : 42 PAGE 30 eni Face Sensor II - PIC16C73 Control Code ET - Get Parameters from EEPROM OC OBJECT CODE LINE SOURCE TEXT VALUE 1202 0820 01201 movf Te p.W 1203 00C1 01202 movwf VCntrl2 1204 21D7 01203 call ACKS / Send Acknowledge 01204 )205 3000 01205 movlw 000H /Get Bave2 Code 12062210 01206 call CLOCK8 32070820 01207 movf Temp,W 3208 00C9 01208 movwf Bave2 3209 21D7 01209 call ACKS / Send Acknowledge 01210 020A 1683 01211 bsf STATUS, RPO /Select Register Page 1 020B 3000 01212 movlw TRISBCO /Set Output Mask for Port B Message [302] : Argument out of range. Least significant bits used, 020C 0086 01213 movwf TRISB 020D 1283 01214 bcf STATUS,RPO /Select Register Page 0 0121S 020E 21C6 01216 call SSTOP / Send STOP Condition 01217 020F 0008 01218 return / Return to Caller 01219 /* 01220 z** **** * * * * * **** *** **** * ******** * ** * ********** * * * ****** * * 01221 SUBTITL 'CLOCK8 - Send W to EEPROM' PASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 31 enira Face Sensor II - PIC16C73 Control Code LOCK8 - Send W to EEPROM OC OBJECT CODE LINE SOURCE TEXT VALUE 01222 PAGE 01223 z*********************************************************** 01224 z* 01225 z* PROCEDURE: CLOCK8 - Swnd W to EEPROM 01226 z* 01227 z* ALGORITHM: 01228 ;* RETURN 01229 /* 01230 ************************************************************ 321000A0 01231 CLOCK8 movwf Temp /Save Pattern 0211 3008 01232 movlw 08H zlnit for 8 bits 0212 00A1 01233 movwf Tempi 01234 /* 0213 1003 01235 CLK81 bcf STATUS, C Carry - 0 Message[3051 Using default destination of 1 (file) . 0214 ODAO 01236 rlf Temp /Shift and Test MSB 01237 01238 Following code assumes Data to EEPROM 01239 0215 1803 01240 btfsc STATUS,C /Skip if MSB 02162A19 01241 goto CL82 0217 1186 01242 bcf PortB,BEDAT /EDAT 0218 2A1A 01243 goto CLK83 0219 1586 01244 CLK82 bsf PortB,BEDAT ,-EDAT 01245 01246 Following code assumes Data from EEPROM 01247 021A 1D86 01248 CLK83 btfss PortB,BEDAT /Skip if EDAT - 1 02IB 2A1D 01249 goto CLK84 Message [305] : Using default destination of 1 (file) . 021C 0AA0 01250 incf Temp /Temp LSB - 1 01251 021D 1587 01252 CLK84 bsf PortC, BSCLK ZSCLK - 1 021E 1187 01253 bcf PortC,BSCLK ZSCLK - 0 01254 Message (305) Using default destination of 1 (file) . 021F 0BA1 01255 decfsz Tempi /Dec and Skip if <> 0 02202A13 01256 goto CLK81 /BR if <> done 01257 z* 0221 1186 01258 bcf PortB,BEDAT /EDAT - 0 01259 0222 3400 01260 CLK8D retlw /Return to caller 01261 /* 01262 ************************************************************ 01263 SUBTITL 'MUL - Multiply Routine' •ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 32 -nim Face Sensor II - PIC16C73 Control Code IL - Multiply Routine X. OBJECT CODE LINE SOURCE TEXT VALUE 01264 PAGE 01265 ************************************************************ 01266 /* 01267 z* PROCEDURE: MUL - Multiply Routine 01268 /* 01269 /* INPUT: MPARM - 8 bit Multiplicand 01270 /* MPARM+1 - 8 bit Multiplier 01271 /* 01272 /* OUTPUT: MPARM,MPARM+1 - 16 bit Result 01273 / « 01274 z* ALGORITHM: 01275 z* RETURN 01276 /* 01 7 7 * *********************************************************** 3223 3008 01278 MUL movlw 8 /Temp - 8 3224 O0A0 01279 movwf Temp 0225 0850 01280 movf MPARM,W ;W - Multiplicand 022601D0 01281 clrf MPARM 01282 0227 1003 01283 MUL1 bcf STATUS,C /Carry - 0 0228 1851 01284 btfsc MPARM+1,0 /Skip if LSB of Multiplier - 0 Message[3051: Using default destination of 1 ( ile). 0229 07D0 01285 addwf MPARM /Result - Result + Multiplicand Message1305) : Using default destination of 1 (file). 022A 0CD0 01286 rrf MPARM Message(305) : Using default destination of 1 (file). 022B 0CD1 01287 rrf MPARM+1 Message[305] : Using default destination of 1 (file). 022C OBAO 01288 decfsz Temp / Dec Count and skip if 022D 2A27 01289 goto MUL1 01290 022E 0008 01291 return 01292 /* 01293 ************************************************************ 01294 SUBTITL ' DIV - Divide Routine* PASK 01.30.01 Intermediate SONIC 1 1-20-1997 14:41:42 PAGE 3: eni Face Sensor II - PIC16C73 Control Code .IV - Divide Routine OC OBJECT CODE LINE SOURCE TEXT VALUE 01295 PAGE 01296 /*********************************************************** 01297 /* 01298 . * PROCEDURE: DIV - Divide Routine 01299 . * 01300 . * INPUT: MPARM+0 - 16 bit Dividend MSB 01301 . * MPARM+1 - 16 bit Dividend LSB 01302 . * MPARM+2 - 8 bit Divisor 01303 . * 01304 . * OUTPUT: MPARM+0,1 - Result 01305 . * 01306 . * ALGORITHM: 01307 . * RETURN 01308 . * 01309 . *********************************************************** 022F 3010 01310 DIV movlw 16 /Count - 16 023000A0 01311 movwf Temp 023101D3 01312 clrf MPARM+3 ZAcc - 0 023201D4 01313 clrf MPARM+4 01314 02331003 01315 DIV1 bcf STATUS,C /Carry - 0 Message[305] Using default destination of 1 (file) . 02340DD1 01316 rlf MPARM+1 /Rotate MPARM (2 byte) Left Message(30S] Using default destination of 1 ( ile) . 02350DD0 01317 rlf MPARM Message[305] Using default destination of 1 (file) . 02360DD4 01318 rlf MPARM+4 / Rotate Ace (2 byte) Left Message[305] Using default destination of 1 (file) . 0237 0DD3 01319 rlf MPARM+3 Message(305) Using default destination of 1 (file) . 023808D3 01320 movf MPARM+3 /Test Ace 0239 1D03 01321 btfss STATUS, Z /Skip if Ace < 256 023A 2A3F 01322 goto DIV2 023B 0852 01323 movf MPARM+2,W /Test Ace - MPARM+2 023C 0254 01324 subwf MPARM+4, 023D 1C03 01325 btfss STATUS,C /Skip if Ace >- MPARM+2 023E 2A46 01326 goto DTV3 023F 0852 01327 DIV2 movf MPARM+2,W /ACC - Ace - MPARM+2 Message[305]: : Using default destination of 1 (file) . 024002D4 01328 subwf MPARM+4 02411C03 01329 btfss , STATUS,C Message[305) : Using default destination of 1 (file) . 024203D3 01330 decf MPARM+3 0243 0100 01331 clrw Message(305] : Using default destination of 1 (file) . 024402D3 01332 subwf MPARM+3 Message1305] : Using default destination of 1 (file) . 0245 0AD1 01333 incf MPARM+1 / Set LSBit of MPARM (2 byte) Message1305] : Using default destination of 1 (file) . 0246 OBAO 01334 DIV3 decfsz Temp /Dec Count and skip if - 0 0247 2A33 01335 goto DIV1 01336 02480008 01337 DIV4 return PASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 34 enim Face Sensor II - PIC16C73 Control Code IV - Divide Routine OC OBJECT CODE LINE SOURCE TEXT VALUE 01338 /* 01339 ************************************************************ 01340 SUBTITL "TSTSL - Test Switches/LEDs' -•ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 35 .nim Face Sensor II - PIC16C73 Control Code 5TSL - Test Switches/LEDs 3C OBJECT CODE LINE SOURCE TEXT VALUE 01341 PAGE 01342 * *********************************************************** 01343 /* 01344 /* PROCEDURE: Test Switches/LEDs 01345 /* 01346 /* ALGORITHM: 01347 /* RETURN 01348 /* 01349 * *********************************************************** )2490826 01350 ' ΓSTSL movf SApat, /LEDpat - SApat )24A 3801 01351 iorlw 001H 324B 00AB 01352 mov f LEDpat 01353 324C 30FF 01354 movlw OFFH /Turn OFF outputs 024D 00AC 01355 movwf OUTpat 01356 024E 1C29 01357 btfss INpat,BINmtrl /Skip if Material 1 - 1 024F 10AC 01358 bcf OUTpat, 1 /Turn on LED 02501E29 01359 btfss INpat,BINmtr2 zSkip if Material 2 - 1 0251102C 01360 bcf OUTpat,0 Turn on LED 01361 z ai btfss PortA,BSWCal Skip if Calibrate Switch 0252102B 01362 bcf LEDpat, 0 / Turn on LED 01363 0253 2118 01364 call SNDOUT / Send Patterns 01365 0254 0008 01366 TSTSLl return / Return to caller 01367 . * 01368 * **************************** **************************** 01369 SUBTITL 'TSTIO - TTeesstt Inputs/Outputs' ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 36 nim Face Sensor II - PIC16C73 Control Code TIO - Test Inputs/Outputs C OBJECT CODE LINE SOURCE TEXT VALUE 01370 PAGE 01371 ********************************************************* 01372 01373 PROCEDURE: Test Inputs/Outputs 01374 01375 ALGORITHM: 01376 RETURN 01377 01378 *********************************************************** 255 0829 01379 TSTIO movf INpat,W /Temp - INpat inverted 256 OOA0 01380 movwf Temp 01381 257 3AFF 01382 xorlw OFFH /OUTpat - (INpat x 4) Inverted 258 0OAC 01383 movwf OUTpat ) 2S9 1403 01384 bsf STATUS,C lessage(305] : Using default destination of 1 (file) . )2SA ODAC 01385 rj.f OUTpat )25B 1403 01386 bsf STATUS,C essage[305] : Using default destination of 1 (file) . 125C ODAC 01387 rlf OUTpat 01388 32SD 3008 01389 movlw 8 zLEDpat(0..7) - τemp(7..0) Q25E O0A1 01390 movwf Tempi Message[305] Using default destination of 1 (file) . 02SF ODAO 01391 TSTIOl rlf Temp Message[305] Using default destination of 1 (file) . 0260 OCAB 01392 rrf LEDpat Message(3 5] Using default destination of 1 (file) . 0261 0BA1 01393 decfsz Tempi 0262 2ASF 01394 goto TSTIOl 01395 0263 2118 01396 call SNDOUT /Send Patterns 01397 01398 zkai goto MAIN1 z epeat Eternally 01399 /* 01400 ************************************************************ 01401 SUBTITL 'TSTCS - Test Control/Sonic Voltages' PASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 37 enim Face Sensor II - PIC16C73 Control Code STCS - Test Control/Sonic Voltages OC OBJECT CODE LINE SOURCE TEXT VALUE 01402 PAGE 01403 z *********************************************************** 01404 z* 01405 z* PROCEDURE: Test Control/Sonic Voltages 01406 z* 01407 /* ALGORITHM: 01408 /* RETURN 01409 z* 01410 , ******************************************************** 3264 01AB 01411 TSTCS clrf LEDpat /LEDpat - 0? 0265 1F22 01412 btfss Stat.BBlnkF /Skip if BlnkF - 1 Message(3051 : Using default destination of 1 (file) . 026603AB 01413 decf LEDpat Z EDpat - OFFH 0267 0828 01414 movf SAbcd.W . • Test SAbcd 0268 3C03 01415 sublw 3 0269 1C03 01416 btfss STATUS,C .-Skip if 3 >- SAbcd 026A 2AA 01417 goto TSTCS3 01418 026B 01AB 01419 clrf LEDpat ZLEDpat - 0 Message[305) : Using default destination of 1 (file) . 026C 0AAD 01420 incf VCntrlT zinc Control Voltage Temp 026D 082D 01421 movf VCntrlT, . • Set PWM1/PWM2 026E 1CA8 01422 btfss SAbcd, 1 zSkip if SAbcd >- 2 026F 0095 01423 movwf CCPR1L 0270 18A8 01424 btfsc SAbcd, 1 /Skip if SAbcd < 2 0271 009B 01425 movwf CCPR2L 01426 0272 1828 01427 btfsc SAbcd,0 / Skip if SAbcd - 0 or 2 0273 2A76 01428 goto TSTCSl 01429 0274 082D 01430 movf VCntrlT, / Display Control Voltage 0275 2A79 01431 goto TSTCS2 01432 02760830 01433 TSTCSl movf VSonicl,W / Display Sonic 1 Voltage? 0277 18A8 01434 btfsc SAbcd, 1 /Skip if SAbcd - 1 02780840 01435 movf VSonic2,W / Display Sonic 2 Voltage 027900AB 01436 TSTCS2 movwf LEDpat 01437 027A 082B 01438 TSTCS3 movf LEDpat, /Display Value 027B 202F 01439 call GLEDPAT 027C 2118 01440 call SNDOUT /Send Patterns 01441 027D 2C17 01442 goto MAINTX /Return to Main Loop 01443 01444 z* 01445 . ***************************** ****************************** 01446 SUBTITL 'SSC1 - Sonic 1 State Control' SM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 38 ,im Face Sensor II - PIC16C73 Control Code 1 - Sonic 1 State Control • . OBJECT CODE LINE SOURCE TEXT 'ALUE 01447 PAGE 01448 ********************* ********** 01449 01450 PROCEDURE: SSC1 Sonic State Control 01451 01452 ALGORITHM: 01453 RETURN 01454 01455 *********************************************************** 01456 Process Material I7E 0828 01457 SSC1 movf SAbcd, /Test SAbcd !7F 3A08 01458 xorlw 8 >801D03 01459 btfss STATUS, Z /Skip if SAbcd - 8 2812A84 01460 goto SSC10 282 1BA3 01461 btfsc CStat,BCSclb /Skip if <> Calibrate Mode 2832B29 01462 goto SSC14 /Go to Calibrate Mode 01463 284 1C29 01464 SSC10 btfss INpat,BINmtrl /Skip if No Material 2852ABE 01465 goto SSC11 /Goto Material Present 286182A 01466 btfsc INpatSV,BINmtrl /Skip if Material Trailing Edge 2872B0D 01467 goto SSC13 01468 01469 Process Material Trailing Edge 1288 0A38 01470 incf Bcntl.W /Test Bent 1289 1903 01471 btfsc STATUS, Z /Skip if <> 255 )28A 2B0D 01472 goto SSC13 -!essage (305] : Using default destination of 1 (file) . 328B 0AB8 01473 incf Bcntl zinc Bent 328C 0839 01474 movf Bavel,W /CMTbuf - Bave 328D 00E0 01475 movwf CMTbuf 328E 0833 01476 movf Msu l.w / MPARM - Msum / Mcnt 028F 00D0 01477 ■ movwf MPARM 02900834 01478 movf Msuml+l.W 029100D1 01479 movwf MPARM+1 02920832 01480 movf Mcntl.W 029300D2 01481 movwf MPARM+2 0294222F 01482 call DIV 02950851 01483 movf MPARM+1,W / MaveSV - MPARM 029600B7 01484 movwf MavelSV 02970851 01485 movf MPARM+1,W zBsum - Bsu + MPARM Message[305] : Using default destination of 1 (file) . 029807BB 01486 addwf Bsuml+1 0299 1803 01487 btfsc STATUS,C Message[305] : Using default destination of 1 (file) . 029 OABA 01488 Incf Bsuml 01489 / movf MPARM,W 01490 / addwf Bsuml 029B 083A 01491 movf Bsuml, /Bave - Bsum / Bent 029C O0D0 01492 movwf MPARM 029D 083B 01493 movf Bsuml+1,W 029E 00D1 01494 movwf MPARM+1 029F 0838 01495 movf Bcntl.W 02A000D2 01496 movwf MPARM+2 ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 39 nim Face Sensor II - PIC16C73 Control Code Cl - Sonic 1 State Control C OBJECT CODE LINE SOURCE TEXT VALUE !Al 222F 01497 ccaallll D DIIVV !A2 0851 01498 mmoovvff M MPPAARRMM++11,,W !A300B9 01499 mmoovvwwff B Baavveell >A4 0860 01500 mmoovvff C CMMTTbbuuff,,WW / /Convert old Bave to BCD -AS 2067 01501 ccaallll C CNNVVBBCCDDVV 2A60860 01502 mmoovvff C CMMTTbbuuff,, ; Reposition 2A7 00E5 01503 mmoovvwwff C CMMTTbbuuff++55 2A80861 01504 mmoovvff C CMMTTbbuuff++11,,WW 2A900E6 01505 mmoovvwwff C CMMTTbbuuff**66 2λλ 0862 01506 mmoovvff C CMMTTbbuu ++22,, 2AB 00E7 01507 mmoovvwwff C CMMTTbbuuff++77 2AC 0863 01508 mmoovvff C CMMTTbbuuff++33,, <2AD 00E8 01509 mmoovvwwff C CMMTTbbuuff++88 )2AE 0837 01510 mmoovvff M MaavveellSSVV..WW /Convert MaveSV to BCD )2AF 2067 01511 ccaallll C CNNVVBBCCDDVV J2B0302C 01512 mmoovvllww )2B100E4 01513 mmoovvwwff C CMMTTbbuuff++44 32B200E9 01S14 mmoovvwwff C CMMTTbbuuff++99 32B33053 01515 mmoovvllww • •ss «« 02B4 1C2C 01516 bbttffssss O OUUTTppaatt,,BBFFaacceel- /Skip if Smooth 02BS 3052 01517 mmoovvllww • •RR'' 02B600EA 01518 mmoovvwwff C CMMTTbbuuff++1100 02B7 300D 01519 mmoovvllww 1 133 /Add Carriage Return 02B800EB 01520 mmoovvwwff C CMMTTbbuuff++1111 02B9300A 01521 mmoovvllww 1 100 /Add Line Feed 02BA 00EC 01522 mmoovvwwff C CMMTTbbuuff++1122 02BB 300D 01523 mmoovvllww 1 133 /CMtstat - 13 (Count) 02BC 00D5 01S24 mmoovvwwff C CMMTTssttaatt 02BD 2B0D 01525 ggoottoo S SSSCC1133 01526 01527 /* Procceessss MMaatt*e.rriiaall LLeeaaddiinngg Edgi 0 022BBEE 1C2A 01528 SSC11 bbttffssss I INNppaattSSVV,,BBIINNmtrl / Skip if Material Leading Edge 0022BBFF 2AC9 01529 ggoottoo S SSSCC1122 0022CC0001B3 01S30 ccllrrff M Mssuummll zlnit for Sampling 0022CC11 01B4 01S31 ccllrrff M Mssuummll++11 0022CC2201B5 01532 ccllrrff M Maavveell 0022CC3301B6 01533 ccllrrff M Maavveell++11 0022CC44 01B2 01S34 ccllrrff M Mccnnttll 0022CCSS 01BD 01535 ccllrrff M MLLEEddllyyll zlnit Material Leading Edge Delay 0022CC663020 01S36 mmoovvllww 3 322 / Delay for 3" (7.27sec / 68.43" * 3" / .01 Samp] 0022CC77 1DA6 01537 bbttffssss S SAAppaatt,,BBSSAAddiilpO /Skip if DIP SW Bit 0 - 1 0022CC88 00BD 01538 mmoovvwwff M MLLEEddllyyll 01539 01540 01541 /* Process Material Present Message(305] : Using default destination of 1 (file) . 02C908BD 01542 SSC12 movf MLEdlyl /Dec MLEdly 02CA 1D03 01543 btfss STATUS,! /Skip if - 0 Message[305] : Using default destination of 1 (file) . 02CB 03BD 01544 decf MLEdlyl 02CC 1D03 01545 btfss STATUS, Z /Skip if 02CD 2B0D 01546 goto SSC13 02CE 0A32 01547 incf Mcntl,W /Test Mcnt 'ASM 01.30.01 Intermediate SONIC . 1-20-1997 14:41:42 PAGE 40 -nim Face Sensor II - PIC16C73 Control Code 5C1 - Sonic 1 State Control 3C OBJECT CODE LINE SOURCE TEXT VALUE 2CF 1903 01548 btfsc STATUS, Z /Skip if <> 255 2D02ADA 01549 goto SSC121 essage[30S] : Using default destination of 1 (file) . 2D10AB2 01550 incf Mcntl ; Inc Mcnt 2D20830 01551 movf VSonicl,W / Msum - Msum + VSonic iessage[305) : Using default destination of 1 (file) . I2D3 07B4 01552 addwf Msuml+1 )2D4 1803 01553 btfsc STATUS, C iessage[305] : Using default destination of 1 (file) . )2DS 0AB3 01554 incf Msuml 32D60839 01555 movf Bavel,W ,-Mave = Mave + Bave Message(305) : Using default destination of 1 (file) . 32D7 07B6 01556 addwf Mavel+1 02D81803 01557 btfsc STATUS,C Message[305] : Using default destination of 1 (file) . 02D90ABS 01558 incf Mavel 02DA 0833 01559 SSC121 movf Msuml, zTemp,Tempi - Msum - Mave 02DB OOAO 01560 movwf Temp 02DC 0836 01561 movf Mavel+1, 02DD 0234 01562 subwf Msuml+1, 02DE 00A1 01563 movwf Tempi 02DF 1C03 01564 btfss STATUS,C Message(305] : Using default destination of 1 (file) . 02E003A0 01565 decf Temp 02E10835 01566 movf Mavel,W 02E20220 01567 subwf Temp,w 02E3 OOAO 01S68 movwf Temp 02E4 142C 01569 bsf OUTpat, BFacel zFacel » ON (Smooth)? 02E5 1FA0 01570 btfss Temp, 7 / Skip if Temp,Tempi < 0 (Rough) 02E62AEE 01571 goto SSC122 02E7 102C 01572 bcf OUTpat,BFacel ,-Facel - OFF (Rough) 02E830FF 01573 movlw OFFH Z 2's Complement Temp,Tempi Message[305] : Using default destination of 1 (file) . 02E9 O6A0 01574 xorwf Temp Message[305] : Using default destination of 1 (file) . 02EA 06A1 01575 xorwf Tempi Message[305] : Using default destination of 1 (file) . 02EB 0AA1 01576 incf Tempi 02EC 1903 01577 btfsc STATUS, Z Message[305] : Using default destination of 1 ( ile) . 02ED 0AA0 01578 Incf Temp 02EE 0820 01579 SSC122 movf Temp,W / MPARM - Temp / Mcnt 02EF 00D0 01580 movwf MPARM 02FO 0821 01581 movf Tempi, 02F100D1 01582 movwf MPARM+1 02F2 0832 01583 movf Mcntl,W 02F300D2 01584 movwf MPARM+2 02F4 222F 01585 call DIV 02FS 0851 01586 movf MPARM+1,W /Get Result 02F61C2C 01587 btfss OUTpat,BFacel / Skip if Smooth 02F7 2AFF 01588 goto SSC123 02F8 OOAO 01589 movwf Temp / Save Value in Temp 02F9 30FE 01590 movlw 254 jlnit Value? ASM 01.30.01 Intermediate SONIC, 1-20-1997 14:41:42 PAGE 41 nim Face Sensor II - PIC16C73 Control Co d e Cl - Sonic 1 State Control C OBJECT CODE LINE SOURCE TEXT VALUE '.FA 1BA0 01591 btfsc Temp, 7 /Skip if Temp < 128 •FB 2B0C 01592 goto SSC125 !FC 1B20 01593 btfsc Temp, 6 /Skip if Temp < 64 •FD 2B0C 01594 goto SSC125 2FE 2B09 01595 goto SSC124 2FF 3AFF 01596 SSC123 xorlw OFFH /Save 2's Complement 3003E01 01597 addlw 1 301 OOAO 01598 movwf Temp 302 1903 01599 btfsc STATUS, z /Skip if <> 0 3032B09 01600 goto SSC124 304 3000 01601 movlw 0 ,-Init Value? 305 1FA0 01602 btfss Temp, 7 /Skip if Temp <- -128 3062B0C 01603 goto SSC125 1307 1F20 01604 btfss Temp, /Skip if Temp <- -64 13082B0C 01605 goto SSC125 )3091003 01606 SSC124 bcf STATUS,C ;W - (Temp * 2) + 128 )30A 0D20 01607 rlf Temp.W 330B 3E80 01608 addlw 128 )30C O0BC 01609 SSC125 movwf MBarGrl /Save to Material Bar Graph 01610 01611 /* Process Bundle Leading Edge 030D 18A9 01612 SSC13 btfsc INpat, BINbndl /Skip if Bundle 030E 2B70 01613 goto SSC1X /Goto Material Present 030F lCAA 01614 btfss INpatSV, BINbndl /Skip if Bundle Leading Edgi 03102B70 01615 goto SSC1X 0311 30FF 01616 movlw 2S5 /Set MBarGr - End of Bundle 031200BC 01617 movwf MBarGrl 01618 0313 3066 01619 movlw VSonicC /Bave - (Bave + VSonicC) / Message(305] : Using default destination <of 1 (file) . 0314 07B9 01620 addwf Bavel Message[305] : Using default destination of 1 (file) . 03150CB9 01621 rrf Bavel 031601BA 01622 clrf Bsuml /Bsum — Bave 0317 0839 01623 movf Bavel,W 031800BB 01624 movwf Bsuml+1 03190838 01625 movf Bcntl.W /Test Bent 031A 39F0 01626 andlw 0F0H 031B 1903 01627 btfsc STATUS, Z /Skip if Bent >- 16 031C 2B25 01628 goto . SSC132 /Don't adjust VCntrl 031D 3066 01629 movlw VSonicC /Test Bave 031E 0239 01630 subwf Bavel, 031F 1C03 01631 btfss STATUS,C / Skip if Bave >- VSonicC 03202B24 01632 goto SSC131 03211D03 01633 btfss STATUS, Z /Skip if Bave - VSonicC Message[305] : : Using default destination of 1 (file) . 032203B1 01634 decf VCntrll /Dec VCntrl 03232B25 01635 goto SSC132 Message[305] : Using default destination of 1 (file) . 0324 0AB1 01636 SSC131 incf VCntrll zinc VCntrl 0325 3001 01637 SSC132 movlw 1 .•Bent - 1 032600B8 01638 movwf Bcntl 0327 21A5 01639 call SAVE /Save EEPAKMS ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 42 nim Face Sensor II - PIC16C73 Control Code Cl - Sonic 1 State Control C OBJECT CODE LINE SOURCE TEXT VALUE 1282B70 01640 goto SSC1X 01641 01642 ; 01643 ; !* Calibrate Mode 01644 . • * 129 082D 01645 SSC14 movf VCntrlT, / Test VCntrlT 32A 1D03 01646 btfss STATUS, Z / Skip VSonicT - 0 32B 2B42 01647 goto SSC142 01648 , ; * Do we reset Parms? 32C 3066 01649 movlw VSonicC /Test Bave 32D 0639 01650 xorwf Bavel, 32E 1D03 01651 btfss STATUS, Z /Skip if Bave - VSonicC '32F 2B3A 016S2 goto SSC141 /Reset Parms 1330083A 01653 movf Bsuml,W /Test Bsum )331 1D03 01654 btfss STATUS, Z /Skip if Bsum - VSonicC 13322B3A 01655 goto SSC141 /Reset Parms 33333066 01656 movlw VSonicC 3334 063B 01657 xorwf Bsuml+1, 3335 1D03 01658 btfss STATUS, Z / Skip if Bsum - VSonicC 03362B3A 01659 goto SSC141 /Reset Parms 0337 0338 01660 decf Bcntl.W /Test Bent 0338 1903 01661 btfsc STATUS, Z /Skip if Bent <> 1 03392B42 01662 goto SSC142 01663 /* Reset Parms 111 033A 3066 01664 SSC141 movlw VSonicC /Bave - VSonicC 033B 00B9 01665 movwf Bavel 033C 01BA 01666 clrf Bsuml / Bsum - VSonicC 033D 00BB 01667 movwf Bsuml+1 033E 00B7 01668 movwf MavelSV / MavelSV - VSonicC 033F 3001 01669 movlw 1 /Bent - 1 034000B8 01670 movwf Bcntl 0341 21A5 01671 call SAVE / Save EPROM Parameters 01672 01673 z* Process Calibration 0342 1B23 01674 SSC142 btfsc CStat,BCSclbC /Skip if Calibration <> Complete 03432B70 01675 goto SSC1X Message(305] : Using default destination of 1 (file) . 034403A3 01676 decf CStat /Dec Sub Delay 0345 0823 01677 movf CStat, /Test for Sub Delay 03463907 01678 andlw CSdly 0347 1D03 01679 btfss STATUS, Z .-Skip if 0 03482B70 01680 goto SSC1X 0349 3004 01681 movlw CSdlyC .•Reset Sub Delay Message[30S] : Using default destination of 1 (file) . 034A 07A3 01682 addwf CStat 034B 3066 01683 movlw VSonicC zTest VSonicl 034C 0230 01684 subwf VSonicl,W 034D 1803 01685 btfsc STATUS,C .-Skip if VSonicl < VSonicC 034E 2B55 01686 goto SSC143 Message(305] : Using default destination of 1 (file) . 034F OAAD 01687 incf VCntrlT zinc VCntrlT 0350 1903 01688 btfsc STATUS, Z zSkip if VCntrlT <> 0 0351 2B55 01689 goto SSC143 ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 43 nim Face Sensor II - PIC16C73 Control Code Cl - Sonic 1 State Control C OBJECT CODE LINE SOURCE TEXT VALUE 52 082D 01690 movf VCntrlT, zUpdate PWM 153 0095 01691 movwf CCPR1L 154 2B70 01692 goto SSC1X 155 1723 01693 SSC143 bsf CStat, BCSclbC / Set Calibration Complete 156 082D 01694 movf VCntrlT, W .-Test VCntrlT J57 39F0 01695 andlw 0F0H 3S8 1903 01696 btfsc STATUS, Z Skip if VCntrlT > 0.32 Volts }S9 2B6F 01697 goto SSC144 zBlink Error 35A 39C0 01698 andlw 0C0H 35B 3AC0 01699 xorlw 0C0H 35C 1903 01700 btfsc STATUS, Z /Skip if VCntrlT < 3.75 Volts 35D 2B6F 01701 goto SSC14 /Blink Error 35E 082D 01702 movf VCntrlT, /VCntrll - VCntrlL + VCntrlT .essage[30S] : Using default destination of 1 (file) . ■35F 07AE 01703 addwf VCntrlL (360 0C2E 01704 rrf VCntrlL.W 1361 00B1 01705 movwf VCntrll )362 082D 01706 movf VCntrlT,W /VCntrlL - VCntrlT )363 00AE 01707 movwf VCntrlL 3364 0831 01708 movf VCntrll, /Update PWM 3365 0095 01709 movwf CCPR1L 3366 3066 01710 movlw VSonicC /Bave - VSonicC 0367 00B9 01711 movwf Bavel 0368 01BA 01712 clrf Bsuml /Bsum - VSonicC 0369 O0BB 01713 movwf Bsuml+1 036A O0B7 01714 movwf MavelSV /MavelSV - VSonicC 036B 3001 01715 movlw 1 /Bent - 1 036C 00B8 01716 movwf Bcntl 036D 21A5 01717 call SAVE /Save EPROM arameters 036E 2B70 01718 goto SSC1X 036F 01AD 01719 SSC144 clrf VCntrlT /VCntrlT - 0 (Error) 01720 0370 0008 01721 SSC1X return /Return to caller 01722 . * 01723 . ***************************** ****************************** 01724 SUBTITL 'Main Routine' ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 44 nim Face Sensor II - PIC16C73 Control Code in Routine C OBJECT CODE LINE SOURCE TEXT VALUE 01725 PAGE 01726 ************************************************************ 01727 /* 01728 /* PROCEDURE: Main Routine 01729 /* 01730 /* ALGORITHM: 01731 - / * RETURN 01732 z* 01733 . **************************************************** * * * * *** 371 3081 01734 MAIN movlw 081H ;Init ADCONO 372 009F 01735 movwf ADCON0 373 3000 01736 movlw 000H / Init PortA 374 0085 01737 movwf PortA 375 3000 01738 movlw 000H /Init PortB 3760086 01739 movwf PortB 377 3003 01740 movlw 003H /Init PortC 1378 0087 01741 movwf PortC 01742 1379 1303 01743 bcf STATUS, RP1 / Select Register Page 1 )37A 1683 01744 bsf STATUS, RPO )37B 3001 01745 movlw 001H / Init OPTION register -> TMRO - Fosc/4/4 tessage(302] : Argument out of range. Least significant bits used. )37C 0081 01746 movwf OPT -> WDT - 18ms 337D 3004 01747 movlw 004H zlnit ADCON1 RA0,RA1,RA3 - Analog only <fessage[302] : Argument out of range. Least significant bits used. 037E 009F 01748 movwf ADCONl 037F 303F 01749 movlw TRISAC .-Set Input/Output Mask for Port A Message [302] : Argument out of range. Least significant bits used. 03800085 01750 movwf TRISA 0381 3000 01751 movlw TRISBCO /Set Input/Output Mask for Port B Message[302] : Argument out of range. Least significant bits used. 03820086 01752 movwf TRISB 0383 3090 01753 movlw TRISCC ZSet Input/Output Mask for Port C Message[302] : Argument out of range. Least significant bits used. 03840087 01754 movwf TRISC 0385 30A0 01755 movlw OA0H zSet TimerO Overflow Interrupt 0386008B 01756 movwf INTCON 0387 30FF 01757 movlw OFFH •" zSet Timer2 Period Message[302] : Argument out of range. Least significant bits used. 03880092 01758 movwf PR2 03893019 01759 movlw 25 ,-Baud Rate - 9600 Message(302] : Argument out of range. Least significant bits used. 038A 0099 01760 movwf SPBRG 038B 3024 01761 movlw 024H zEnable Transmit Message(302) Argument out of range. Least significant bits used. 038C 0098 01762 movwf TXSTA 038D 1283 01763 bcf STATUS,RPO .•Select Register Page 0 01764 038E 3090 01765 movlw 090H ; Enable Transmit 038F 0098 01766 movwf RCSTA 0390 1622 01767 bsf Stat, BStLEDβ 0391 16A2 01768 bsf Stat,BStLED9 0392 30FF 01769 movlw OFFH /Turn OFF LEDs •?ASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 45 •nim Face Sensor II - PIC16C73 Control Code ain Routine OC OBJECT CODE LINE SOURCE TEXT VALUE 39300AB 01770 movwf LEDpat 394 3000 01771 movlw O00H Zlnit OUTpat 395 00AC 01772 movwf OUTpat 3962118 01773 call SNDOUT /Send Patterns 01774 01775 / clrf MODE /MODE - 0 01776 / clrf VCntrlL /VCntrlL - 0 1397 3014 01777 movlw TmrlOC / Init 10 ms Timeout )398 00A5 01778 movwf TmrlOms 3399 3032 01779 movlw BlkTmrC zlnit Blink Cycle 339A 00A4 01780 movwf BlkTmr 01781 039B 2144 01782 call GETIN zlnit Patterns 039C 2144 01783 call GETIN 039D 11A2 01784 bcf Stat,BSW12 /SWl Last Pressed 01785 039E 1622 01786 bsf Stat.BStLEDβ 039F 16A2 01787 bsf Stat,BStLED9 03A03064 01788 movlw VER /Display Version 03A1 3AFF 01789 xorlw OFFH 03A200AB 01790 movwf LEDpat 03A32118 01791 call SNDOUT /Send Patterns 03A43064 01792 movlw 100 /Delay 1 sec 03A5 OOAO 01793 movwf Temp 03A60064 01794 MAINO clrwdt Reset Watchdog Timer 03A7 1FA2 01795 btfss Stat,BTmrl0F .-Skip TmrlOF - 1 03A8 2BA6 01796 goto MAINO 03A9 13A2 01797 bcf Stat,BTmrlOF zTrarlOF - 0 Message(305] : Using default destination of 1 (file) . 03AA OBAO 01798 decfsz Temp 03AB 2BA6 01799 goto MAINO 03AC 30FF 01800 movlw OFFH zTurn OFF LEDs 03AD * OOAB 01801 movwf LEDpat 03AE 2118 01802 call SNDOUT zSend Patterns 01803 03AF 300C 01804 movlw 00CH zEnable PWM1/PWM2 03B00097 01805 movwf CCP1CON 03B1009D 01806 movwf CCP2CON 03B2 3004 01807 movlw 004H zEnable Timer 2 03B30092 01808 movwf T2CON 01809 03B4 21E3 01810 call GET zGet EPROM Parameters 03B50831 01811 movf VCntrll,W Zlnit PWM1 03B60095 01812 movwf CCPR1L 03B7 01BA 01813 clrf Bsuml zBsuml - Bavel 03B8 0839 01814 movf Bavel,W 03B9 OOBB 01815 movwf Bsuml+1 03BA 3001 01816 movlw 1 z Bcntl - 1 03BB 00B8 01817 movwf Bcntl 03BC 01CA 01818 clrf Bsum2 ;Bsum2 - Bave2 03BD 0849 01819 movf Bave2,W 03BE OOCB 01820 movwf Bsum2+1 03BF 3001 01821 movlw 1 /Bcnt2 - 1 ASM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 46 nim Face Sensor II - PIC16C73 Control Code in Routine C OBJECT CODE LINE SOURCE TEXT VALUE ICO 00C8 01822 movwf Bcnt2 IC10841 01823 movf VCntrl2,W Zlnit PWM2 )C2 009B 01824 movwf CCPR2L 01825 JC3 30FF 01826 movlw 255 zlnit MBarGrl/MBarGrl 3C4 00BC 01827 movwf MBarGrl 3C5 O0CC 01828 movwf MBarGr2 01829 01830 01831 01832 /* 01833 z* Main Loop 01834 /* ι3C60064 01835 MAIN1 clrwdt Reset watchdog Timer I3C7 1FA2 01836 btfss Stat.BTmrlOF ,-Skip TrarlOF - 1 )3C8 2BC6 01837 goto MAIN1 33C913A2 01838 bcf Stat.BTmrlOF zTmrlOF - 0 01839 33CA 2144 01840 call GETIN zGet Patterns 01841 03CB 0855 01842 movf CMTstat,W .•Test CMTstat 03CC 1903 01843 btfsc STATUS, Z ZSkip if > 0 03CD 2BF5 01844 goto MAIN2 03CE 1E0C 01845 btfss PIR1,TXIF zSkip if Transmit emp 03CF 2BF5 01846 goto MAIN2 03D0 0860 01847 movf CMTbuf, zSend Next Comm Char 03D10099 01848 movwf TXREG 03D2 0860 01849 movf CMTbuf, z Shift Comm Message 03D3 OOAO 01850 movwf Temp 03D4 0861 01851 movf CMTbuf+1,W 03DS 00E0 01852 movwf CMTbuf+0 03D60862 01853 movf CMTbuf+2,W 03D7 OOEl 01854 movwf CMTbuf+1 03D80863 01855 movf CMTbuf+3,W 03D900E2 01856 movwf CMTbuf+2 03DA 0864 01857 movf CMTbuf+4, 03DB O0E3 018S8 movwf CMTbuf+3 03DC 0865 01859 movf CMTbu +5,W 03DD 00E4 01860 movwf CMTbuf+4 03DE 0866 01861 movf CMTbuf+6,W 03DF 00E5 01862 movwf CMTbuf*5 03E00867 01863 movf CMTbuf+7,W 03E100E6 01864 movwf CMTbuf+6 03E2 0868 01865 movf CMTbuf+8, 03E300E7 01866 movwf CMTbuf+7 03E4 0869 01867 movf CMTbu +9,W 03E500E8 01868 movwf CMTbuf+8 03E6086A 01869 movf CMTbuf+10,W 03E7 00E9 01870 movwf CMTbuf+9 03E8086B 01871 movf CMTbuf+11, 03E9 OOEA 01872 movwf CMTbuf+10 03EA 086C 01873 movf CMTbuf+12, 03EB OOEB 01874 movwf CMTbuf+11 ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 47 nim Face Sensor II - PIC16C73 Control Code in Routine C OBJECT CODE LINE SOURCE TEXT VALUE IEC 086D 01875 movf CMTbuf+13,W IED 00EC 01876 movwf CMTbuf+12 IEE 086E 01877 movf CMTbuf+14,W 1EF 0OED 01878 movwf CMTbuf+13 JF0 086F 01879 movf CMTbu +15,W 3F1 00EE 01880 movwf CMTbuf+14 3F2 0820 01881 movf Temp.W 3F3 O0EF 01882 movwf CMTbuf+15 essage(305] : Using default destination of 1 (file) . 3F4 03D5 01883 decf CMTstat /Dec CMTstat 01884 3FS 1D05 01885 MAIN2 btfss PortA,BTEST /Skip if <> Test 3F62BFE 01886 goto MAINT 01887 I3F7227E 01888 call SSC1 /Process Sonic 1 )3F8 0831 01889 movf VCntrll,W /Reset PWM1? )3F9 1FA3 01890 btfss CStat,BCSclb /Skip if Calibration )3FA 0095 01891 movwf CCPRIL 01892 33FB 208A 01893 call LEDIO /Update LED Bar Graph 33FC 2118 01894 call SNDOUT /Send Patterns 01895 03FD 2BC6 01896 goto MAIN1 /Repeat Eternally 01897 01898 01899 Main Test Selections 01900 z* 03FE 0826 01901 MAINT movf SApat,W / Test switch Array Selection 03FF 390F 01902 andlw 00FH 04003A0F 01903 xorlw 00FH 0401 1903 01904 btfsc STATUS, Z /Skip if <> 1111 - Test I/O 0402 2C12 01905 goto MAINT1 04030826 01906 movf SApat, / Test Switch Array Selection 0404390F 01907 andlw 00FH 0405 3A07 01908 xorlw 007H 04061903 01909 btfsc STATUS, Z / Skip if <> 0111 - Test Control/Sonic Voltages 04072A64 01910 goto TSTCS 0408 0826 01911 movf SApat,W / Test Switch Array Selection 0409390F 01912 andlw 00FH 040A 3A0B 01913 xorlw 00BH 040B 1903 01914 btfsc STATUS, Z / Skip if <> 1011 - Test EEPROM 040C 2C12 01915 goto MAINT1 040D 0826 01916 movf SApat,W / Test Switch Array Selection 040E 390F 01917 andlw 00FH 040F 3A03 01918 xorlw 003H 0410 1903 01919 btfsc STATUS,Z / Skip if <> 0011 - Test RS-232 04112C12 01920 goto MAINT1 01921 0412 3000 01922 MAINT1 movlw / Blink LED Bar Graph OFF 0413 1F22 01923 btfss Stat,BBlnkF /Skip if BlnkF - 1 0414 30FF 01924 movlw OFFH / Blink LED Bar Graph ON 0415 202F 01925 call GLEDPAT 04162118 01926 call SNDOUT /Send Patterns ( ,>ASM 01.30.01 Intermediate SONIC . 1-20-1997 14:41:42 PAGE 4 -nim Face Sensor II - PIC16C73 Control Code .in Routine 3C OBJECT CODE LINE SOURCE TEXT VALUE 01927 nally 417 2BC6 01928 MAINTX goto MAI 1 /R epeat Eter 01929 01930 /* ---_. * *..*************************** 01931 ********************** * * ********** *** 01932 END J ASM 01.30.01 Intermediate SONIC . 1-20-1997 14:41:42 PAGE 49 .nim Face Sensor II - PIC16C73 Control Code lin Routine fMBOL TABLE LABEL VALUE CK 000001CC CKS 000001D7 DCONO 0000001F DCONl 0000009F DCS0 00000006 J3CS1 00000007 DIE 00000006 vDIF 00000006 -DON 00000000 -ORES ooooooiε IBlnkF 00000006 ICSclb 00000007 JCSclbC 00000006 3EDAT 00000003 BF 00000000 BFLGI 00000007 BFacel 00000000 BFace2 00000004 BINbndl 00000001 BINbnd2 00000O0S BINmtrl 00000000 BINmtr2 00000004 BLCLK 00000000 BLED8 00000000 BLED9 00000001 BOR 00000000 BPA0 00000000 BPA1 00000001 BPA3 00000003 BPB4 00000004 BPB5 00000005 BPB6 00000006 BPWM1 00000002 BPWM2 00000001 BRGH 00000002 BRX 00000007 BSAbcdO 00000007 BSAbcdl 00000006 BSAbcd2 00000005 BSAbcd3 00000004 BSλdlpO 00000003 BSAdlpl 00000002 BSAdip2 00000001 BSAdip3 00000000 BSCLK 00000003 BSIN 00000004 BSOUT 00000005 BSSPL 00000002 BSW1 00000004 BSW12 00000003 BSW2 00000005 BStLEDβ 00000004 BStLED9 00000005 ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 50 nim Face Sensor II - PIC16C73 Control Code in Routine MBOL TABLE LABEL VALUE BCDV1 00000076 BCDV11 00000077 :BCDV2 0000007E :BCDV21 00000080 • BCDV3 00000086 .CPICON 00000017 XP1IE 00000002 CP1IF 00000002 XP1M0 00000000 XP1M1 00000001 ΞCP1M2 00000002 CCP1M3 00000003 CCP1X 00000005 CCP1Y 00000004 CCP2CON 0000001D CCP2IE 00000000 CCP2IF 00000002 CCP2M0 00000000 CCP2M1 00000001 CCP2M2 00000002 CCP2M3 00000003 CCP2X 00000005 CCP2Y 00000004 CCPR1H 00000016 CCPR1L 00000015 CCPR2H 0000001C CCPR2L 0000001B CHS0 00000003 CHS1 00000004 CHS2 00000005 CKP 00000004 CLK81 00000213 CLK82 00000219 CLK83 0000021A CLK84 0000021D CLK8D 00000222 CLOCKS 00000210 CMTbuf 00000060 CMTstat 00000055 CNVBCDV 00000067 •ASM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 51 •nim Face Sensor II - PIC16C73 Control Code iln Routine rHBOln TABLE LABEL VALUE ΛEN 00000004 3RC 00000007 Sclb 00000080 SclbC 00000040 Sdly 00000007 SdlyC 00000004 Stat 00000023 A 00000005 c 00000001 HV 0000022F )IV1 00000233 )IV2 0000023F )IV3 00000246 3IV4 00000248 -DAT 00000008 FERR 00000002 FSR 00000004 GET 000001E3 GETAD 0000001E GETAD1 00000027 GEAD2 0000002B GETAD3 0000002D GETIN 00000144 GETIN1 0000014F GETIN2 00000169 GETIN21 0000018A GETIN3 00000193 GETIN4 000001AO GETINS 000001A4 GIE 00000007 GLEDP 00000038 GLEDP1 00000043 GLEDP2 00000044 GLEDP3 00000045 GLEDPAT 0000002F GODONE 00000002 GSMPP 00000050 GSMPP1 0000005B GSMPP2 0000005C GSMPP3 0000005E GSMPP4 00000065 GSMPP5 00000066 GSMPPAT 00000046 IBF 00000007 IBOV 00000005 INDF 00000000 INIT 00000000 INT 00000004 INT1 00000018 INTCON O000000B INTE 00000004 INTEDG 00000006 INTF 00000001 \SM 01.30.01 Intermediate SONIC. 1-20-1997 14:41:42 PAGE 52 l im Face Sensor II - PIC16C73 Control Code in Routine MBOL TABLE LABEL VALUE bndl 00000002 bnd2 00000020 mtrl 00000001 mtr2 00000010 Ipat 00000029 IpatSV 0000002A (.P 00000007 :LK 00000001 -D8 00000001 5D9 00000002 SDIO 0000008A EDIOl 0000008E EDIOll 00000096 EDI02 0000009F EDI021 000000B6 EDI03 000000C7 .EDI04 OO000OCF IEDIOS 000000D7 .EDI06 00OO0ODF .EDI061 O00O00E6 JEDI07 000000E9 .EDI071 000000F2 -EDI08 00000100 -EDIOβl 00000109 LEDIOX 00000117 LEDpat 0000002B MAIN 00000371 MAINO 000003A6 MAIN1 000003C6 MAIN2 000003F5 MAINT 000003FE MAI T1 00000412 MAINTX 00000417 MBarGrl 0000003C MBarGr2 0000004C MLEdlyl 0000003D MLEdly2 0000004D MPARM 00000050 MUL 00000223 MUL1 00000227 Mavel 00000035 MavelSV 00000037 Mave2 00000045 Mave2SV 00000047 Mcntl 00000032 Mcnt2 00000042 Msuml 00000033 Msum2 00000043 OBF 00000006 OERR 00000001 OPT 00000081 OUTpat 0000002C P 00000004 PASM 01.30.01 Intermediate SONIC .4 1-20 ■1997 14:41:42 PAGE 5. enim Face Sensor II - PIC16C73 Control Code ain Routine ΪMBOL TABLE LABEL VALUE CFGO 00000000 • CFGl 00000001 •CFG2 00000002 CL 00000002 •CLATH 00O0O0OA •CON 0000008E ?D 00000003 >EIE 00000006 ?IE1 0000008C PIE2 0000008D PIR1 O00000OC PIR2 OOO00O0D POR 00000001 PR2 00000092 PS0 00000000 PS1 00000001 PS2 00000002 PSA 00000003 PSPIE 00000007 PSPIF 00000007 PSPMODE .00000004 PWM1 00000004 PWM2 00000002 PortA 00000005 PortB 00000006 PortC 00000007 PortD 00000008 PortE 00000009 RBIE 00000003 RBIF 00000000 RBPU 00000007 RCIE 00000005 RCIF 00000005 RCREG 0000001A RCSTA 00000018 RPO 00000005 RP1 00000006 RW 00000002 RX 00000080 RX9 00000006 RX9D 00000000 S 00000003 SAVE 000001A5 SAbcd 00000028 SApat 00000026 SApatSV 00000027 SCLK 00000008 SIN 00000010 SNDOUT 00000118 SNDOUT1 0000011E SNDOUT2 00000123 SNDOUT3 00000124 SNDOUT 0000012C -\SM 01.30.01 Intermediate SONIC 1-20-1997 14:41:42 PAGE 54 nim Face Sensor II - PIC16C73 Control Code in Routine MBOL TABLE LABEL VALUE DOUT5 00000131 DOUT6 00000132 ■DOUT7 0000013D 1DOUT8 0000013E IDOUT9 00000142 IDOUTA 00000143 XJT 00000020 ?BRG 00000099 ?EN 00000007 REN 00000005 SCI 0000027E SC10 00000284 SC11 000002BE SC12 000002C9 SC121 000002DA SC122 000002EE ;SC123 000002FF iSC124 00000309 iSC125 0000030C 5SC13 0000030D 5SC131 00000324 5SC132 00000325 3SC14 00000329 3SC141 0000033A SSC142 00000342 SSC143 00000355 SSC144 0000036F SSC1X 00000370 SSPADD 00000093 SSPBUF 00000013 SSPCON 00000014 SSPEN 00000005 SSPIE 00000003 SSPIF 00000003 SSPL 00000004 SSPMO 00000000 SSPM1 00000001 SSPM2 00000002 SSPM3 00000003 SSPOV 00000006 SSPSTAT 00000094 SSTART 000001CO SSTOP 000001C6 STATUS 00000003 SW12 00000008 SYNC 00000004 S TEMP 0000005E StLEDβ 00000010 StLED9 00000020 Stat 00000022 T0CS 00000005 OIE 00000005 TOIF 00000002 'ASM 01.30.C1 Intermediate SONIC. . 1-20-1997 14:41:42 PAGE 55 •nim Face Sensor II - PIC16C73 Control Code lin Routine fMBOL TABLE LABEL VALUE 3SE 00000004 ICKPSO 00000004 1CKPS1 00000005 ICON 00000010 10SCEN 00000003 lSYNC 00000002 2CKPS0 00000000 2CKPS1 00000001 '2CON 00000012 • MRO 00000001 • MR1CS 00000001 • MR1H 0000000F ΓMRIIE 00000000 CMR1IF 00000000 ΓMRIL 0000000E IMRlON 00000000 IMR2 00000011 TMR2IE 00000001 TMR2IF 00000001 TMR20N 00000002 TMRC 0000007D TO 00000004 TOUTPS0 00000003 TOOTPSl 00000004 TOUTPS2 00000005 TOUTPS3 00000006 TRISA 00000085 TRISAC 0000003F TRISB 00000086 TRISBCI 00000008 TRISBCO 00000000 TRISC 00000087 TRISCC 00000090 TRISD 00000088 TRISE 00000089 TRISEO 00000000 TRISE1 00000001 TRISE2 00000002 TRMT 00000001 TSTCS 00000264 TSTCSl 00000276 TSTCS2 00000279 TSTCS3 0000027A TSTIO 00000255 TSTIOl 000002SF TSTSL 00000249 TSTSL1 000002S4 TX 00000040 TX9 00000006 TX9C 00000000 TXEN 00000005 TXIE 00000004 TXIF 00000004 69 " xgoε : aa -ι sp-tθ(Λ Λαo-iaw oreαβoia s»ox :pasα sp2θM Λ-ιo-ran ureαδoαa • pasnun sjjooi Λ-ιoora-ι αam χχ--_ : on-o xxxxxxxx XXXXXXXXXXXXXXXX : 00»0 xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx • • ooεb xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX xxxxxxxxxxxxxxxx : oβεo XXXXXXXXXXXXXXXX xxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX xxxxxxxxxxxxxxxx • • otεo XXXXXXXXXXXXXXXX xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX : OO€O XXXXXXXXXXXXXXXX -xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX : ODZO xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX : 0820 xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX : o»zo xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXX : 0020 xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx x>ocxxxxxxxxxxxx XXXXXXXXXXXXXXXX : 0DX0 xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX : 08X0 xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx • ovxo xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX : 00X0 xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX * 0300 xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXX3KXXXXXXXX XXXXXXXXXXXXXXXX : 0800 xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX : 0»00 xxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx XXXXXXXXXXXXXXX XXXXXXXXXXXX X : 0000 (pasnun 'pasn - ,χ.) avw aovsα xπowaw xooooooo _P xooooooo εt09x zooooooo _z -ISOOOOOO awax M OfrOOOOOO Z TUOSΛ oεoooooo loτuos* V9000000 H3/ αzoooooo ii-nuo/ azoooooo ll-UU-ty xvoooooo ZI-UUD / xεoooooo XX3 4 U0, xooooooo V: szoooooo sutoi-nu. 08000000 •-OX™ uoooooo DOX-ra xzoooooo I-hxra ozoooooo -rata 86000000 VISX 6X000000 -)-n» aiavi loan? apOD 95 3-Λ.d Z» : χ» : »I L66I-0Z-I a:,e pa-.:.aιuι lO -Qε ' IO MSV« ε8IS0/86Sα/I3d VSM 0 1.30.0 1 I nterme d iate SONIC. A- 1-20-199 7 1 4:41:42 l im Face S ensor II - PIC16C73 Control Code .n Routine rors 0 rnings 0 reported, 0 suppressed ssages 96 reported, 0 suppressed

Claims: CLAIMS We Claim: 1 . An automatic feeder for removing fabric workpieces from a stack of like workpieces. the workpieces having a first side and a second side, the first side having different surface characteristics from the second side, the workpieces being stacked with alternating sides up. for checking all fabric workpieces to determine the side which is up, and for inverting all workpieces w hich do not have the desired side up so that all workpieces arrive at a downstream sewing station having the same orientation, the feeder comprising: a picker means for picking the top workpiece from the stack of workpieces, separating it from the remaining stack, and moving it to a first downstream conveyor; a face detector mounted above said first conveyor for determining whether the first side or the second side of the workpiece is side up on the first conveyor: a pivoting feeder/inverter at the end of said first conveyor which can be selectively pivoted in a first direction to provide an input nip at a downstream end of said first conveyor for conveying a workpiece determined to have a desired side up in straight line fashion to an exit nip. and in a second direction to provide an input nip at a downstream end of said first conveyor for conveying and rotating 180 degrees about an axis along the direction of travel a workpiece determined by said face detector to have a desired side down: a second downstream conveyor at the exit nip of said pivoting feeder/inverter to carry the fabric workpieces to a sewing station: and. a feeder computer/controller for controlling and coordinating the operation of the picker means, the face detector, the feeder/inverter, and the downstream conveyors. 2. The automatic feeder of claim 1 additionally including a hold down means cooperative with said picker means and controlled by said feeder controller, for contacting and holding down a leading edge of a second workpiece in said stack after said picker has engaged a leading edge of a top workpiece in said stack. 3. The automatic feeder of claim 2 additionally including a means for blowing a stream of air between said top workpiece and said second workpiece after said picker has engaged said top workpiece and said hold down means has engaged said second workpiece. 4. The automatic feeder of claim 1 additionally including a plurality of sensors for providing control signals to said feeder controller representative of the position of the stack, the presence or absence of workpieces in the stack, and the position of the picker means. 5. The automatic feeder of claim 1 wherein the first side of each fabric workpiece is relatively rough and wherein the second side of each fabric workpiece is relatively smooth, and wherein said face detector comprises an ultrasonic transmitter, an ultrasonic receiver for receiving a reflected beam generated by said ultrasonic transmitter and reflected off the side of said fabric workpiece facing said face detector, and a detector controller in communication with said ultrasonic receiver and said feeder controller, said detector controller including instructions for comparing said signal from said ultrasonic receiver to a calculated threshold value to determine whether the first side of the fabric workpiece or the second side of the fabric workpiece is facing said face detector. 6. The automatic feeder of claim 5 wherein said detector controller continuously updates the calculated threshold value to correspond to the average difference in surface reflectivity measured from workpieces previously measured by said ultrasonic receiver. 7. The automatic feeder of claim 1 wherein said feeder/inverter includes a straight line feeder comprising a pair of driven sandwich belts. 8. The automatic feeder of claim 1 wherein said feeder/inverter includes a single, endless loop belt having two twists, said belt being mounted on two roller pairs arranged whereby said first roller pair provides an entry nip adjacent to a downstream end of said first conveyor and said second roller pair provides an exit nip adjacent to an upstream end of said second conveyor, said belt disposed to provide two twisted sandwich belt segments between said first and said second roller pairs which rotate through 180 degrees along an axis of travel between said first and said second roller pair. 9. The automatic feeder of claim 1 wherein said feeder/inverter is mounted to, and pivots about, an axle, and additionally includes a drive means for rotating said feeder/inverter on said axle. 10. The automatic feeder of claim 1 additionally including a wiper arm mounted between the feeder/inverter and the second conveyor for pushing a trailing edge of the fabric workpiece out of the feeder/inverter after the leading edge of the fabric workpiece has been placed onto and conveyed away by the second conveyor. 1 1 . An automatic feeder for removing and conveying fabric workpieces from a stack of like workpieces. the workpieces having a first side which has a relatively rough surface and a second side which has a relatively smooth surface, the first side having different surface characteristics from the second side, the workpieces being stacked with alternating sides up. including a picker means for removing a top workpiece from the stack, a dual path conveyor for moving the workpieces towards a sewing station, the dual path conveyor having a straight line path for conveying fabric workpieces without changing their orientation, and an inverting conveyor for turning the fabric workpiece over 180 degrees about an axis along the direction of travel: and a feeder controller for sensing and controlling the movement of the fabric workpieces. the improvement comprising: an ultrasonic face detector for determining which side of a fabric workpiece is facing said face detector, said face detector including an ultrasonic transmitter, an ultrasonic receiver oriented to receive a reflected beam generated by said ultrasonic transmitter, and a detector controller fo receiving a signal from said ultrasonic receiver representative of the reflectivity of the facing side of a fabric workpiece disposed beneath said ultrasonic face detector, for comparing said signal to a threshold value to determine whether the facing side is rough or smooth, and for communicating the identity of the facing side to the feeder controller. 12. The automatic feeder of claim 1 1 wherein said face detector controller includes a means for storing signals generated by said ultrasonic receiver and a set of instructions for continuously recalculating the threshold value by scanning consecutive pairs of workpieces. storing the two consecutive signals from the workpieces which are representative of one rough side and one smooth side, and recalculating the threshold value as a median between those two readings, and storing the threshold value to be used for comparison with the next two workpieces to pass through the ultrasonic face detector. 13. A method for feeding fabric workpieces one at a time from a stack of like workpieces. the workpieces having a first side and a second side, the first side having different surface characteristics from the second side, the workpieces being stacked with alternating sides up, using a feeding apparatus having a picker means, a first downstream conveyor, a face detector mounted above said first conveyor for determining whether the first side or the second side of the workpiece is side up on the first conveyor, a pivoting feeder/inverter at the end of said first conveyor which can be selectively pivoted to a first position to provide an input nip at a downstream end of said first conveyor for conveying a workpiece determined to have a desired side up in straight line fashion to an exit nip, and to a second position to provide an input nip at a downstream end of said first conveyor for conveying and rotating 180 degrees about an axis along the direction of travel a workpiece determined by said face detector to have a desired side down, a second downstream conveyor at the exit nip of said pivoting feeder/inverter to carry the fabric workpieces to a sewing station, and a feeder controller for controlling and coordinating the operation of the picker means, the face detector, the feeder/inverter, and the downstream conveyors, the method comprising the steps of: moving the picker means over the stack to engage a leading edge of a top fabric workpiece and remove it from the stack of workpieces; moving the fabric workpiece to the first conveyor and depositing the leading edge of said fabric workpiece onto said first conveyor whereby it is conveyed downstream and away from said stack; passing the fabric workpiece under the ultrasonic detector where an ultrasonic beam is reflected off the top surface of the fabric workpiece as it is conveyed on said first conveyor to the ultrasonic receiver to generate a signal which the face detector controller compares to a previously determined threshold value and generates a signal which represents whether the top surface of the fabric workpiece is relatively smooth or relatively rough: transmitting the signal generated by the face detector controller to feeder controller for a determination of whether the fabric workpiece is correctly oriented for further processing; if the fabric workpiece is correctly oriented, the feeder controller places the feeder/inverter to the first position, and if the fabric workpiece is not correctly oriented, the feeder controller places the feeder/inverter in the second position; moving the fabric workpiece on the first conveyor and into the correct nip of the feeder/inverter; convey the fabric workpiece through the feeder/inverter; and. moving the feeder/inverter to the alternative position to align a leading edge of the fabric workpiece with the second conveyor as the fabric workpiece exits the feeder/inverter. 14. The method of claim 13 including an additional step of activating a wiper arm mounted at the exit of the feeder/inverter to completely remove a trailing edge of the fabric workpiece from the feeder/inverter after the leading edge has been moved away by the second conveyor.

Inventors: AMIGH STEVEN ALAN, BLOUNT TIMOTHY MATTHEW, HALLAND KENT JOELL, KIM FRANK C H, KLUSMANN DONALD L, LIN WEI-CHIN, MUELLER FREDERICK N, SILVA PEDRO T, AMIGH, STEVEN, ALAN, BLOUNT, TIMOTHY, MATTHEW, HALLAND, KENT, JOELL, KIM, FRANK, C., H., KLUSMANN, DONALD, L., LIN, WEI-CHIN, MUELLER, FREDERICK, N., SILVA, PEDRO, T.
Applicants: STRAUSS LEVI & CO, LEVI STRAUSS & CO.
Application year: 1998
Main classification: B65H5
IPC codes: B65H15, B65H29