Shop OBEX P1 Docs P2 Docs Learn Events
Mysterious Failure of a BS2e OEM board. — Parallax Forums

Mysterious Failure of a BS2e OEM board.

Martin_HMartin_H Posts: 4,051
edited 2012-04-04 18:21 in BASIC Stamp
I was using my new BS2e OEM and decided to debug some of the inputs to debug with this program:
'{$STAMP BS2e}
'{$PBASIC 2.5}

X VAR Byte
Y VAR Byte

DO
  DEBUG "pins = ", DEC IN0, DEC IN1, DEC IN2, DEC IN3, IN4, IN5, CR
LOOP

There's a small problem in that I forgot the DEC on two of the outputs. But I now seem unable to upload new programs and I get a stamp not available. If I open the debug window the stamp is still dumping stuff to output and I occasionally see port in use when I try to upload. It is almost like the old program starts so fast after the reset that it prevents the upload of the new one.

Is there anyway out of this bind?

Update: I uploaded a hello world app to a second BS2e board and that worked. So the problem is isolated to this one board.

Update2: Since this EEPROM is removable and I have one left over from building a propeller board can I swap them out? I think this is the one I have from the Propeller board which looks compatible except being twice as big:

http://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/ProductID/400/Default.aspx?txtSearch=32k+eeprom

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-30 18:30
    If the Stamp is connected properly, it's impossible for a running program to prevent downloading of a new program. The serial port's DTR line is used to reset the Stamp's microprocessor and that overrides everything.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-30 18:34
    OK, but would a 32 kbit EEprom work if I wanted to try swapping it out? It happened right after I uploaded that program and perhaps my usb to serial adapter is freaked out by the timing or something?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-30 18:37
    I think you can use a 32K or 64K EEPROM in place of the 16K EEPROM used in the BS2e. The upper two address bits are "don't care" for the 16K while the 32K and 64K EEPROMs use them. You won't be able to use the extra space.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-30 18:48
    Swapping out the EEPROM stopped the program from running, but I still get no stamp found. When I put the old one back it continues to dump to the serial port. This is really odd because an identical board next to it works fine, and this board was running fine a few minutes before I put this program on it.

    When testing the pins I had them in input state and connected to either 5v or ground with a 220 ohm resistor, so I don't think I damaged the chip. I am really clueless about what is causing this.

    Update: Fresh batteries make no difference, but I was using the same batteries on the board that worked.

    Update2: I moved the BS2 OEM chip to the other board and I was able to upload a program to it.

    So its not the stamp and a change of EEPROM didn't fix it. I doubt it is the crystal because the stamp runs the old program.

    Update3: I moved the MAX232 chip from the non-working board to the working board. It works on that board. So that pretty much clears all the major components.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-30 19:33
    The circuitry between the DTR output of the MAX232 and the reset input of the SX that runs the Stamp is what's crucial. Have a close look at the BS2e OEM schematic. Again, because the reset circuitry is what's involved and a reset trumps anything else going on, the program that the Stamp is running can't affect whether the Stamp is identifiable or downloadable. There must be something wrong with your board's reset circuitry. If there's leakage between the serial output of the SX and the reset circuitry, that could explain how continuous output might interfere with the reset process.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-30 19:54
    Thanks Mike. I'm going over the board versus the schematic looking for issues. I'll pay particular attention to the reset circuitry.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-30 21:35
    So the SX Tx pin is connected to pin 14 of the MAX232 which outputs on its pin 11. Pin 11 is connected to a diode which in turn goes to pin 2 on the DB9 connector. The reset on pin 4 of the DB9 connector goes to pin 13 on the MAX232 which outputs on pin 12 and connects to a 4.6 KOhm resistor. I haven't been able to trace it to the reset pin on the SX.

    Since Tx and reset use adjacent pins on the MAX232 I looked for solder bridges and didn't see any. I noticed what looked like it might be a cold solder joint, but reheating it didn't help.

    I feel like I'm really close. Something I don't understand is this board is using a IRFU5505 http://www.irf.ru/pdf/IRFU5505.pdf which looks like it might be involved in the reset processing, but I'm not sure what it is for.

    Update I need to work on my taxes so I have to set this aside. Tomorrow I want to get my wall following example ready to share. So this is back burnered for now. My next step is to burn a new program on the eeprom on the other board. This way I can tell if this is a reset loop versus a failure in reset processing from the MAX232.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-31 11:08
    I got stuck on my taxes and came back to this.

    I am completely mystified. I went over the board with a fine tooth comb tested voltages and grounds, looked for solder bridges, checked resistances, checked diodes. The EEPROM and MAX232 work in both boards, but the BS2e stopped working both in the old board and the new. Which is a shame because it was working. I'm afraid what ever failure happened to the board killed it.

    Using my good board I replaced the program with one that outputs a startup message, pauses, outputs hello world in a loop, then halts. So it wasn't outbound serial communication because I kept getting stamp not available.

    The only thing left is assuming a failure of one of the components I can't test. I don't know how to test capacitors, the IRF5505, or the crystal.

    If the crystal failed could that break the interpreter?

    If I could resolve the problem I'd be willing to buy a new BS2e, but as it is I'm afraid to try because I have no way to fix things.

    As a long shot I'll post pictures of the board

    CbaBS2eBottom.jpg
    CbaBS2eTop.jpg
    1024 x 768 - 92K
    1024 x 768 - 117K
  • Mike GreenMike Green Posts: 23,101
    edited 2012-03-31 11:43
    How about a schematic? If the board manufacturer has an on-line schematic, that would be ok, but you'd need to carefully go over the board and correct the schematic so it reflects what's actually on the board rather than what the manufacturer says should be there.

    If the crystal were broken. the board would be dead ... nothing would work. It's not like the Propeller where it does downloads without a crystal.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-31 11:53
    I'm working on that. I have the complete documentation for the CBA and it doesn't have a schematic. I sent mail to Mike Davey to get his feedback since he is the creator of this board. We'll see if he replies because the CBA is ancient history to him.

    Update: I was comparing the board to the BS2e OEM schematic from the Parallax docs. Except for using the MAX232 it was pretty much identical.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-01 08:16
    Mike Davey got back to me and he read the thread. He thinks Mike Green is on the money. Specifically that the electrolytic capacitors used by the MAX232 have failed and this is producing improper voltages to the BS2e which would explain why it failed. I will test the voltage on the MAX232 pins on the good board and the bad one to verify.

    This hypothesis makes a fair bit of sense because the unit was unused for a few years. From what I have read electrolytic capacitors depend upon an oxide layer that is replenished by current flowing through the device. When unused this slowly breaks down and can cause problems.

    I also have the schematic and will upload it later.

    Update: Here's the schematic CBAMB_Sch.pdf and it looks like only the components in the lower right could be involved with the failure. Since the MAX232, the resistors, and the diode all check out, it can only be the 1 uF capacitors.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-02 16:33
    In case anyone is curious how this is turning out. I measured the voltage at different pins on the MAX232 on the good and bad board. On the good board both MAX232's had the same voltages. On the bad board the voltages on pins 6, 7, and 11 were two volts less than the good board. The MAX232 uses the four capacitors to pump the voltage up to RS232 level, so the capacitors have to be the root cause.

    It's a shame that this somehow damaged the BS2e, but stuff happens. So I am going to replace the capacitors and verify that corrects the voltage problem. If so I will try the working BS2e in the hopefully fixed board. If it works I am going to make lemonade from these lemons by converting the board to a BS2sx which it also supports.

    Mike Green and Mike Davey, thanks for your help as I was definitely lost on this one.
  • ercoerco Posts: 20,256
    edited 2012-04-03 01:33
    Martin_H: If you come to Expo, I'll GIVE you a brand new BS2E-IC (non-OEM). A little incentive to help defray your trip costs.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-03 05:54
    erco wrote: »
    Martin_H: If you come to Expo, I'll GIVE you a brand new BS2E-IC (non-OEM). A little incentive to help defray your trip costs.

    Erco, a generous offer, but my son's scout pack has an awards dinner that conflicts with the Expo. Plus there's a six hour flight each way which is a bit of a disincentive.
  • ercoerco Posts: 20,256
    edited 2012-04-03 11:02
    I'll throw in some relays & plywood... every man has his price. Bring your son or better yet, his whole Scout troop! I bet Ken will let you camp out behind Parallax. Turn Expo into a Jamboree! Every boy gets his Robotics merit badge that weekend! :)
  • Martin_HMartin_H Posts: 4,051
    edited 2012-04-04 18:21
    Thanks for the help. The board is now fixed. It was indeed the capacitors. This was an interesting experience because I never debugged this sort of hardware problem before.
Sign In or Register to comment.