Thermistor Cable Harness Tester

This is still a work in progress, but since I made a lot of headway in the last week, I just had to post some pictures and details. I am making a custom test fixture for some cable harnesses we build at work.
Scope of Project:
The proto board will be in the enclosure with the display mounted in the top of the enclosure. The 2x7 connector will be on the front side facing the operator so that the adapter cable with the spring pins is easy to get to. There will be a set of "keys" on a key ring that will correspond to each cable assembly part number. When powered up, a bootloader program from the onboard EEPROM runs and the display will prompt for a key to be inserted into the 2x2 connector on the side. Each key connects an EEPROM so that the programmer has a specific configuration program. With a key inserted, the display will show "ready to test Part Number XXXX with X thermistors", and the test loop begins. The test loop consists of the following steps:
1) Read on board thermistor value as reference .
2) Read thermistors on 2x7 connector per key.
3) Compare values using appropriate tolerance.
4) Light the 7 LEDs appropriately (green=pass, red=fail, off=NA)
5) Display results on screen (IE: "All Pass" or "CH2 Fail High")
6) When the harness is removed and all readings are infinite, display will show the ready message again.
7) If the key is removed at any point, the tester will exit the test loop by rebooting to the bootloader code prompting for a key..
Attached are pictures of the prototype unit and a graphical representation of one of thermistor cable configurations we build (this one is 7 thermistors with 2 interconnects)
Scope of Project:
The proto board will be in the enclosure with the display mounted in the top of the enclosure. The 2x7 connector will be on the front side facing the operator so that the adapter cable with the spring pins is easy to get to. There will be a set of "keys" on a key ring that will correspond to each cable assembly part number. When powered up, a bootloader program from the onboard EEPROM runs and the display will prompt for a key to be inserted into the 2x2 connector on the side. Each key connects an EEPROM so that the programmer has a specific configuration program. With a key inserted, the display will show "ready to test Part Number XXXX with X thermistors", and the test loop begins. The test loop consists of the following steps:
1) Read on board thermistor value as reference .
2) Read thermistors on 2x7 connector per key.
3) Compare values using appropriate tolerance.
4) Light the 7 LEDs appropriately (green=pass, red=fail, off=NA)
5) Display results on screen (IE: "All Pass" or "CH2 Fail High")
6) When the harness is removed and all readings are infinite, display will show the ready message again.
7) If the key is removed at any point, the tester will exit the test loop by rebooting to the bootloader code prompting for a key..
Attached are pictures of the prototype unit and a graphical representation of one of thermistor cable configurations we build (this one is 7 thermistors with 2 interconnects)
Comments
Details:
**RC Decay occurs on P0-P7. P0 is a reference thermistor (the little black bead looking thing next to the yellow cap on P0). P1-P7 have caps on the PCB, but run out to the 14 pin Molex MicroFit panel mount connector where the thermistor harness attaches for testing.
**The 7 Bi-Color LEDs are banked using P11-P17 for one side and P21-P27 on the other side. This enabled me to "dumb down" the code for when I start making different configurations. 220 Ohm resistors are placed from the P21-P27 side and then red 26AWG is used to run them to the suface mount header positioned above P11-P15. On the backside, short jumpers feed over P16 and P17 to the header. The bi-color LEDs have Molex SL series 2 pin connectors to connect to the header.
**The LCD is connected to P8 on one of the servo headers and tied it's Vdd is tied to 5 volts with a jumper wire.
My code is not finished, because I will eventually be using a bootloader and loading specific configurations from an "EEPROM Key". However, this test code attached enables me to use the tester for a specific cable assembly with 7 thermistors. The code is thoroughly commented.
Any feedback on code is welcome, even criticism.....
{{ Thermistor Cable Harness Tester Andrew Williams 4/25/2011, Version X14 This code started with the RC Decay lab from Propeller Education Kit and is used to test a cable harness consisting of 7 thermistors. The RCDecay loops simply test each thermistor and store the result in an array. Then, a display loop presents the results on Bi-Color LEDs and a 2x16 serial LCD. X01.....Setup for Pin13 X02.....Setup for two separate Pins with two pubs X03.....Setup for variable for pin 12 X04.....Setup for repeat loop, but dead X05.....Setup for repeat loop, dead after removing Main2 (missing master repeat) X06.....Cleanup working 2 thermistor code X07.....Add BiColor LED X08..... X09.....Added settle time X10.....Renumbered for Proto board and 7 thermistors X11.....Added PST and loops for LEDs, tested without ref thermistor X12.....Added ref thermistor and fixed code to final therm configuration X13.....Added LCD and some comments X14.....Commented out PST, fixed LCD display runovers }} CON _clkmode = xtal1 + pll16x ' System clock → 80 MHz _xinfreq = 5_000_000 LCD_PIN = 8 ' for Parallax 2x16 serial LCD on P8 LCD_BAUD = 9_600 LCD_LINES = 2 Var byte NumErr OBJ lcd : "Serial_lcd" '2x16 Serial LCD ' pst : "Parallax Serial Terminal" ' Use with Parallax Serial Terminal to ' display values PUB Init ' pst.Start(115_200) 'Start Parallax Serial Terminal main ' Call the Main method PUB Main | time[8], thermpin dira[11..17]~~ ' set 1st LED pin (P11-P 17) as outputs (green c dira[21..27]~~ ' set 2nd LED pin (P21..P27) as outputs if lcd.init(LCD_PIN, LCD_BAUD, LCD_LINES) ' start lcd lcd.cursor(0) ' cursor off lcd.backLight(true) ' backlight on (if available) lcd.cls ' clear the lcd lcd.str(string("P/N 47-0838-001", 13)) ' Put cable part number on first line of LCD waitcnt(clkfreq + cnt) ' Pause 1 second repeat numerr := 0 ' clear error count for test loop lcd.clrln(1) ' clear 2nd line of LCD lcd.gotoxy(0,1) ' move to first space of second line lcd.str(string("TESTING.")) ' write to LCD repeat thermpin from 0 to 7 ' check all thermistors, including reference at 0 lcd.str(string(".")) ' write a "." to LCD upon each thermistor as a progress line ' Configure counter module. ctra[30..26] := %01000 ' Set mode to "POS detector" ctra[5..0] := thermpin ' Set APIN to thermpin frqa := 1 ' Increment phsa by 1 for each clock tick waitcnt(clkfreq/1_000 + cnt) ' Settle time dira[thermpin] := outa[thermpin] := 1 ' Set pin to output-high waitcnt(clkfreq/100_000 + cnt) ' Wait for circuit to charge phsa~ ' Clear the phsa register dira[thermpin]~ ' Pin to input stops charging circuit waitcnt(clkfreq/300 + cnt) ' Allow time for discharge time[thermpin] := (phsa - 637) #> 0 'Adjust ticks between phsa~ & dira[thermpin]~. waitcnt(clkfreq/8 + cnt) ' quick pause ' pst.clear ' clear the PST window lcd.clrln(1) ' clear 2nd line of LCD repeat thermpin from 1 to 7 ' repeat LED/LCD results for 7 thermistors 'pst.Str(String(pst#NL, "Time ")) ' Show Time in PST 'pst.Dec(thermpin) ' and thermistor number 'pst.Str(String(": ")) ' and colon 'pst.Dec(time[thermpin]-time[0]) ' and difference between ref therm 0 and current thermistor if time[thermpin] - time[0] > 22000 or time[0] - time[thermpin] > 22000 ' if thermistor is different by more than 22000 from ref numerr++ ' increase the error count outa[10 + thermpin] := 0 ' set thermpin LED for Red cathode outa[20 + thermpin] := 1 ' set thermpin LED for Red anode if thermpin > 6 ' determine position for result on LCD (thermistor positions are physically: 7,1,2,3,4,5,6) lcd.gotoxy(0, 1) ' goto leftmost position if thermistor 7 lcd.str(string("F")) ' mark as a fail else lcd.gotoxy(thermpin*2, 1) ' if 1-6, go to position equal to 2x thermistor number lcd.str(string("F")) ' mark as fail else ' if thermistor is within tolerance to ref.... outa[10 + thermpin] := 1 ' set thermpin LED for Green anode outa[20 + thermpin] := 0 ' set thermpin LED for Green cathode if thermpin > 6 ' determine position for result on LCD (thermistor positions are physically: 7,1,2,3,4,5,6) lcd.gotoxy(0, 1) ' goto leftmost position if thermistor 7 lcd.str(string("P")) ' mark as pass else lcd.gotoxy(thermpin*2, 1) ' if 1-6, go to position equal to 2x thermistor number lcd.str(string("P")) ' mark as pass if numerr > 0 ' If any errors lcd.gotoxy(15,1) ' goto to bottom left of LCD lcd.cursor(3) ' and blink the cursor else ' If no errors lcd.gotoxy(15,1) ' goto to bottom left of LCD lcd.cursor(2) ' and hide the cursor waitcnt(clkfreq * 2 + cnt) ' leave results up for 2 seconds outa[11..17] := %0000000 ' Turn Off LEDs outa[21..27] := %0000000 '
Actually, with such a great looking case though, it doesn't look much like a "prototype" - well done!
-Matt
Since Parallax offers a laser cut case for the proto board and publishes the drawings with it, prototypes do look more like finished products. So I agree with you in how much nicer it looks compared to my other "prototypes". I should have more pics over the next few days as I hope to spend some of my birthday weekend (4/1) on Propeller projects. The code is about half done and I have a couple EEPROM keys made up already. I also need to make an EEPROM key programmer.
To-Do list as of 4/25:
1) Another set of plastics cut.
2) Wire up EEPROM Key connector
3) Wire up power switch.
4) Setup code for bootloader/secondary EEPROM functionailty
5) Figure out how to load programs to a secondary EEPROM without using a socket.
6) Decide on power source (I may just use a wall wart now since the inside is a little packed and each bench has power anyways)
7) Fully document for a Customer Applications Submission to Parallax
For the DC jack mod, I cut off the back tab (positive center tab) just above the bottom edge of the jack. Then I soldered on a surface mount two pin header with one pin up towards the center pin and the other pin down so that it would fit into the hole for the original pin. This created a place to connect my panel mount power switch's 2 pin AMP MTA connector. The proto board's power switch is left in the full on position. If I want to bypass my panel mount switch, I can just put a jumper shunt across this 2 pin header.
The 4 pin Molex EEPROM Connector is connected to P28/P29 and 3.3v/GND and the EEPROM has a pullup on the A0 pin. The current EEPROM key is made from a piece of perfboard, a DIP8 socket, and a DIP8 32kb EEPROM. I will be making future keys with a surface mount SSOP8 and a SSOP to DIP8 adapter board to keep the height to a minimum. I am also working on an acrylic housing to make it like a key fob.
When the unit is turned on without an EEPROM key, the LCD says "Searching for Key..." and then after a second, changes to "KEY NOT FOUND, restarting...". While that is displayed, the LEDs light up one at a time and then the bootloader program restarts.
Anytime the EEPROM key is plugged in, the EEPROM key program is loaded during the "Searching for Key..." step.
When the EEPROM Key program runs, it displays the cable part number on the top line of the LCD and "testing..." on the bottom line. The RCDecay loops run and then the second line of the LCD will display a P or F for each of the 7 possible thermistors and the LEDs light red or green respectively.
For my debugging, I made a sample 7 thermistor "harness" that is only a couple inches long from 7 of the thermistors used on an actual harness.
All that is left is to solder the 2 pin header for the power LED (I forgot that) and make more EEPROM Keys.
Now to do the formal write-up for the customer apps section of Parallax.......
Mike
Wow, you are exactly correct. I am one set of holes off, so my inline current limiting resistors are doing absolutely nothing. Great catch! Obviously hasn't caused issues, but not working as I designed.