18M2 pin states during download

bgrabowski

Senior Member
I was expecting all Picaxe 18M2 pins (ignoring serial in and serial out) to be in the high impedance state during programme download.

Pins B.3 and B.6 (the PWM pins) are grounded during download. Does anyone know why?
 

westaust55

Moderator
I had a somewhat similar understanding.

But in reviewing PICAXE manuals 1 and 2 all statements relate to the situation at power up:

When the PICAXE-08 first powers up, all pins are configured as input pins (except
pin0, which is always an output).

====================
All pins are configured as inputs on first power-up (unless the pin is a fixed
output).

Some microcontrollers allow inputs to be configured as inputs or outputs. In
these cases it is necessary to tell the microcontroller which pins to use as inputs and/or outputs (all are configured as inputs on first power up).

Many PICAXE microcontrollers allow pins to be configured as inputs or outputs.
In these cases it is necessary to tell the microcontroller which pins to use as
inputs and/or outputs (all are configured as inputs on first power up).

Note that ‘run 0’ is not the same as the ‘reset’ command, as the reset commandwill also reset all variables and convert all pins back to inputs.

whilst the PICAXE chip initialises upon power up. During this
short initialisation period the drivers are not actively driven (ie they ‘float’)
My past observation with non X2/M2 parts is that the outputs at least go to a low state when a download is commenced. Have never checked if they reveert to an input state until the new program commances.

Certainly from reading of many datasheets and related litureature, all Microchip PIC chips sets all pins as inputs at the instant of power on.

What happens in the case of a hard reset versus a program download?

Would seem a case for Rev Ed (Techncial/hippy) to give a difinitive answer for the cases of power up/reset/download.
 
Last edited:

hippy

Technical Support
Staff member
Operation should be as described for power-on resets but it may be that a download interrupting a running program does not re-initialise some settings to the same as the power-on reset state; some PICmicro peripheral settings may override other settings. In most cases this shouldn't matter; if PWMOUT has been enabled then having the PWMOUT pin go to 0 or 1 should be compatible with the hardware used. We would need to investigate further.
 

bgrabowski

Senior Member
Spot on Hippy. The problem arises when re-programming, with the existing programme running pwmout.

Westaus: I can confirm that a hard reset is a viable workaround for me.
 
Top