Quick 18M2 question

AlbertZ

Senior Member
Can pinC.4 be utilized as a digital input? The reason I ask is that for some reason the simulator will not allow me to toggle it hi/lo. I am using all the other pinsC except C.3 as inputs.
 

techElder

Well-known member
For one thing, if you are trying to toggle "pinC.4", it won't work because that form is for checking the status of the pin.

Just do toggle C.4 and see how that works.
 

AllyCat

Senior Member
Hi Albert,

I presume you are trying to toggle the input pin by clicking it when the simulator is running.

This looks to be a bug in PE6 (I'm not running the very latest version, are you?). It toggles fine in PE5.

Cheers, Alan.
 

AlbertZ

Senior Member
Hi Albert,

I presume you are trying to toggle the input pin by clicking it when the simulator is running.

This looks to be a bug in PE6 (I'm not running the very latest version, are you?). It toggles fine in PE5.

Cheers, Alan.
Hi Alan,

Yes I'm running PE6 version 6.0.7.5, and yes I'm trying to toggle it by clicking on the pin. Perhaps one of the tech guys can chime in and confirm. All the other input pins respond appropriately (C.3 being the exception).
 

AlbertZ

Senior Member
For one thing, if you are trying to toggle "pinC.4", it won't work because that form is for checking the status of the pin.

Just do toggle C.4 and see how that works.
The toggle command is only for outputs, not inputs. I was referring to the simulation by clicking on the pin.
 

hippy

Technical Support
Staff member
Pin C.4 on the 18M2 is the Download Serial In. When you click on that it resets the PICAXE program as it would on a physical chip. To use it as a digital input and allow it to be toggled as an input add the DISCONNECT command to your program.
 

AlbertZ

Senior Member
Pin C.4 on the 18M2 is the Download Serial In. When you click on that it resets the PICAXE program as it would on a physical chip. To use it as a digital input and allow it to be toggled as an input add the DISCONNECT command to your program.
thanks hippy
 

erco

Senior Member
@hippy: On a 20M2, is there a way to access the serin and serout programming pins? We're fresh out of port.pin numbers.
 

AllyCat

Senior Member
Hi,

"Pin A.0" can be used in some circumstances for the Serial Output pin, but I believe there is no equivalent for the Serial Input Pin. It's also possible to do some "clever" things with READDAC (not ADC) on the serial output pin. ;)

However, you can do a certain amount via the SFR registers, for example activating the Weak Pulup Resistors on those pins. They are both part of the base PIC Port A, but note that the pin numbers are different. Several other of the PICaxe B and C port pins are actually on the base PIC Port A.

Cheers, Alan.
 
Top