DISABLEBOD

mymps3

New Member

EDIT:UPDATE...... IF I turn on a light switch in another room, the picaxe 08 reboots..... hmmmmm.....


-------------------------------------------------------------------------------------------------


OMG, this command fixed my picaxe glitch when switching a 12 volt relay that switched 240 volts about 7 metres away.​

DISABLEBOD​

I never knew it existed !!!!!!!!😍😍

 
Last edited:
Hi, However, this does not solve the problem at its root; the chip's power supply needs to be improved. A diagram?
I will research more. The old chips used to have a resistor on the reset pin. I don't recall the ones needing that anymore. 7805 and 7812 regulators on my prototype board. 0.1uf caps, and I think 2x 100uf caps.
 

Attachments

  • 880eb34a-845f-4d37-bbf9-2b83768b5f9c.jpg
    880eb34a-845f-4d37-bbf9-2b83768b5f9c.jpg
    431.7 KB · Views: 37
It's a PSU issue you need to fix. When the relay is switched ON, it pulls a high current pulse for a few mS. If the PSU is 'weak', the supply voltage to the PICAXE drops. The 'Brown Out Detector' ( BOD ) then resets the chip safely before the supply reaches a dangerously low level. With BOD disabled there is a chance of the glitch permanently corrupting the chip.

A quick & dirty fix is to put a big, at least 100uF, cap close to the relay, directly across the coil. This acts as a reservoir that can hold up the supply for the few mS that the PSU is struggling. Another similar cap across the PICAXE chip will add an extra layer of protection.

However, as already mentioned, the root cause is poor PSU configuration. 78xx regulators need the 0.1uF and 100uF as close to the device pins as possible. ( I'd personally use 0.1uF & 470uF ) Another important aspect of PSU config is how you wire the 0v connections, and how chunky they are.

As already mentioned, a circuit diagram will be helpful.
 
It's a PSU issue you need to fix. When the relay is switched ON, it pulls a high current pulse for a few mS. If the PSU is 'weak', the supply voltage to the PICAXE drops. The 'Brown Out Detector' ( BOD ) then resets the chip safely before the supply reaches a dangerously low level. With BOD disabled there is a chance of the glitch permanently corrupting the chip.

A quick & dirty fix is to put a big, at least 100uF, cap close to the relay, directly across the coil. This acts as a reservoir that can hold up the supply for the few mS that the PSU is struggling. Another similar cap across the PICAXE chip will add an extra layer of protection.

However, as already mentioned, the root cause is poor PSU configuration. 78xx regulators need the 0.1uF and 100uF as close to the device pins as possible. ( I'd personally use 0.1uF & 470uF ) Another important aspect of PSU config is how you wire the 0v connections, and how chunky they are.

As already mentioned, a circuit diagram will be helpful.
Thank you. Weird becasue I haven't seen this kind of behavior in a Picaxe chip before and I have had many pcb's made over the last 15 years. This prototype had 12v and 5v supplies (running off the one power supply). I will change the 100uf caps to larger ones and test. I thought that I made the power supply overkill but maybe I'm wrong. The transformer is 10w 12 volt ac.


for reference.
 
The circuit is resetting when another 240v applicance is being switched on...... like a light switch or even a tumble dryer. This happens even if the picaxe circuit isn't actually doing anything... just waiting for an input from a magentic reed switch on a garage roller door.

I just unplugged the 3.5mm plug that plugs into my black box that runs to the door switch...... Now the picaxe chip doesn't RESET when I turn on other 240 volt applicances....... seems to be picking up maybe inductance. The switch cable is in square conduit that also has the 240 volt cable and 12v cable for the 12 volt relay (relay is like 7 metres away.).... Interesting!!!!!!
 
Last edited:
Ahh ! The picture is getting clearer. It definitely looks like cross-wire interference. I learnt many years ago, in industrial electronics, never put signal wires in the same conduit as power wires. Noise on the power wires is hundreds of times more powerful than the voltage on the signal wires, and it can easily disrupt the signal.

What does the circuitry around the PICAXE input from the reed switch look like ? Have you included noise suppression ?
 
Ahh ! The picture is getting clearer. It definitely looks like cross-wire interference. I learnt many years ago, in industrial electronics, never put signal wires in the same conduit as power wires. Noise on the power wires is hundreds of times more powerful than the voltage on the signal wires, and it can easily disrupt the signal.

What does the circuitry around the PICAXE input from the reed switch look like ? Have you included noise suppression ?


I just used the usual 1k to input pin and 10k to 5v +.

I will take it off the wall and put it back on the work bench and try and simulate.

Also, it still does glitch when the input switch cable is disconnected but DOES NOT glitch when the cable carrying 12V when OUTPUTED, is disconnected from the picaxe box.
Thank you !!!!!!
 
I fixed it.

I soldered a 0.1uf capacitor to the input pin and 5v(+) and no more glitchy things switching 240 volts. Such a simple fix.
 
Verily I say unto thee, he who leaves no capacitor across the power input pins, shall know only instability and endless lamentation. The noise shall rise up against thee, and the circuit shall falter in the land of thy projects.
 
I fixed it.

I soldered a 0.1uf capacitor to the input pin and 5v(+) and no more glitchy things switching 240 volts. Such a simple fix.
In the picture you provided, there appeared to be a decoupling cap in place already ... was that not the case?
 
It sounds to me as if the serial in pin is not wired correctly, with the pin ALWAYS pulled low via 22k + 10k resistors to 0v rail. Refer to Manual 1 page 8: "At a glance - download circuit:"
 
Ahh ! The picture is getting clearer. It definitely looks like cross-wire interference. I learnt many years ago, in industrial electronics, never put signal wires in the same conduit as power wires. Noise on the power wires is hundreds of times more powerful than the voltage on the signal wires, and it can easily disrupt the signal.

What does the circuitry around the PICAXE input from the reed switch look like ? Have you included noise suppression ?
No, I had not.
 
Verily I say unto thee, he who leaves no capacitor across the power input pins, shall know only instability and endless lamentation. The noise shall rise up against thee, and the circuit shall falter in the land of thy projects.
I have them though.
 
With careful wiring practices, you make a stable microcontroller circuit (or many circuits in my case). I was part of a team that developed a network of PICAXE chips controlling 64 x 12v DC motors (all generating commutator noise). The setup was the "body" of semi-living robotic art (drawing) machine that we exhibited in several different countries around the world. Refer to the URL below.

https://guybenary.com/work/silent-barrage/ We were a bit apprehensive at the exhibition shown in these photos: alongside our artwork machine, within the same walls of the art gallery, was an artwork that had about 40 ignition coils that produced wave after wave of sparks across the ceiling in their area. None of our network of 38 PICAXE chips showed any signs of instability.

The recommended practice is to mount your microcontroller in a socket so that you can check the circuit's wiring with a multimeter (and optionally a capacitance meter) before inserting the microcontroller. If you had done this, I would have suggested that you unplug the PICAXE and check the continuity/resistance between the serial-in pin and the 0v rail. DIP sockets are cheap and reliable.
 
Last edited:
With careful wiring practices, you make a stable microcontroller circuit (or many circuits in my case). I was part of a team that developed a network of PICAXE chips controlling 64 x 12v DC motors (all generating commutator noise). The setup was the "body" of semi-living robotic art (drawing) machine that we exhibited in several different countries around the world. Refer to the URL below.

https://guybenary.com/work/silent-barrage/ We were a bit apprehensive at the exhibition shown in these photos: alongside our artwork machine, within the same walls of the art gallery, was an artwork that had about 40 ignition coils that produced wave after wave of sparks across the ceiling in their area. None of our network of 38 PICAXE chips showed any signs of instability.

The recommended practice is to mount your microcontroller in a socket so that you can check the circuit's wiring with a multimeter (and optionally a capacitance meter) before inserting the microcontroller. If you had done this, I would have suggested that you unplug the PICAXE and check the continuity/resistance between the serial-in pin and the 0v rail. DIP sockets are cheap and reliable.
I rarely DO NOTuse an IC socket. Thanks for the info. The main problem is that my circuit is in box and mounted next to an automatic roller door motor and the circuit behaves itself most of the time. I still don't know exactly what is causing the chip to "RESET" . It will reset sometimes even when it is powering up a relay and a 240 volt ceiling light when it gets a "signal" from the reed switch, telling the chip that the door is now closed.
 
I still had the occasional glitch when the switch was activated (even if the relay was on and supplying 240 volts to the garage light).

I replaced the LM2937ET with the usual 7805 voltage regulator.

I removed the 0.1uF cap accross the input and changed the input capacitor caps to 470uF (one for the 5v and one for the 12v regulators). There were previously 100uF.

Just about to fit it back into the garage and test.......
--------------------------------------------------------------------------------------------------------------------------------
Not fixed.

Seems ok until I switch another light on in the home.... where as the 0.1uF did actually stop that from happening....
 
Last edited:
There is a significant difference between a ceramic/polyester/monolithic capacitors and electrolytics. Electrolytic capacitors are for energy storage and do not respond as well to high speed (dv/dt) transitions or noise. For best performance in supressing power supply electrical noise, use a ceramic capacitor (typically 100nF/0.1uF) AS WELL AS an electrolytic capacitor. The ceramic capacitor should be located as close as possible to the microcontroller's power pins, while the electro can be located further away. In matrix board or veroboard projects, I usually solder the capacitor directly to the chips socket's power pins under the board.

Without a schematic diagram of your circuit, it is pretty difficult for anyone to diagnose the problems you are encountering. I notice in your photo in post #3 that you have a lot of a quite long wires making up your circuit, which is mounted in a plastic case. Long wires can make good aerials for picking up RFI (interference), while a plastic case offers no shielding for RFI/electromagnetic noise from reaching the wiring. Where possible, shorten the wires and mount the whole circuit in an earthed metal case.
 
Hi, me again.

In my box, I soldered in series, a 200uH inductor on both of the wires that lead to the 12 volt relay which switches the 240 volt light. Now it does not glitch at all..... trust me, I really tried hard!!!



So....... the project is ALL GOOD. And I have NOT used the disablebod in my program.
 
Back
Top