hippy
Ex-Staff (retired)
Using the same cable for download and run-time communications without swapping cables has always been a bit of a challenge for the PICAXE-08M, having no SERRXD command. The easiest solution has been to add an extra 22K and a link between SI and 0V; remove link to download, fit link for run-time comms. A bit of a fiddly nuisance ...
Here's a simpler software driven solution which works for me, but use at your own risk ...
This enables the LP ( Low Power ) Oscillator for Timer 1 which reconfigures the SI and X4 pins internally so download initiations are completely ignored. The disadvantages are that it needs a Hard Reset, power off then on, to do any download, and X4 is no longer available for use. It should not affect SERVO, PWMOUT or other commands which rely on Timer 2 operation. I'm not sure what relies on Timer 1 if anything.
Try the program without the "POKE $10" and you will see the 08M issuing the "RESET" message whenever you send data. With the "POKE $10" in place it works as expected, echoing data sent via the Programming Editor Terminal.
Note there's no need for a clamp diode on Pin 3 as it is connected to SI and its internal clamping diode does the job required.
Code:
TX <---------------------------------------.
22K .---------. |
___ | +V 0V | |
RX >----.---|___|----.-------| SI O0 |---'
| ___ | | X4 X1 |
|---|___|----|-------| I3 X2 |
.|. 22K | `---------'
| | O -.
|_| 10K O -' Link to run
| |
0V -----^------------^----------------------
Code:
TX <---------------------------------------.
.---------. |
___ | +V 0V | |
RX >----.---|___|----.-------| SI O0 |---'
.|. 22K | | X4 X1 |
| | `-------| I3 X2 |
|_| 10K `---------'
|
0V -----^-----------------------------------
Pause 500
SerOut 0,N2400,("RESET",CR,LF)
Poke $10,%00001111
Do
SerIn 3,N2400,b0
SerOut 0,N2400,("<",b0,">")
Loop
Try the program without the "POKE $10" and you will see the 08M issuing the "RESET" message whenever you send data. With the "POKE $10" in place it works as expected, echoing data sent via the Programming Editor Terminal.
Note there's no need for a clamp diode on Pin 3 as it is connected to SI and its internal clamping diode does the job required.
Last edited: