20M2 Serin Pin Name?

erco

Senior Member
If I want to use the Serin pin as a GP normally low input, what's the pin name? IIRC the Serout pin is A.0. TIA.
 
Last edited:

hippy

Technical Support
Staff member
Download Serial In is not available as a normal digital input on the 20M2. If you want to have access to it you would probably need to PEEKSFR the port register. Haven't tested if that works.
 

AllyCat

Senior Member
Hi,

No, PICaxe Basic doesn't support a port.pin name for Leg2, and there is only "partial" support for A.0 / Leg19 (IIRC it can't be symbolised).

But you should be able to Read/Write the SIn pin via a PEEK/POKESFR command, which is "Bit 5" in "Port A". The address seems to be $0C for the port, and banks 1 ($2C) and 2 ($4C) for the TRIS and LAT flags respectively. Also the Weak Pullup Resistor is available via bit5 of the WPUA SFR.

Beware that other pins of the base PIC's PortA are mapped onto the PICAXE's Ports B and C.

Cheers, Alan.
 

erco

Senior Member
Thanks for that info, all.

@hippy: It would be helpful to note the 20M2's exclusion in Manual 1, which simply states: On M2 and X2 parts the ‘serial in’ pin may be used as a general purpose input, connected to a switch as shown.
 

Attachments

Last edited:
Top