memory loss
i have the prop reading an r/c reciever and depending on what it sees running a 12 volt h bridge. it reads the radio on pin 2 and outputs to the bridge on pin 5, and 6. all grounds tied together. the problem is the prop runs things ok during a power on session that it is programmed in, but when the power is turned off and back on the output to the h bridge is pulsed when it is supposed to be constant. I've had this problem before thinkning i damaged the proto board, so i have a new one with the same thing happening. Im wondering what i could be doing to cause eeprom problems, and if anyone has had a similiar problem. thanks-mike

Comments
This sort of situation would not cause EEPROM problems nor would there be a hardware problem with the Protoboard itself.
CON _clkmode = xtal1 + pll16x 'Standard clock mode * crystal frequency = 80 MHz _xinfreq = 5_000_000 VAR long cyclep long endcyclep long startpulsep long endpulsep long pulsewidthp long cyclea long endcyclea long startpulsea long endpulsea long pulsewidtha long stack[100] long stack1[100] OBJ pst: "parallax serial terminal" PUB eye cognew(plow,@stack) cognew(display,@stack1) ' cog for pst for troubleshooting dira[2]~ ctra[30..26]:=%00100 ctra[5..0]:=2 'radio plugged into pin 2 'read r/c receiver section frqa:=1 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' repeat waitpeq(%000, |< 2, 0) ' wait for Pin 2 to go low 'for plow waitpeq(%100, |< 2, 0) 'Wait for Pin 2 to go high ' startpulsep:=cnt ' waitpeq(%000, |< 2, 0) ' wait for Pin 2 to go low ' endpulsep:=cnt ' waitpeq(%100, |< 2, 0) 'Wait for Pin 2 to go high ' ' endcyclep:=cnt ' pulsewidthp:=endpulsep-startpulsep ' ' cyclep:=endcyclep-startpulsep 'for plow pub display pst.start(115200) waitcnt(clkfreq/4+cnt) repeat 'serial terminal section ' pst.str(string("cyclep=")) 'display cyclewidth, and pulsewidth from receiver ' pst.dec (cyclep) pst.str(string(13,"pulsewidthp=")) pst.dec(pulsewidthp) waitcnt(clkfreq/1000+cnt) 'pst.clear pub plow dira[5..6]~~ 'notes stickup=154300 'deadstick=122000 'stickdown=89600 repeat outa[6]~ 'added to prevent shootthrough 'if stick is pushed up then turn on fwd repeat while pulsewidthp>132_400 and pulsewidthp <160_000 outa[5]~~ outa[5]~ repeat while pulsewidthp<110_400 and pulsewidthp >83_000 'if stick is pushed up then turn on reverse outa[6]~~Simple_MOSFET_H-Bridge duane j.pngYour indenting is inconsistent. The statements that are at the same level of nesting should line up. I don't think it will make a difference, but it makes the program hard to read.
Why the 4th WAITCNT? Once you see the HIGH-LOW transition, you're done with the pulse The WAITCNT for LOW-HIGH at the beginning of the loop is ok since it sets the initial condition for the loop.
Why the code for CTRA? You're not using it otherwise. How about commenting it out even though it shouldn't affect anything.