Unexpected 08M2 resets

Tyro

Member
For some time now I have been having problems with the 08M2 PICAXE chip randomly resetting to the beginning of the code. I believed it was a layout problem and made a work around in software.

I have since made two more projects but I am still getting unexplained resets. The latest project is a programmable power supply. It is simple and low power. It consists of a 08M2 and uses the PWMOUT function. A two stage RC filter converts the pulse stream to a dc voltage which is then buffered by an op-amp connected as a unity gain voltage follower. The output is within the regulated 5v supply.

The 08M2 is pre-programmed to go to a set voltage, wait for a logic signal, a pulse, then jump to a second voltage, wait for a second pulse, jump to another voltage, etc.

Many times after the first voltage jump, the program resets to the start. I added a small pause and jump to a low voltage at the beginning of the code so that I could see it was at the beginning and was still functioning. I used an old 08M and everything worked perfectly with no code or circuit change. On the 08M2 code supplied I have since added a DISCONNECT command. This had no effect.

Hardware description. A 1000pF capacitor is connected with very short leads to pins 1 and 8 of the 08M2. A 0.1uf ceramic capacitor is also connected with short leads and a 47uF tantalum is also connected. The supply is from a 78L05 regulator. (The reset problem still occurs with batteries). The serial in pin is directly connected to 0v. The two unused pins are set as low outputs. The first resistor in the RC filter is 1k, so no excessive high currents.

Any ideas what maybe causing the resets?
 

Attachments

Goeytex

Senior Member
Can't tell much from the code. It looks ok except that you created two symbols that are not used, (cycles & memnumber) or else the code you posted is not the complete code.

Word descriptions of a circuit are hard to analyze. If you can take the time to draw up a complete schematic and post it here, then you will likely get better help and a faster solution ... and you won't have to listen to the next 4 or 5 folks asking for a schematic.
 

eclectic

Moderator
Just posting the code to save folks having
to download / Load P.E. / Load the code.

Code:
'08m2
setfreq m8

symbol cycles = b0
symbol memnumber = b1
symbol buzin = pin3
symbol Sinput = pin4
symbol Vout = 2
disconnect
low 0
low 1
 pwmout Vout, 63, 1    '0v
 pause 4000
  pwmout Vout, 63, 30    '3.8v
Main:
 if Sinput = 0 then goto main   'wait for the DUT programming signal
 pause 5
 
 pwmout Vout, 63, 255    '5v
 pause 600
 
prog:
 if buzin = 1 then goto prog
 pause 100
 pwmout Vout, 63, 200    '3.8v
 pause 600
 
setUV:
 if buzin = 1 then goto setUV
 pause 100
 pwmout Vout, 63, 205    '3.9v
 pause 600
 
testUVHi:
 if buzin = 1 then goto testUVHi
 pause 100
Pwroff:
 pwmout Vout, off
 
 low Vout      '0v
  
 pause 2000      '1.sec
 
 pwmout Vout, 63, 195    '3.7v
 pause 600
 
testUVLo1:
 pause 100
 if buzin = 1 then goto testUVLo1 
 pause 600
testUVLo2:
 pause 100
 if buzin = 1 then goto testUVLo2 
 pause 600
testUVLo3:
 pause 30
 if buzin = 1 then goto testUVLo3 
 pause 1000  
 pwmout Vout, off     '0v
 
 low Vout
 goto main
e
 

Technical

Technical Support
Staff member
63 x 4 = 252

Code:
  pwmout Vout, 63, 255    '5v
http://www.picaxe.com/BASIC-Commands/Digital-InputOutput/pwmout/

Duty cycle is a 10 bit value (0 to 1023). The maximum duty cycle value must not be set greater than 4x the period, as the mark 'on time' would then be longer than the total PWM period (see equations above)! Setting above this value will cause erratic behaviour.
If it's not that it does sound like a noise issue. Also try a diode between input3 and V+ (pointed end towards V+) in case of noise on the input.
 

Tyro

Member
Sorry about no circuit. I only had a hand drawn one. The two extra symbols are left over from how I was going to write the code, not important.

I am having trouble sending the circuit diagram. The smallest I can make it is a 14.7k GIF image.
 

Tyro

Member
Thank you Technical. I just tried reducing the duty cycle (I used 251 to be sure) as suggested. No change, still resets. The only thing that changed was the output voltage was slightly lower, Adding diodes to both inputs also did nothing

I opened the PWMOUT wizard and using 31400Hz and 100% I got 2, 63, 255. This was using the 08M2 at 8MHz.
 

Tyro

Member
Thank you, MPep, I have lots of decoupling, see the hardware description. I have just fixed it with a schottky diode as suggested by technical. A silicon one did not work. In3 appears to be very sensitive.
 

inglewoodpete

Senior Member
Thank you, MPep, I have lots of decoupling, see the hardware description. I have just fixed it with a schottky diode as suggested by technical. A silicon one did not work. In3 appears to be very sensitive.
The topic has come up before. As you have discovered, the input can be very sensitive in certain configurations simply due to the fact that an internal diode can't be included on the silicon. Pin 3 (leg 4) is the programming pin of the native PIC and needs to able to handle the higher voltage Vpp to program it.
 

Technical

Technical Support
Staff member
Thank you, MPep, I have lots of decoupling, see the hardware description. I have just fixed it with a schottky diode as suggested by technical. A silicon one did not work. In3 appears to be very sensitive.
Glad you fixed it, but it proves that there is an initial fundamental circuit issue - in that you are getting pulses of a voltage above V+ onto that input.

The diode is a workaround and shouldn't be needed, ideally you should stop those above V+ pulses to start with....
 
Top