08M2 initial state of I/O pins

fernando_g

Senior Member
When an 08M2 powers up, and before any command is actually executed, the multi purpose I/O pins start as inputs, correct?
Meaning a high impedance.

Is there a workaround to ensure that they start low?
 

AllyCat

Senior Member
Hi,

Pin C.0 is a default-Low Output from power-up and C.5 requires a pull-down resistor anyway (which the program can pull High with the internal Weak-Pullup resistor if desired) but both of these pins must pulse-High during Programming.

You can connect external pull-down resistors on any of the other pins, but otherwise AFAIK the best that can be done is to make the first instruction in the program a DirsC= 31 (strictly 23 or %10111), or similar.

Cheers, Alan.
 

bpowell

Senior Member
All the pins are INPUT at power-up ... once the PICAXE firmware starts executing, the pins will probably match what Allycat mentioned above. There is no way to NOT have the pins be an input at power-up, as this is the default value of the TRISA register (which determines if a pin is an innie or an outie)
 

fernando_g

Senior Member
Thanks for corroborating what I found the hard way.
And indeed, a pull down resistor does the trick. However I dead-bugged it (*), but was wondering whether there was a cleaner approach.

(*) I have always felt that a deadbug means that one didn’t study the data sheets in depth or some other oversight. In my case, if I had used C.0 instead of C.1, this issue would be avoided. Oh well! Learned something new.
 

bpowell

Senior Member
(*) I have always felt that a deadbug means that one didn’t study the data sheets in depth or some other oversight. In my case, if I had used C.0 instead of C.1, this issue would be avoided. Oh well! Learned something new.
Glad you found the issue! I'd always thought "Dead bugging" was the act of adding discrete components to another component directly, vs. using trace-wire, PCB, etc... for example, soldering a .01uf cap across the PWR and GND pins of a PIC directly (soldering to the pins themselves).

I'd say not reviewing datasheets would be going into the project "half cocked" which refers to some models of firearm which are either carried half-cocked for safety, or, moved to half-cock for loading ... either way, the gun won't fire from the half-cocked position ... so you're not properly prepared for the situation.
 

fernando_g

Senior Member
Deadbug means exactly what you wrote.
But my interpretation is that one was forced to do that, because you missed something.
That “something” is almost always included somewhere in the data sheet or app notes.
 

AllyCat

Senior Member
Hi,

To us, "Dead Bug" assembly was a literal and legitimate prototype assembly method (in the late '60s). The (DIL) Integrated Circuits were mounted upside down (maybe even glued) directly onto the "breadboard", with their legs (pins) facing up into the air. All the Inter-Connections were then made directly onto the (upwards) ends of the pins, for example with "Wire Wrap" (single core) insulated wire for Logic circuits.

But my preferred method was to mount the DIL ICs through punched "Veroboard" (usually without the now-familiar copper strips) and create a "pseudo-PCB" layout by bending the leads of the through-hole components, and perhaps additional "BTC" (Bare Tinned Copper) wire, to create the interconnection tracks. In both cases, all the IC pins are numbered in the logical Clockwise sequence !

Cheers, Alan.
 
Top