PDA

View Full Version : bs2 "hangs up"



fsb
11-12-2009, 05:36 AM
I have a project which utilizes the melexis 90614 infrared thermometer, the ds1620 thermometer·chip and a CdS photocell.· A 433 MHz transmitter allows wireless capability. data is collected to Plx-daq

All components are wired as recommended by parallax literature (with any caps and resistors as specified).
Currently, I am using a benchtop regulated power supply (inside) with about 10 feet of wire to supply the equipment (which is outside) at 9 volts, 500mamps. All components are connect to a bs2 carrier (not super carrier) board.

Everything works great for about 48 to 72 hours, than the system "hangs up" and I have to reset by either
cutting and restarting power (if running wireless) or disconnecting and reconnecting Plx-daq (if the serial cable is connected).·

I thought initially it was a problem related to having the serial cable connected, however, the same thing happens with the cable disconnected with the data being sent via wireless transmitter.

Also, I initially had a tsl230 chip to evaluate ambient light.· I had more frequent episodes and initially thought it was related either the tsl230 chip or the CNT command... I have removed this from the system and still have issues.

So, my questions are as follows:

What am I doing wrong? would a super carrier board help?

Is there a way to automatically or periodically reset the system to avoid a persistent hang up?
Can I use another BS2 to monitor and reset the system if needed ?
I would like to use this remotely and relatively unattended, so I would like some way of having the system restart or be restarted should it hang up.

Thanks for any suggestions
-Frank


·

stamptrol
11-12-2009, 05:47 AM
I've had some systems running continuously for nearly 10 years so I'd suspect either a power supply problem or a programming problem. First, is the voltage at the stamp holding at 5 volts after a long period of operation?

Programming wise, if you use a SERIN and the data never arrives, the program will wait forever. Or, if you are waiting for a specific set of characters and they never arrive, the system will appear to hang.

If your serial connection isn't configured with the capacitors, as in later versions, the PC serial port can hold the Stamp in reset under certain conditions.

Can you show us your code?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

fsb
11-12-2009, 12:29 PM
Tom,

Thanks for your input.· I am assuming the voltage at the stamp has held at 5 volts, but I don't really have a way to monitor it continuously.· I could switch power supplies and see·what happens.·

I've attached the code as well.

Fsb

Mike Green
11-12-2009, 12:39 PM
There's nothing at first glance at your program that would cause it to reset periodically (like GOSUBs without RETURNs or RETURNs without GOSUBs). You probably have an intermittent power supply problem. One way to protect against that is to use a large electrolytic capacitor (1000uF 16V) across the supply wires at the Stamp board and a diode (like 1N4001) in series with the power supply (+) lead near the Stamp board. The power supply continually charges the capacitor. If there's a "glitch" in the supply voltage, the diode prevents the capacitor from discharging through the power supply and it'll power the Stamp and peripherals for a fraction of a second, probably long enough to keep things functioning.

stamptrol
11-12-2009, 10:56 PM
Its a long shot, but in your "getTemperature" routine, put in a timeout value in the SERIN command (see the Help file ) so if nothing comes from the temp chip
the program will eventually timeout and you can recover.

What I'm thinking is that for some reason the temp chip either doesn't respond at all or only partially responds which will leave the Stamp waiting indefinitely.


getTemperature: 'SECOND SUBROUTINE: IR temperature sensor
SEROUT Sensor,baud,[0,"!TEMR",xslave,$07]
SERIN Sensor,baud,[tempL,tempH]


GOTO convertTemperatures

Cheers,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

fsb
11-14-2009, 03:03 AM
Thanks for your advice.

I have added a diode and a cap as suggested

I have modified the serin command as suggested.

We'll see what happens!



Thanks again

fsb

fsb
12-01-2009, 12:08 AM
Thanks for everyones help.

Everything works great. No problems for two weeks.·

fsb