RonHackett
Member
Three or four years ago, there was a thread about using the 20M serial output pin as a regular output (http://www.picaxeforum.co.uk/showthread.php?9170). At the time, there was some question as to whether the untested code (suggested by Hippy and Technical) would actually work. I've done some searching, but have been unable to locate any follow-ups, so I'm curious - has anyone been successful with this?
I have been trying to do the same thing with the serial out pin on a 20M2, but so far no luck. If I'm reading the PIC16F1829 data sheet correctly, the 20M2 serial out pin is bit 0 of portA (location 0x0C) on the PICmicro, so I adapted the code from the earlier 20M thread for the 20M2 as follows:
Every two seconds, an LED attached to the serial out pin of the 20M2 blinks very briefly, so I think that I have the correct SFR address. However, the LED doesn't stay on during the one-second delay (the blink is so fast that it's just barely visible), so possibly the PICAXE firmware is doing something to reset the serial output pin? If that's the case, does anyone know of a way to stop it from doing so? I tried using "disconnect" but it didn't make any difference.
I have been trying to do the same thing with the serial out pin on a 20M2, but so far no luck. If I'm reading the PIC16F1829 data sheet correctly, the 20M2 serial out pin is bit 0 of portA (location 0x0C) on the PICmicro, so I adapted the code from the earlier 20M thread for the 20M2 as follows:
Code:
do
peeksfr 0x0C, b0
b0 = b0 | 0x01 ' set serial out High
pokesfr 0x0C, b0
wait 1
peeksfr 0x0C, b0
b0 = b0 & 0xFE ' set serial out Low
pokesfr 0x0C, b0
wait 1
loop